diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_alt.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_alt.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509/x509_alt.c b/src/lib/libcrypto/x509/x509_alt.c index 35aae6f185..845ab1364f 100644 --- a/src/lib/libcrypto/x509/x509_alt.c +++ b/src/lib/libcrypto/x509/x509_alt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_alt.c,v 1.10 2022/03/13 16:48:49 tb Exp $ */ | 1 | /* $OpenBSD: x509_alt.c,v 1.11 2022/03/14 21:15:49 tb 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. | 3 | * project. |
4 | */ | 4 | */ |
@@ -657,17 +657,14 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
657 | */ | 657 | */ |
658 | 658 | ||
659 | if (is_nc) { | 659 | if (is_nc) { |
660 | struct x509_constraints_name constraints_name; | 660 | struct x509_constraints_name *constraints_name = NULL; |
661 | int error = 0; | ||
662 | 661 | ||
663 | memset(&constraints_name, 0, sizeof(constraints_name)); | 662 | if (!x509_constraints_validate(ret, &constraints_name, NULL)) { |
664 | type = x509_constraints_validate(ret, &constraints_name, &error); | ||
665 | if (type == 0 || error != 0) { | ||
666 | X509V3error(X509V3_R_BAD_OBJECT); | 663 | X509V3error(X509V3_R_BAD_OBJECT); |
667 | ERR_asprintf_error_data("name=%s", name); | 664 | ERR_asprintf_error_data("name=%s", name); |
668 | goto err; | 665 | goto err; |
669 | } | 666 | } |
670 | x509_constraints_name_clear(&constraints_name); | 667 | x509_constraints_name_free(constraints_name); |
671 | return ret; | 668 | return ret; |
672 | } | 669 | } |
673 | 670 | ||