aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsa_ameth.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-03-01 17:57:01 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-03-01 17:57:01 +0000
commit9aeed18ad799c20d3accf6e1535817538dc983f6 (patch)
tree37a4bb1290ee86a2b4ce070f139b2379ee747425 /crypto/dsa/dsa_ameth.c
parentc188d4cade9cba451816aef2371942bea4ff837f (diff)
downloadsrc-9aeed18ad799c20d3accf6e1535817538dc983f6.tar.gz
src-9aeed18ad799c20d3accf6e1535817538dc983f6.zip
Import OpenSSL 1.0.2g.vendor/openssl/1.0.2g
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=296273 svn path=/vendor-crypto/openssl/1.0.2g/; revision=296274; tag=vendor/openssl/1.0.2g
Diffstat (limited to 'crypto/dsa/dsa_ameth.c')
-rw-r--r--crypto/dsa/dsa_ameth.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c
index c40e1777ade1..cc83d6e6ad3b 100644
--- a/crypto/dsa/dsa_ameth.c
+++ b/crypto/dsa/dsa_ameth.c
@@ -191,6 +191,8 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
STACK_OF(ASN1_TYPE) *ndsa = NULL;
DSA *dsa = NULL;
+ int ret = 0;
+
if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
return 0;
X509_ALGOR_get0(NULL, &ptype, &pval, palg);
@@ -262,23 +264,21 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
}
EVP_PKEY_assign_DSA(pkey, dsa);
- BN_CTX_free(ctx);
- if (ndsa)
- sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
- else
- ASN1_STRING_clear_free(privkey);
- return 1;
+ ret = 1;
+ goto done;
decerr:
- DSAerr(DSA_F_DSA_PRIV_DECODE, EVP_R_DECODE_ERROR);
+ DSAerr(DSA_F_DSA_PRIV_DECODE, DSA_R_DECODE_ERROR);
dsaerr:
+ DSA_free(dsa);
+ done:
BN_CTX_free(ctx);
- if (privkey)
+ if (ndsa)
+ sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
+ else
ASN1_STRING_clear_free(privkey);
- sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
- DSA_free(dsa);
- return 0;
+ return ret;
}
static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)