diff options
-rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c index 621f6f0f90..e0069313b9 100644 --- a/src/lib/libcrypto/x509/x509_purp.c +++ b/src/lib/libcrypto/x509/x509_purp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_purp.c,v 1.22 2023/04/16 08:06:42 tb Exp $ */ | 1 | /* $OpenBSD: x509_purp.c,v 1.23 2023/04/23 21:39:19 job 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 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -457,8 +457,11 @@ x509v3_cache_extensions_internal(X509 *x) | |||
457 | X509_digest(x, X509_CERT_HASH_EVP, x->hash, NULL); | 457 | X509_digest(x, X509_CERT_HASH_EVP, x->hash, NULL); |
458 | 458 | ||
459 | /* V1 should mean no extensions ... */ | 459 | /* V1 should mean no extensions ... */ |
460 | if (!X509_get_version(x)) | 460 | if (X509_get_version(x) == 0) { |
461 | x->ex_flags |= EXFLAG_V1; | 461 | x->ex_flags |= EXFLAG_V1; |
462 | if (X509_get_ext_count(x) > 0) | ||
463 | x->ex_flags |= EXFLAG_INVALID; | ||
464 | } | ||
462 | 465 | ||
463 | /* Handle basic constraints */ | 466 | /* Handle basic constraints */ |
464 | if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, &i, NULL))) { | 467 | if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, &i, NULL))) { |