From 025f3b8ef1e0ff3017dd0079925fbf85f15a6d22 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 2 Jul 2023 17:12:17 +0000 Subject: Convert some tables to C99 initializers ok & "happy pirate day" beck --- src/lib/libcrypto/x509/x509_trs.c | 59 ++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) (limited to 'src/lib/libcrypto/x509/x509_trs.c') diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index e3265918a4..6b935f8bee 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_trs.c,v 1.31 2023/02/16 08:38:17 tb Exp $ */ +/* $OpenBSD: x509_trs.c,v 1.32 2023/07/02 17:12:17 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -80,17 +80,56 @@ static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; */ static X509_TRUST trstandard[] = { - {X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL}, - {X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL}, - {X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Server", NID_server_auth, NULL}, - {X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL}, - {X509_TRUST_OBJECT_SIGN, 0, trust_1oidany, "Object Signer", NID_code_sign, NULL}, - {X509_TRUST_OCSP_SIGN, 0, trust_1oid, "OCSP responder", NID_OCSP_sign, NULL}, - {X509_TRUST_OCSP_REQUEST, 0, trust_1oid, "OCSP request", NID_ad_OCSP, NULL}, - {X509_TRUST_TSA, 0, trust_1oidany, "TSA server", NID_time_stamp, NULL} + { + .trust = X509_TRUST_COMPAT, + .check_trust = trust_compat, + .name = "compatible", + }, + { + .trust = X509_TRUST_SSL_CLIENT, + .check_trust = trust_1oidany, + .name = "SSL Client", + .arg1 = NID_client_auth, + }, + { + .trust = X509_TRUST_SSL_SERVER, + .check_trust = trust_1oidany, + .name = "SSL Server", + .arg1 = NID_server_auth, + }, + { + .trust = X509_TRUST_EMAIL, + .check_trust = trust_1oidany, + .name = "S/MIME email", + .arg1 = NID_email_protect, + }, + { + .trust = X509_TRUST_OBJECT_SIGN, + .check_trust = trust_1oidany, + .name = "Object Signer", + .arg1 = NID_code_sign, + }, + { + .trust = X509_TRUST_OCSP_SIGN, + .check_trust = trust_1oid, + .name = "OCSP responder", + .arg1 = NID_OCSP_sign, + }, + { + .trust = X509_TRUST_OCSP_REQUEST, + .check_trust = trust_1oid, + .name = "OCSP request", + .arg1 = NID_ad_OCSP, + }, + { + .trust = X509_TRUST_TSA, + .check_trust = trust_1oidany, + .name = "TSA server", + .arg1 = NID_time_stamp, + }, }; -#define X509_TRUST_COUNT (sizeof(trstandard)/sizeof(X509_TRUST)) +#define X509_TRUST_COUNT (sizeof(trstandard) / sizeof(trstandard[0])) static STACK_OF(X509_TRUST) *trtable = NULL; -- cgit v1.2.3-55-g6feb