From: mancha Date: Thu, 24 Apr 2014 19:06:20 +0000 (+0000) Subject: Fix eckey_priv_encode() X-Git-Tag: master-post-reformat~852 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e14f14d36e429762b277bd584329d815760b95d2;p=oweals%2Fopenssl.git Fix eckey_priv_encode() Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey. --- diff --git a/CHANGES b/CHANGES index bb03d196d0..b9cd499c95 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes between 1.0.2 and 1.1.0 [xx XXX xxxx] + *) Fix eckey_priv_encode so it immediately returns an error upon a failure + in i2d_ECPrivateKey. + [mancha ] + *) Fix some double frees. These are not thought to be exploitable. [mancha ] diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index ae9d5319a3..bede19b2c7 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -356,6 +356,7 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) EC_KEY_set_enc_flags(ec_key, old_flags); OPENSSL_free(ep); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); + return 0; } /* restore old encoding flags */ EC_KEY_set_enc_flags(ec_key, old_flags);