summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-01-10 21:14:15 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-01-10 21:14:15 +0000
commite6e5cc9eaf1ff6ce736ee642cecd359ac8dfdfd7 (patch)
tree6bcc07bbd41b09787551ecf51d07fbbf136097c3 /lib
parent7fcaa877468e4ecb28712f739620b6437171faff (diff)
X509_TRUST: hoist trust_compat() to the other end of the file
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/x509/x509_trs.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/libcrypto/x509/x509_trs.c b/lib/libcrypto/x509/x509_trs.c
index f42c34b0874..c1191b40ed2 100644
--- a/lib/libcrypto/x509/x509_trs.c
+++ b/lib/libcrypto/x509/x509_trs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_trs.c,v 1.36 2024/01/10 21:11:37 tb Exp $ */
+/* $OpenBSD: x509_trs.c,v 1.37 2024/01/10 21:14:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -66,7 +66,16 @@
static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
static int trust_1oid(X509_TRUST *trust, X509 *x, int flags);
-static int trust_compat(X509_TRUST *trust, X509 *x, int flags);
+
+static int
+trust_compat(X509_TRUST *trust, X509 *x, int flags)
+{
+ X509_check_purpose(x, -1, 0);
+ if (x->ex_flags & EXFLAG_SS)
+ return X509_TRUST_TRUSTED;
+ else
+ return X509_TRUST_UNTRUSTED;
+}
static int
obj_trust(int id, X509 *x, int flags)
@@ -296,13 +305,3 @@ trust_1oid(X509_TRUST *trust, X509 *x, int flags)
return obj_trust(trust->arg1, x, flags);
return X509_TRUST_UNTRUSTED;
}
-
-static int
-trust_compat(X509_TRUST *trust, X509 *x, int flags)
-{
- X509_check_purpose(x, -1, 0);
- if (x->ex_flags & EXFLAG_SS)
- return X509_TRUST_TRUSTED;
- else
- return X509_TRUST_UNTRUSTED;
-}