Skip to content

Commit

Permalink
[libfko] apply zero_buf() to stack allocated Rijndael context for enc…
Browse files Browse the repository at this point in the history
…rypt/decrypt
  • Loading branch information
mrash committed Jul 13, 2013
1 parent 3e8e9f7 commit f391b13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/cipher_funcs.c
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit f391b13

Please sign in to comment.