Skip to content

Commit

Permalink
Do not double-destroy botan's crypto object.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 authored and antonsviridenko committed Aug 22, 2023
1 parent b4ae749 commit 22f5b19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/crypto/symmetric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ pgp_cipher_aead_finish(pgp_crypt_t *crypt, uint8_t *out, const uint8_t *in, size
void
pgp_cipher_aead_destroy(pgp_crypt_t *crypt)
{
botan_cipher_destroy(crypt->aead.obj);
if (crypt->aead.obj) {
botan_cipher_destroy(crypt->aead.obj);
}
memset(crypt, 0x0, sizeof(*crypt));
}

size_t
Expand Down

0 comments on commit 22f5b19

Please sign in to comment.