diff options
| author | tobhe <> | 2021-03-13 23:01:49 +0000 |
|---|---|---|
| committer | tobhe <> | 2021-03-13 23:01:49 +0000 |
| commit | 0c378cc53837d51d2f3a48a028d7726d2a78d8d7 (patch) | |
| tree | 203add7eba338a639cc64ed6703102a30b3bdce1 /src/lib/libcrypto/x509/x509_verify.c | |
| parent | 266aa0aa5323d0e87855e9e761085c9b055a4f10 (diff) | |
| download | openbsd-0c378cc53837d51d2f3a48a028d7726d2a78d8d7.tar.gz openbsd-0c378cc53837d51d2f3a48a028d7726d2a78d8d7.tar.bz2 openbsd-0c378cc53837d51d2f3a48a028d7726d2a78d8d7.zip | |
Use EXFLAG_INVALID to handle out of memory and parse errors in
x509v3_cache_extensions().
ok tb@
Diffstat (limited to 'src/lib/libcrypto/x509/x509_verify.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 3c8369f1f9..9c34e31ee3 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.35 2021/03/12 15:53:38 tb Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.36 2021/03/13 23:01:49 tobhe 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 | * |
| @@ -756,6 +756,10 @@ x509_verify_cert_extensions(struct x509_verify_ctx *ctx, X509 *cert, int need_ca | |||
| 756 | CRYPTO_w_lock(CRYPTO_LOCK_X509); | 756 | CRYPTO_w_lock(CRYPTO_LOCK_X509); |
| 757 | x509v3_cache_extensions(cert); | 757 | x509v3_cache_extensions(cert); |
| 758 | CRYPTO_w_unlock(CRYPTO_LOCK_X509); | 758 | CRYPTO_w_unlock(CRYPTO_LOCK_X509); |
| 759 | if (cert->ex_flags & EXFLAG_INVALID) { | ||
| 760 | ctx->error = X509_V_ERR_UNSPECIFIED; | ||
| 761 | return 0; | ||
| 762 | } | ||
| 759 | } | 763 | } |
| 760 | 764 | ||
| 761 | if (ctx->xsc != NULL) | 765 | if (ctx->xsc != NULL) |
