summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp
diff options
context:
space:
mode:
authorbeck <>2024-07-12 18:15:10 +0000
committerbeck <>2024-07-12 18:15:10 +0000
commitd694a3319273a6e59cc84d958713e0342bfc206d (patch)
treecaf914a4a8067bbc8e5b4712e3e4fbf8ffc4c380 /src/lib/libcrypto/ocsp
parenta41114b964f05026c5489e35fb584a9f78de8fce (diff)
downloadopenbsd-d694a3319273a6e59cc84d958713e0342bfc206d.tar.gz
openbsd-d694a3319273a6e59cc84d958713e0342bfc206d.tar.bz2
openbsd-d694a3319273a6e59cc84d958713e0342bfc206d.zip
Fix the horrible and undocumented behaviour of X509_check_trust
Of allowing you to pass in a NID directly, instead of a trust_id, and have it work, as long as the trust_id's and the NID's did not overlap. This screwball behaviour was depended upon by the OCSP code that called X509_check_trust with the NID, instead of the trust id, so let's fix that. We also rename the confusingly named X509_TRUST_DEFAULT to X509_TRUST_ACCEPT_ALL which makes a lot more sense, and rototill this to remove the confusingly named static functions. This will shortly be follwed up by making this function private, so we have not bothered to fix the amazingly obtuse man page as it will be taken behind the barn at that time. ok tb@
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_vfy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_vfy.c b/src/lib/libcrypto/ocsp/ocsp_vfy.c
index d197fe4ea7..27d2283ea7 100644
--- a/src/lib/libcrypto/ocsp/ocsp_vfy.c
+++ b/src/lib/libcrypto/ocsp/ocsp_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_vfy.c,v 1.23 2023/07/08 10:44:00 beck Exp $ */ 1/* $OpenBSD: ocsp_vfy.c,v 1.24 2024/07/12 18:15:10 beck 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 2000. 3 * project 2000.
4 */ 4 */
@@ -168,8 +168,8 @@ OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st,
168 goto end; 168 goto end;
169 169
170 x = sk_X509_value(chain, sk_X509_num(chain) - 1); 170 x = sk_X509_value(chain, sk_X509_num(chain) - 1);
171 if (X509_check_trust(x, NID_OCSP_sign, 0) != 171 if (X509_check_trust(x, X509_TRUST_OCSP_SIGN, 0) !=
172 X509_TRUST_TRUSTED) { 172 X509_TRUST_TRUSTED) {
173 OCSPerror(OCSP_R_ROOT_CA_NOT_TRUSTED); 173 OCSPerror(OCSP_R_ROOT_CA_NOT_TRUSTED);
174 goto end; 174 goto end;
175 } 175 }