[libfko] apply zero_buf() to stack allocated Rijndael context for encrypt/decrypt

This commit is contained in:
Michael Rash 2013-07-12 23:21:38 -04:00
parent 3e8e9f76a0
commit f391b1391d

View File

@ -262,6 +262,10 @@ rij_encrypt(unsigned char *in, size_t in_len,
ondx += in_len+pad_val;
zero_buf((char *)ctx.key, RIJNDAEL_MAX_KEYSIZE);
zero_buf((char *)ctx.iv, RIJNDAEL_BLOCKSIZE);
zero_buf((char *)ctx.salt, SALT_LEN);
return(ondx - out);
}
@ -312,6 +316,10 @@ rij_decrypt(unsigned char *in, size_t in_len,
*ondx = '\0';
zero_buf((char *)ctx.key, RIJNDAEL_MAX_KEYSIZE);
zero_buf((char *)ctx.iv, RIJNDAEL_BLOCKSIZE);
zero_buf((char *)ctx.salt, SALT_LEN);
return(ondx - out);
}