diff options
author | Werner Koch <wk@gnupg.org> | 2018-10-24 09:50:17 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2018-10-24 09:50:17 +0200 |
commit | 149ceb3cae03d0385341d32430aa5ae57de90007 (patch) | |
tree | 1ec1c6a27c1eb4eb8fc80fe76ab75f334ec501e3 /cipher/ecc-eddsa.c | |
parent | 0e071372fc0e6fed4a449955ed0789803ba5e709 (diff) | |
download | libgcrypt-149ceb3cae03d0385341d32430aa5ae57de90007.tar.gz |
ecc: Fix possible memory leakage in parameter check of eddsa.
* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_verify): Fix mem leak.
--
GnuPG-bug-id: 4209
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'cipher/ecc-eddsa.c')
-rw-r--r-- | cipher/ecc-eddsa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c index 813e030d..89b708a0 100644 --- a/cipher/ecc-eddsa.c +++ b/cipher/ecc-eddsa.c @@ -760,7 +760,10 @@ _gcry_ecc_eddsa_verify (gcry_mpi_t input, ECC_public_key *pkey, pkey->E.p, pkey->E.a, pkey->E.b); b = ctx->nbits/8; if (b != 256/8) - return GPG_ERR_INTERNAL; /* We only support 256 bit. */ + { + rc = GPG_ERR_INTERNAL; /* We only support 256 bit. */ + goto leave; + } /* Decode and check the public key. */ rc = _gcry_ecc_eddsa_decodepoint (pk, ctx, &Q, &encpk, &encpklen); |