Blame SOURCES/openssl-1.0.1e-cve-2016-0705.patch
|
|
8fbb1c |
diff -up openssl-1.0.1e/crypto/dsa/dsa_ameth.c.dsa-doublefree openssl-1.0.1e/crypto/dsa/dsa_ameth.c
|
|
|
8fbb1c |
--- openssl-1.0.1e/crypto/dsa/dsa_ameth.c.dsa-doublefree 2013-02-11 16:26:04.000000000 +0100
|
|
|
8fbb1c |
+++ openssl-1.0.1e/crypto/dsa/dsa_ameth.c 2016-02-24 14:38:46.075165304 +0100
|
|
|
8fbb1c |
@@ -201,6 +201,8 @@ static int dsa_priv_decode(EVP_PKEY *pke
|
|
|
8fbb1c |
STACK_OF(ASN1_TYPE) *ndsa = NULL;
|
|
|
8fbb1c |
DSA *dsa = NULL;
|
|
|
8fbb1c |
|
|
|
8fbb1c |
+ int ret = 0;
|
|
|
8fbb1c |
+
|
|
|
8fbb1c |
if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
|
|
|
8fbb1c |
return 0;
|
|
|
8fbb1c |
X509_ALGOR_get0(NULL, &ptype, &pval, palg);
|
|
|
8fbb1c |
@@ -281,23 +283,21 @@ static int dsa_priv_decode(EVP_PKEY *pke
|
|
|
8fbb1c |
}
|
|
|
8fbb1c |
|
|
|
8fbb1c |
EVP_PKEY_assign_DSA(pkey, dsa);
|
|
|
8fbb1c |
- BN_CTX_free (ctx);
|
|
|
8fbb1c |
- if(ndsa)
|
|
|
8fbb1c |
- sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
|
|
|
8fbb1c |
- else
|
|
|
8fbb1c |
- ASN1_INTEGER_free(privkey);
|
|
|
8fbb1c |
|
|
|
8fbb1c |
- return 1;
|
|
|
8fbb1c |
+ ret = 1;
|
|
|
8fbb1c |
+ goto done;
|
|
|
8fbb1c |
|
|
|
8fbb1c |
decerr:
|
|
|
8fbb1c |
DSAerr(DSA_F_DSA_PRIV_DECODE, EVP_R_DECODE_ERROR);
|
|
|
8fbb1c |
dsaerr:
|
|
|
8fbb1c |
- BN_CTX_free (ctx);
|
|
|
8fbb1c |
- if (privkey)
|
|
|
8fbb1c |
- ASN1_INTEGER_free(privkey);
|
|
|
8fbb1c |
- sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
|
|
|
8fbb1c |
DSA_free(dsa);
|
|
|
8fbb1c |
- return 0;
|
|
|
8fbb1c |
+ done:
|
|
|
8fbb1c |
+ BN_CTX_free (ctx);
|
|
|
8fbb1c |
+ if (ndsa)
|
|
|
8fbb1c |
+ sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
|
|
|
8fbb1c |
+ else
|
|
|
8fbb1c |
+ ASN1_INTEGER_free(privkey);
|
|
|
8fbb1c |
+ return ret;
|
|
|
8fbb1c |
}
|
|
|
8fbb1c |
|
|
|
8fbb1c |
static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|