[libfko] apply zero_buf() to stack allocated Rijndael context for encrypt/decrypt
This commit is contained in:
parent
3e8e9f76a0
commit
f391b1391d
@ -262,6 +262,10 @@ rij_encrypt(unsigned char *in, size_t in_len,
|
|||||||
|
|
||||||
ondx += in_len+pad_val;
|
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);
|
return(ondx - out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,6 +316,10 @@ rij_decrypt(unsigned char *in, size_t in_len,
|
|||||||
|
|
||||||
*ondx = '\0';
|
*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);
|
return(ondx - out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user