Skip to content

Commit

Permalink
Fix possible memory leak during ElGamal key generation with OpenSSL 3…
Browse files Browse the repository at this point in the history
….0 backend.
  • Loading branch information
ni4 authored and antonsviridenko committed Jun 9, 2023
1 parent 12133aa commit 32149be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/crypto/elgamal_ossl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ elgamal_generate(rnp::RNG *rng, pgp_eg_key_t *key, size_t keybits)
goto done;
}
if (y.bytes() != BITS_TO_BYTES(keybits)) {
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
EVP_PKEY_free(pkey);
pkey = NULL;
goto start;
}

Expand Down

0 comments on commit 32149be

Please sign in to comment.