diff options
author | job <> | 2023-01-20 22:00:47 +0000 |
---|---|---|
committer | job <> | 2023-01-20 22:00:47 +0000 |
commit | fe0fb84f8cd3d820f753cc1976fc23a382ee69b0 (patch) | |
tree | 9f7bfeec9179516889295ebca388ee7cf8407b59 /src/lib/libcrypto/x509/x509_verify.c | |
parent | eb2ff9dec9fdcee0eee6e2d8bad764cc0f29e882 (diff) | |
download | openbsd-fe0fb84f8cd3d820f753cc1976fc23a382ee69b0.tar.gz openbsd-fe0fb84f8cd3d820f753cc1976fc23a382ee69b0.tar.bz2 openbsd-fe0fb84f8cd3d820f753cc1976fc23a382ee69b0.zip |
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 'src/lib/libcrypto/x509/x509_verify.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 5891bd8df3..c60bdf743f 100644 --- a/src/lib/libcrypto/x509/x509_verify.c +++ b/src/lib/libcrypto/x509/x509_verify.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_verify.c,v 1.62 2023/01/17 23:49:28 beck Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.63 2023/01/20 22:00:47 job Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -241,15 +241,7 @@ x509_verify_ctx_clear(struct x509_verify_ctx *ctx) | |||
241 | static int | 241 | static int |
242 | x509_verify_cert_cache_extensions(X509 *cert) | 242 | x509_verify_cert_cache_extensions(X509 *cert) |
243 | { | 243 | { |
244 | if (!(cert->ex_flags & EXFLAG_SET)) { | 244 | return x509v3_cache_extensions(cert); |
245 | CRYPTO_w_lock(CRYPTO_LOCK_X509); | ||
246 | x509v3_cache_extensions(cert); | ||
247 | CRYPTO_w_unlock(CRYPTO_LOCK_X509); | ||
248 | } | ||
249 | if (cert->ex_flags & EXFLAG_INVALID) | ||
250 | return 0; | ||
251 | |||
252 | return (cert->ex_flags & EXFLAG_SET); | ||
253 | } | 245 | } |
254 | 246 | ||
255 | static int | 247 | static int |