summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2015-07-20 15:29:13 +0000
committermiod <>2015-07-20 15:29:13 +0000
commitad64bd77855220f45e0e3adbd4f6ffa738a5a7d2 (patch)
tree96982846dac00a43ab0cced11dcf4ae26e3a8c41
parenta1e161dab09914b53d120c7ca6cce1b44e5b0ee0 (diff)
downloadopenbsd-ad64bd77855220f45e0e3adbd4f6ffa738a5a7d2.tar.gz
openbsd-ad64bd77855220f45e0e3adbd4f6ffa738a5a7d2.tar.bz2
openbsd-ad64bd77855220f45e0e3adbd4f6ffa738a5a7d2.zip
When freeing an X509_CRL, if freeing the user-maintained meth_data fails,
do not forgot to nevertheless keep freeing the other fields. ok doug@ guenther@
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_crl.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 7b76d2ec47..6062587ed4 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_crl.c,v 1.24 2015/02/11 04:00:39 jsing Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.25 2015/07/20 15:29:13 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 *
@@ -270,6 +270,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
270 STACK_OF(X509_EXTENSION) *exts; 270 STACK_OF(X509_EXTENSION) *exts;
271 X509_EXTENSION *ext; 271 X509_EXTENSION *ext;
272 int idx; 272 int idx;
273 int rc = 1;
273 274
274 switch (operation) { 275 switch (operation) {
275 case ASN1_OP_NEW_POST: 276 case ASN1_OP_NEW_POST:
@@ -345,7 +346,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
345 case ASN1_OP_FREE_POST: 346 case ASN1_OP_FREE_POST:
346 if (crl->meth->crl_free) { 347 if (crl->meth->crl_free) {
347 if (!crl->meth->crl_free(crl)) 348 if (!crl->meth->crl_free(crl))
348 return 0; 349 rc = 0;
349 } 350 }
350 if (crl->akid) 351 if (crl->akid)
351 AUTHORITY_KEYID_free(crl->akid); 352 AUTHORITY_KEYID_free(crl->akid);
@@ -356,7 +357,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
356 sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); 357 sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
357 break; 358 break;
358 } 359 }
359 return 1; 360 return rc;
360} 361}
361 362
362/* Convert IDP into a more convenient form */ 363/* Convert IDP into a more convenient form */
diff --git a/src/lib/libssl/src/crypto/asn1/x_crl.c b/src/lib/libssl/src/crypto/asn1/x_crl.c
index 7b76d2ec47..6062587ed4 100644
--- a/src/lib/libssl/src/crypto/asn1/x_crl.c
+++ b/src/lib/libssl/src/crypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_crl.c,v 1.24 2015/02/11 04:00:39 jsing Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.25 2015/07/20 15:29:13 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 *
@@ -270,6 +270,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
270 STACK_OF(X509_EXTENSION) *exts; 270 STACK_OF(X509_EXTENSION) *exts;
271 X509_EXTENSION *ext; 271 X509_EXTENSION *ext;
272 int idx; 272 int idx;
273 int rc = 1;
273 274
274 switch (operation) { 275 switch (operation) {
275 case ASN1_OP_NEW_POST: 276 case ASN1_OP_NEW_POST:
@@ -345,7 +346,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
345 case ASN1_OP_FREE_POST: 346 case ASN1_OP_FREE_POST:
346 if (crl->meth->crl_free) { 347 if (crl->meth->crl_free) {
347 if (!crl->meth->crl_free(crl)) 348 if (!crl->meth->crl_free(crl))
348 return 0; 349 rc = 0;
349 } 350 }
350 if (crl->akid) 351 if (crl->akid)
351 AUTHORITY_KEYID_free(crl->akid); 352 AUTHORITY_KEYID_free(crl->akid);
@@ -356,7 +357,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
356 sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); 357 sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
357 break; 358 break;
358 } 359 }
359 return 1; 360 return rc;
360} 361}
361 362
362/* Convert IDP into a more convenient form */ 363/* Convert IDP into a more convenient form */