cipher wipe out

This commit is contained in:
Gidon Gershinsky committed 2019-05-28 08:31:58 +03:00
1 parent abd76a6221
commit e784d9d9ca
1 file changed
+12
+12
View File
@@ -59,6 +59,12 @@ class AesEncryptor {
int key_len, uint8_t* aad, int aad_len, uint8_t* nonce,
uint8_t* encrypted_footer);
void WipeOut() {
if (NULLPTR != ctx_) {
EVP_CIPHER_CTX_free(ctx_);
}
}
~AesEncryptor() {
if (NULLPTR != ctx_) {
EVP_CIPHER_CTX_free(ctx_);
@@ -91,6 +97,12 @@ class AesDecryptor {
int Decrypt(const uint8_t* ciphertext, int ciphertext_len, uint8_t* key, int key_len,
uint8_t* aad, int aad_len, uint8_t* plaintext);
void WipeOut() {
if (NULLPTR != ctx_) {
EVP_CIPHER_CTX_free(ctx_);
}
}
~AesDecryptor() {
if (NULLPTR != ctx_) {
EVP_CIPHER_CTX_free(ctx_);