From f0816174d264b11f6f4ccb41c75883640a2416bb Mon Sep 17 00:00:00 2001 From: mancha Date: Thu, 24 Apr 2014 19:06:20 +0000 Subject: [PATCH 12/17] Fix eckey_priv_encode() Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey. --- CHANGES | 4 ++++ crypto/ec/ec_ameth.c | 1 + 2 files changed, 5 insertions(+) diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index 0ce4524..f715a23 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -352,6 +352,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); -- 1.8.4.5