summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-10-29 13:22:37 +0000
committertb <>2023-10-29 13:22:37 +0000
commit1614f91f69f2f60af24bd0a632e800ba8567a146 (patch)
treee572849c99488882129a0c7aae01fd5022417b61
parent35fe189f046ffee05fbb31bc91fe6e3e3b39998d (diff)
downloadopenbsd-1614f91f69f2f60af24bd0a632e800ba8567a146.tar.gz
openbsd-1614f91f69f2f60af24bd0a632e800ba8567a146.tar.bz2
openbsd-1614f91f69f2f60af24bd0a632e800ba8567a146.zip
Fix an error exit in X509v3_addr_validate_path()
If the topmost cert is invalid, this should result in a validation failure. Do the same dance as elsewhere permitting the verify callback to intercept the error but ensuring that we throw an error. ok jsing
-rw-r--r--src/lib/libcrypto/x509/x509_addr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c
index 5e4223ce2b..a3b28ac07a 100644
--- a/src/lib/libcrypto/x509/x509_addr.c
+++ b/src/lib/libcrypto/x509/x509_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_addr.c,v 1.90 2023/09/27 11:29:22 tb Exp $ */ 1/* $OpenBSD: x509_addr.c,v 1.91 2023/10/29 13:22:37 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -1886,8 +1886,11 @@ addr_validate_path_internal(X509_STORE_CTX *ctx, STACK_OF(X509) *chain,
1886 if (ext == NULL) { 1886 if (ext == NULL) {
1887 depth = 0; 1887 depth = 0;
1888 cert = sk_X509_value(chain, depth); 1888 cert = sk_X509_value(chain, depth);
1889 if ((X509_get_extension_flags(cert) & EXFLAG_INVALID) != 0) 1889 if ((X509_get_extension_flags(cert) & EXFLAG_INVALID) != 0) {
1890 goto done; 1890 if ((ret = verify_error(ctx, cert,
1891 X509_V_ERR_INVALID_EXTENSION, depth)) == 0)
1892 goto done;
1893 }
1891 if ((ext = cert->rfc3779_addr) == NULL) 1894 if ((ext = cert->rfc3779_addr) == NULL)
1892 goto done; 1895 goto done;
1893 } else if (!X509v3_addr_is_canonical(ext)) { 1896 } else if (!X509v3_addr_is_canonical(ext)) {