diff options
author | tb <> | 2024-02-28 16:26:08 +0000 |
---|---|---|
committer | tb <> | 2024-02-28 16:26:08 +0000 |
commit | 178bfb867be341d2b023d0fe782e2cf0515626ac (patch) | |
tree | 28e603a31d3aefcf278be99c78fccc616d6ada84 /src | |
parent | 8d19bfb96e2283a05ade274bcedcd621745e9f13 (diff) | |
download | openbsd-178bfb867be341d2b023d0fe782e2cf0515626ac.tar.gz openbsd-178bfb867be341d2b023d0fe782e2cf0515626ac.tar.bz2 openbsd-178bfb867be341d2b023d0fe782e2cf0515626ac.zip |
Small tweak for X509_check_purpose()
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c index 35f20e2bc3..1735e70cae 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.35 2024/01/07 16:22:46 tb Exp $ */ | 1 | /* $OpenBSD: x509_purp.c,v 1.36 2024/02/28 16:26:08 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 | */ |
@@ -177,10 +177,12 @@ X509_check_purpose(X509 *x, int id, int ca) | |||
177 | 177 | ||
178 | if (id == -1) | 178 | if (id == -1) |
179 | return 1; | 179 | return 1; |
180 | idx = X509_PURPOSE_get_by_id(id); | 180 | |
181 | if (idx == -1) | 181 | if ((idx = X509_PURPOSE_get_by_id(id)) == -1) |
182 | return -1; | ||
183 | if ((pt = X509_PURPOSE_get0(idx)) == NULL) | ||
182 | return -1; | 184 | return -1; |
183 | pt = X509_PURPOSE_get0(idx); | 185 | |
184 | return pt->check_purpose(pt, x, ca); | 186 | return pt->check_purpose(pt, x, ca); |
185 | } | 187 | } |
186 | LCRYPTO_ALIAS(X509_check_purpose); | 188 | LCRYPTO_ALIAS(X509_check_purpose); |