diff options
Diffstat (limited to 'src/lib/libcrypto/pem')
| -rw-r--r-- | src/lib/libcrypto/pem/pem_pk8.c | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/pem/pem_pkey.c | 11 | ||||
| -rw-r--r-- | src/lib/libcrypto/pem/pvkfmt.c | 17 |
3 files changed, 12 insertions, 21 deletions
diff --git a/src/lib/libcrypto/pem/pem_pk8.c b/src/lib/libcrypto/pem/pem_pk8.c index dafbd13814..8d7ac4a954 100644 --- a/src/lib/libcrypto/pem/pem_pk8.c +++ b/src/lib/libcrypto/pem/pem_pk8.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pem_pk8.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: pem_pk8.c,v 1.8 2014/07/12 16:03:37 miod Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -184,8 +184,7 @@ d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | |||
| 184 | if (!ret) | 184 | if (!ret) |
| 185 | return NULL; | 185 | return NULL; |
| 186 | if (x) { | 186 | if (x) { |
| 187 | if (*x) | 187 | EVP_PKEY_free(*x); |
| 188 | EVP_PKEY_free(*x); | ||
| 189 | *x = ret; | 188 | *x = ret; |
| 190 | } | 189 | } |
| 191 | return ret; | 190 | return ret; |
diff --git a/src/lib/libcrypto/pem/pem_pkey.c b/src/lib/libcrypto/pem/pem_pkey.c index 7e5e4f5771..a50742a63d 100644 --- a/src/lib/libcrypto/pem/pem_pkey.c +++ b/src/lib/libcrypto/pem/pem_pkey.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pem_pkey.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: pem_pkey.c,v 1.18 2014/07/12 16:03:37 miod Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -99,8 +99,7 @@ PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | |||
| 99 | goto p8err; | 99 | goto p8err; |
| 100 | ret = EVP_PKCS82PKEY(p8inf); | 100 | ret = EVP_PKCS82PKEY(p8inf); |
| 101 | if (x) { | 101 | if (x) { |
| 102 | if (*x) | 102 | EVP_PKEY_free(*x); |
| 103 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 104 | *x = ret; | 103 | *x = ret; |
| 105 | } | 104 | } |
| 106 | PKCS8_PRIV_KEY_INFO_free(p8inf); | 105 | PKCS8_PRIV_KEY_INFO_free(p8inf); |
| @@ -128,8 +127,7 @@ PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | |||
| 128 | goto p8err; | 127 | goto p8err; |
| 129 | ret = EVP_PKCS82PKEY(p8inf); | 128 | ret = EVP_PKCS82PKEY(p8inf); |
| 130 | if (x) { | 129 | if (x) { |
| 131 | if (*x) | 130 | EVP_PKEY_free(*x); |
| 132 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 133 | *x = ret; | 131 | *x = ret; |
| 134 | } | 132 | } |
| 135 | PKCS8_PRIV_KEY_INFO_free(p8inf); | 133 | PKCS8_PRIV_KEY_INFO_free(p8inf); |
| @@ -194,8 +192,7 @@ PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x) | |||
| 194 | goto err; | 192 | goto err; |
| 195 | } | 193 | } |
| 196 | if (x) { | 194 | if (x) { |
| 197 | if (*x) | 195 | EVP_PKEY_free(*x); |
| 198 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 199 | *x = ret; | 196 | *x = ret; |
| 200 | } | 197 | } |
| 201 | } | 198 | } |
diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c index 32fcc181f7..ca7e908c29 100644 --- a/src/lib/libcrypto/pem/pvkfmt.c +++ b/src/lib/libcrypto/pem/pvkfmt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pvkfmt.c,v 1.10 2014/07/11 15:35:53 miod Exp $ */ | 1 | /* $OpenBSD: pvkfmt.c,v 1.11 2014/07/12 16:03:37 miod Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2005. | 3 | * project 2005. |
| 4 | */ | 4 | */ |
| @@ -349,12 +349,9 @@ b2i_dss(const unsigned char **in, unsigned int length, unsigned int bitlen, | |||
| 349 | 349 | ||
| 350 | memerr: | 350 | memerr: |
| 351 | PEMerr(PEM_F_B2I_DSS, ERR_R_MALLOC_FAILURE); | 351 | PEMerr(PEM_F_B2I_DSS, ERR_R_MALLOC_FAILURE); |
| 352 | if (dsa) | 352 | DSA_free(dsa); |
| 353 | DSA_free(dsa); | 353 | EVP_PKEY_free(ret); |
| 354 | if (ret) | 354 | BN_CTX_free(ctx); |
| 355 | EVP_PKEY_free(ret); | ||
| 356 | if (ctx) | ||
| 357 | BN_CTX_free(ctx); | ||
| 358 | return NULL; | 355 | return NULL; |
| 359 | } | 356 | } |
| 360 | 357 | ||
| @@ -402,10 +399,8 @@ b2i_rsa(const unsigned char **in, unsigned int length, unsigned int bitlen, | |||
| 402 | 399 | ||
| 403 | memerr: | 400 | memerr: |
| 404 | PEMerr(PEM_F_B2I_RSA, ERR_R_MALLOC_FAILURE); | 401 | PEMerr(PEM_F_B2I_RSA, ERR_R_MALLOC_FAILURE); |
| 405 | if (rsa) | 402 | RSA_free(rsa); |
| 406 | RSA_free(rsa); | 403 | EVP_PKEY_free(ret); |
| 407 | if (ret) | ||
| 408 | EVP_PKEY_free(ret); | ||
| 409 | return NULL; | 404 | return NULL; |
| 410 | } | 405 | } |
| 411 | 406 | ||
