summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509/x509_verify.c
diff options
context:
space:
mode:
authorJob Snijders <job@cvs.openbsd.org>2023-01-20 22:00:48 +0000
committerJob Snijders <job@cvs.openbsd.org>2023-01-20 22:00:48 +0000
commit11d4cc884e34057b7fdc08817433b38b2726de58 (patch)
tree135c45273e0b096c6b96e4eec05726b613bce72a /lib/libcrypto/x509/x509_verify.c
parenta7429b6364ad98b28ffb9ba37be8fa0ab2c2b732 (diff)
Refactor x509v3_cache_extensions
Simplify x509v3_cache_extensions() by using a wrapper to avoid duplication of code for locking and checking the EXFLAG_INVALID flag. OK tb@
Diffstat (limited to 'lib/libcrypto/x509/x509_verify.c')
-rw-r--r--lib/libcrypto/x509/x509_verify.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/libcrypto/x509/x509_verify.c b/lib/libcrypto/x509/x509_verify.c
index 5891bd8df38..c60bdf743fa 100644
--- a/lib/libcrypto/x509/x509_verify.c
+++ b/lib/libcrypto/x509/x509_verify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_verify.c,v 1.62 2023/01/17 23:49:28 beck Exp $ */
+/* $OpenBSD: x509_verify.c,v 1.63 2023/01/20 22:00:47 job Exp $ */
/*
* Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org>
*
@@ -241,15 +241,7 @@ x509_verify_ctx_clear(struct x509_verify_ctx *ctx)
static int
x509_verify_cert_cache_extensions(X509 *cert)
{
- if (!(cert->ex_flags & EXFLAG_SET)) {
- CRYPTO_w_lock(CRYPTO_LOCK_X509);
- x509v3_cache_extensions(cert);
- CRYPTO_w_unlock(CRYPTO_LOCK_X509);
- }
- if (cert->ex_flags & EXFLAG_INVALID)
- return 0;
-
- return (cert->ex_flags & EXFLAG_SET);
+ return x509v3_cache_extensions(cert);
}
static int