clean stack properly

This commit is contained in:
Steffen Jaeckel 2017-05-01 12:25:18 +02:00
parent 3e2ac192a1
commit 2858373e2e

View File

@ -147,11 +147,11 @@ static int chc_compress(hash_state *md, unsigned char *buf)
for (x = 0; x < cipher_blocksize; x++) { for (x = 0; x < cipher_blocksize; x++) {
md->chc.state[x] ^= T[0][x] ^ T[1][x]; md->chc.state[x] ^= T[0][x] ^ T[1][x];
} }
XFREE(key);
#ifdef LTC_CLEAN_STACK #ifdef LTC_CLEAN_STACK
zeromem(T, sizeof(T)); zeromem(T, sizeof(T));
zeromem(&key, sizeof(key)); zeromem(key, sizeof(*key));
#endif #endif
XFREE(key);
return CRYPT_OK; return CRYPT_OK;
} }