summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
authortb <>2026-04-07 12:48:37 +0000
committertb <>2026-04-07 12:48:37 +0000
commite0240e9ee3c8649869db81bfb1767d8a225d80f7 (patch)
tree03bee93d159ad217ca9517a4d45bd6a4eda7e9d4 /src/lib/libcrypto
parent3e568752a6bd0d3e75c6c74854bf08bff53c1b64 (diff)
downloadopenbsd-e0240e9ee3c8649869db81bfb1767d8a225d80f7.tar.gz
openbsd-e0240e9ee3c8649869db81bfb1767d8a225d80f7.tar.bz2
openbsd-e0240e9ee3c8649869db81bfb1767d8a225d80f7.zip
Stop Delta CRL processing if a CRL number is misssing
A malformed Delta CRL could cause a crash. Funnily enough the deserializer recognizes this and marks such a CRL as invalid, but nothing ever checks the EXFLAG_INVALID for CRLs. For certificates this would usually result in verification failure due to x509v3_cache_extensions() failing. This is only reachable if the X509_V_FLAG_USE_DELTAS is used, which only a handful of ports do, plus openssl(1) does if you use the undocumented -use_deltas flag. Reported by Igor Morgenstern to OpenSSL who then sat on this since Jan 8 and assigned CVE-2026-28388. ok jsing
Diffstat (limited to 'src/lib/libcrypto')
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 3d0abda615..776478508e 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.148 2025/05/10 05:54:39 tb Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.149 2026/04/07 12:48:37 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1148,11 +1148,15 @@ crl_extension_match(X509_CRL *a, X509_CRL *b, int nid)
1148static int 1148static int
1149check_delta_base(X509_CRL *delta, X509_CRL *base) 1149check_delta_base(X509_CRL *delta, X509_CRL *base)
1150{ 1150{
1151 /* Delta CRL must be a delta */ 1151 /*
1152 if (!delta->base_crl_number) 1152 * Delta CRL must be a delta and have a CRL number.
1153 * XXX - This means EXFLAG_INVALID was set by crl_cb(),
1154 * which we should check somewhere and bail out.
1155 */
1156 if (delta->base_crl_number == NULL || delta->crl_number == NULL)
1153 return 0; 1157 return 0;
1154 /* Base must have a CRL number */ 1158 /* Base must have a CRL number */
1155 if (!base->crl_number) 1159 if (base->crl_number == NULL)
1156 return 0; 1160 return 0;
1157 /* Issuer names must match */ 1161 /* Issuer names must match */
1158 if (X509_NAME_cmp(X509_CRL_get_issuer(base), 1162 if (X509_NAME_cmp(X509_CRL_get_issuer(base),