fortuna - move LBL_UNLOCK before zeromem

This commit is contained in:
Karel Miko 2017-04-29 13:39:48 +02:00
parent c6cee7bef0
commit d7f2b2dd6e

View File

@ -281,10 +281,10 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state
tlen = 0;
}
LBL_UNLOCK:
#ifdef LTC_CLEAN_STACK
zeromem(tmp, sizeof(tmp));
#endif
LBL_UNLOCK:
LTC_MUTEX_UNLOCK(&prng->lock);
return tlen;
}
@ -313,10 +313,10 @@ int fortuna_done(prng_state *prng)
/* call cipher done when we invent one ;-) */
err = CRYPT_OK; /* success */
LBL_UNLOCK:
#ifdef LTC_CLEAN_STACK
zeromem(tmp, sizeof(tmp));
#endif
LBL_UNLOCK:
LTC_MUTEX_UNLOCK(&prng->lock);
return err;
}