diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_alt.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_alt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_alt.c b/src/lib/libcrypto/x509/x509_alt.c index 8656df82b3..cf8cbf0ce2 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.12 2022/03/26 16:34:21 tb Exp $ */ | 1 | /* $OpenBSD: x509_alt.c,v 1.13 2022/11/11 12:02:34 beck 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 | */ |
@@ -619,6 +619,7 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
619 | GENERAL_NAME *ret; | 619 | GENERAL_NAME *ret; |
620 | size_t len = 0; | 620 | size_t len = 0; |
621 | int type; | 621 | int type; |
622 | CBS cbs; | ||
622 | 623 | ||
623 | name = cnf->name; | 624 | name = cnf->name; |
624 | value = cnf->value; | 625 | value = cnf->value; |
@@ -669,9 +670,10 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
669 | } | 670 | } |
670 | 671 | ||
671 | type = x509_constraints_general_to_bytes(ret, &bytes, &len); | 672 | type = x509_constraints_general_to_bytes(ret, &bytes, &len); |
673 | CBS_init(&cbs, bytes, len); | ||
672 | switch (type) { | 674 | switch (type) { |
673 | case GEN_DNS: | 675 | case GEN_DNS: |
674 | if (!x509_constraints_valid_sandns(bytes, len)) { | 676 | if (!x509_constraints_valid_sandns(&cbs)) { |
675 | X509V3error(X509V3_R_BAD_OBJECT); | 677 | X509V3error(X509V3_R_BAD_OBJECT); |
676 | ERR_asprintf_error_data("name=%s value='%.*s'", name, | 678 | ERR_asprintf_error_data("name=%s value='%.*s'", name, |
677 | (int)len, bytes); | 679 | (int)len, bytes); |
@@ -687,7 +689,7 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
687 | } | 689 | } |
688 | break; | 690 | break; |
689 | case GEN_EMAIL: | 691 | case GEN_EMAIL: |
690 | if (!x509_constraints_parse_mailbox(bytes, len, NULL)) { | 692 | if (!x509_constraints_parse_mailbox(&cbs, NULL)) { |
691 | X509V3error(X509V3_R_BAD_OBJECT); | 693 | X509V3error(X509V3_R_BAD_OBJECT); |
692 | ERR_asprintf_error_data("name=%s value='%.*s'", name, | 694 | ERR_asprintf_error_data("name=%s value='%.*s'", name, |
693 | (int)len, bytes); | 695 | (int)len, bytes); |