diff options
| author | tb <> | 2023-08-18 08:42:41 +0000 |
|---|---|---|
| committer | tb <> | 2023-08-18 08:42:41 +0000 |
| commit | d8e2d178512117ebeb3ce17f84d0c91e807b2626 (patch) | |
| tree | 9a871a3a4d9d0117a5265b771f1f9f8df07581c2 /src/lib/libc | |
| parent | d6c19e9056b96c1aa2e38f4643a633b2647fa22c (diff) | |
| download | openbsd-d8e2d178512117ebeb3ce17f84d0c91e807b2626.tar.gz openbsd-d8e2d178512117ebeb3ce17f84d0c91e807b2626.tar.bz2 openbsd-d8e2d178512117ebeb3ce17f84d0c91e807b2626.zip | |
Check X509_digest() return in x509v3_cache_extensions()
On failure invalidate the cert with EXFLAG_INVALID. It's unlikely that
a cert would make it through to the end of this function without setting
the flag, but it's bad style anyway.
ok jsing
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c index f2c4f1dd57..0c92dfb19c 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.28 2023/07/02 17:12:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_purp.c,v 1.29 2023/08/18 08:42:41 tb 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 | */ |
| @@ -550,7 +550,8 @@ x509v3_cache_extensions_internal(X509 *x) | |||
| 550 | if (x->ex_flags & EXFLAG_SET) | 550 | if (x->ex_flags & EXFLAG_SET) |
| 551 | return; | 551 | return; |
| 552 | 552 | ||
| 553 | X509_digest(x, X509_CERT_HASH_EVP, x->hash, NULL); | 553 | if (!X509_digest(x, X509_CERT_HASH_EVP, x->hash, NULL)) |
| 554 | x->ex_flags |= EXFLAG_INVALID; | ||
| 554 | 555 | ||
| 555 | version = X509_get_version(x); | 556 | version = X509_get_version(x); |
| 556 | if (version < 0 || version > 2) | 557 | if (version < 0 || version > 2) |
