diff options
author | tb <> | 2024-03-23 06:37:15 +0000 |
---|---|---|
committer | tb <> | 2024-03-23 06:37:15 +0000 |
commit | cbcf6573e9eaf23ade78dce0d57a58850f3ea743 (patch) | |
tree | 7656fc91f48b4c2fe8bbb0262e9f46bf91b01e69 | |
parent | c5b3d1215f4c7d01189ebf4a89d9b4a56d351c44 (diff) | |
download | openbsd-cbcf6573e9eaf23ade78dce0d57a58850f3ea743.tar.gz openbsd-cbcf6573e9eaf23ade78dce0d57a58850f3ea743.tar.bz2 openbsd-cbcf6573e9eaf23ade78dce0d57a58850f3ea743.zip |
Remove unused flags argument from the trust handlers
The public X509_check_trust() takes a flag parameter which we must leave
in place. However, we can stop passing the flag parameter around without
ever looking at it.
ok jsing
-rw-r--r-- | src/lib/libcrypto/x509/x509_trs.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index 2f4cbba387..0fd6f80df4 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_trs.c,v 1.42 2024/03/02 10:50:26 tb Exp $ */ | 1 | /* $OpenBSD: x509_trs.c,v 1.43 2024/03/23 06:37:15 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 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -70,14 +70,14 @@ | |||
70 | typedef struct x509_trust_st { | 70 | typedef struct x509_trust_st { |
71 | int trust; | 71 | int trust; |
72 | int flags; | 72 | int flags; |
73 | int (*check_trust)(struct x509_trust_st *, X509 *, int); | 73 | int (*check_trust)(struct x509_trust_st *, X509 *); |
74 | char *name; | 74 | char *name; |
75 | int arg1; | 75 | int arg1; |
76 | void *arg2; | 76 | void *arg2; |
77 | } X509_TRUST; | 77 | } X509_TRUST; |
78 | 78 | ||
79 | static int | 79 | static int |
80 | obj_trust(int id, X509 *x, int flags) | 80 | obj_trust(int id, X509 *x) |
81 | { | 81 | { |
82 | ASN1_OBJECT *obj; | 82 | ASN1_OBJECT *obj; |
83 | int i, nid; | 83 | int i, nid; |
@@ -106,7 +106,7 @@ obj_trust(int id, X509 *x, int flags) | |||
106 | } | 106 | } |
107 | 107 | ||
108 | static int | 108 | static int |
109 | trust_compat(X509_TRUST *trust, X509 *x, int flags) | 109 | trust_compat(X509_TRUST *trust, X509 *x) |
110 | { | 110 | { |
111 | X509_check_purpose(x, -1, 0); | 111 | X509_check_purpose(x, -1, 0); |
112 | if (x->ex_flags & EXFLAG_SS) | 112 | if (x->ex_flags & EXFLAG_SS) |
@@ -116,21 +116,21 @@ trust_compat(X509_TRUST *trust, X509 *x, int flags) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | static int | 118 | static int |
119 | trust_1oidany(X509_TRUST *trust, X509 *x, int flags) | 119 | trust_1oidany(X509_TRUST *trust, X509 *x) |
120 | { | 120 | { |
121 | if (x->aux && (x->aux->trust || x->aux->reject)) | 121 | if (x->aux && (x->aux->trust || x->aux->reject)) |
122 | return obj_trust(trust->arg1, x, flags); | 122 | return obj_trust(trust->arg1, x); |
123 | /* we don't have any trust settings: for compatibility | 123 | /* we don't have any trust settings: for compatibility |
124 | * we return trusted if it is self signed | 124 | * we return trusted if it is self signed |
125 | */ | 125 | */ |
126 | return trust_compat(trust, x, flags); | 126 | return trust_compat(trust, x); |
127 | } | 127 | } |
128 | 128 | ||
129 | static int | 129 | static int |
130 | trust_1oid(X509_TRUST *trust, X509 *x, int flags) | 130 | trust_1oid(X509_TRUST *trust, X509 *x) |
131 | { | 131 | { |
132 | if (x->aux) | 132 | if (x->aux) |
133 | return obj_trust(trust->arg1, x, flags); | 133 | return obj_trust(trust->arg1, x); |
134 | return X509_TRUST_UNTRUSTED; | 134 | return X509_TRUST_UNTRUSTED; |
135 | } | 135 | } |
136 | 136 | ||
@@ -213,18 +213,18 @@ X509_check_trust(X509 *x, int trust_id, int flags) | |||
213 | */ | 213 | */ |
214 | if (trust_id == 0) { | 214 | if (trust_id == 0) { |
215 | int rv; | 215 | int rv; |
216 | rv = obj_trust(NID_anyExtendedKeyUsage, x, 0); | 216 | rv = obj_trust(NID_anyExtendedKeyUsage, x); |
217 | if (rv != X509_TRUST_UNTRUSTED) | 217 | if (rv != X509_TRUST_UNTRUSTED) |
218 | return rv; | 218 | return rv; |
219 | return trust_compat(NULL, x, 0); | 219 | return trust_compat(NULL, x); |
220 | } | 220 | } |
221 | 221 | ||
222 | if (trust_id < X509_TRUST_MIN || trust_id > X509_TRUST_MAX) | 222 | if (trust_id < X509_TRUST_MIN || trust_id > X509_TRUST_MAX) |
223 | return obj_trust(trust_id, x, flags); | 223 | return obj_trust(trust_id, x); |
224 | 224 | ||
225 | idx = trust_id - X509_TRUST_MIN; | 225 | idx = trust_id - X509_TRUST_MIN; |
226 | trust = &trstandard[idx]; | 226 | trust = &trstandard[idx]; |
227 | 227 | ||
228 | return trust->check_trust((X509_TRUST *)trust, x, flags); | 228 | return trust->check_trust((X509_TRUST *)trust, x); |
229 | } | 229 | } |
230 | LCRYPTO_ALIAS(X509_check_trust); | 230 | LCRYPTO_ALIAS(X509_check_trust); |