summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2021-12-25 15:42:32 +0000
committertb <>2021-12-25 15:42:32 +0000
commitdd5e1d57991d1ff4920aa1a99d43df992335da1a (patch)
tree5f6bc45ef9045686d3292fec026277c6f54d85c6 /src
parent6be80228ce6e3d007c240fd309c7e08520677576 (diff)
downloadopenbsd-dd5e1d57991d1ff4920aa1a99d43df992335da1a.tar.gz
openbsd-dd5e1d57991d1ff4920aa1a99d43df992335da1a.tar.bz2
openbsd-dd5e1d57991d1ff4920aa1a99d43df992335da1a.zip
Use C99 initializers for v3_addr, v3_asid and v3_ct_scts[]
as is done for most other X.509 v3 extension methods. discussed with jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ct/ct_x509v3.c70
-rw-r--r--src/lib/libcrypto/x509/x509_addr.c27
-rw-r--r--src/lib/libcrypto/x509/x509_asid.c27
3 files changed, 79 insertions, 45 deletions
diff --git a/src/lib/libcrypto/ct/ct_x509v3.c b/src/lib/libcrypto/ct/ct_x509v3.c
index 82a5c2be5d..59f2975cd9 100644
--- a/src/lib/libcrypto/ct/ct_x509v3.c
+++ b/src/lib/libcrypto/ct/ct_x509v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ct_x509v3.c,v 1.5 2021/12/18 16:34:52 tb Exp $ */ 1/* $OpenBSD: ct_x509v3.c,v 1.6 2021/12/25 15:42:32 tb Exp $ */
2/* 2/*
3 * Written by Rob Stradling (rob@comodo.com) and Stephen Henson 3 * Written by Rob Stradling (rob@comodo.com) and Stephen Henson
4 * (steve@openssl.org) for the OpenSSL project 2014. 4 * (steve@openssl.org) for the OpenSSL project 2014.
@@ -131,28 +131,56 @@ ocsp_ext_d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, long len)
131/* Handlers for X509v3/OCSP Certificate Transparency extensions */ 131/* Handlers for X509v3/OCSP Certificate Transparency extensions */
132const X509V3_EXT_METHOD v3_ct_scts[3] = { 132const X509V3_EXT_METHOD v3_ct_scts[3] = {
133 /* X509v3 extension in certificates that contains SCTs */ 133 /* X509v3 extension in certificates that contains SCTs */
134 { NID_ct_precert_scts, 0, NULL, 134 [0] = {
135 NULL, (X509V3_EXT_FREE)SCT_LIST_free, 135 .ext_nid = NID_ct_precert_scts,
136 (X509V3_EXT_D2I)x509_ext_d2i_SCT_LIST, (X509V3_EXT_I2D)i2d_SCT_LIST, 136 .ext_flags = 0,
137 NULL, NULL, 137 .it = NULL,
138 NULL, NULL, 138 .ext_new = NULL,
139 (X509V3_EXT_I2R)i2r_SCT_LIST, NULL, 139 .ext_free = (X509V3_EXT_FREE)SCT_LIST_free,
140 NULL }, 140 .d2i = (X509V3_EXT_D2I)x509_ext_d2i_SCT_LIST,
141 .i2d = (X509V3_EXT_I2D)i2d_SCT_LIST,
142 .i2s = NULL,
143 .s2i = NULL,
144 .i2v = NULL,
145 .v2i = NULL,
146 .i2r = (X509V3_EXT_I2R)i2r_SCT_LIST,
147 .r2i = NULL,
148 .usr_data = NULL,
149 },
141 150
142 /* X509v3 extension to mark a certificate as a pre-certificate */ 151 /* X509v3 extension to mark a certificate as a pre-certificate */
143 { NID_ct_precert_poison, 0, &ASN1_NULL_it, 152 [1] = {
144 NULL, NULL, NULL, NULL, 153 .ext_nid = NID_ct_precert_poison,
145 i2s_poison, s2i_poison, 154 .ext_flags = 0,
146 NULL, NULL, 155 .it = &ASN1_NULL_it,
147 NULL, NULL, 156 .ext_new = NULL,
148 NULL }, 157 .ext_free = NULL,
158 .d2i = NULL,
159 .i2d = NULL,
160 .i2s = i2s_poison,
161 .s2i = s2i_poison,
162 .i2v = NULL,
163 .v2i = NULL,
164 .i2r = NULL,
165 .r2i = NULL,
166 .usr_data = NULL,
167 },
149 168
150 /* OCSP extension that contains SCTs */ 169 /* OCSP extension that contains SCTs */
151 { NID_ct_cert_scts, 0, NULL, 170 [2] = {
152 0, (X509V3_EXT_FREE)SCT_LIST_free, 171 .ext_nid = NID_ct_cert_scts,
153 (X509V3_EXT_D2I)ocsp_ext_d2i_SCT_LIST, (X509V3_EXT_I2D)i2d_SCT_LIST, 172 .ext_flags = 0,
154 NULL, NULL, 173 .it = NULL,
155 NULL, NULL, 174 .ext_new = NULL,
156 (X509V3_EXT_I2R)i2r_SCT_LIST, NULL, 175 .ext_free = (X509V3_EXT_FREE)SCT_LIST_free,
157 NULL }, 176 .d2i = (X509V3_EXT_D2I)ocsp_ext_d2i_SCT_LIST,
177 .i2d = (X509V3_EXT_I2D)i2d_SCT_LIST,
178 .i2s = NULL,
179 .s2i = NULL,
180 .i2v = NULL,
181 .v2i = NULL,
182 .i2r = (X509V3_EXT_I2R)i2r_SCT_LIST,
183 .r2i = NULL,
184 .usr_data = NULL,
185 },
158}; 186};
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c
index db9ea089f6..418bddf8b1 100644
--- a/src/lib/libcrypto/x509/x509_addr.c
+++ b/src/lib/libcrypto/x509/x509_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_addr.c,v 1.25 2021/12/24 10:09:44 tb Exp $ */ 1/* $OpenBSD: x509_addr.c,v 1.26 2021/12/25 15:42:32 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -1366,17 +1366,20 @@ v2i_IPAddrBlocks(const struct v3_ext_method *method, struct v3_ext_ctx *ctx,
1366 * OpenSSL dispatch 1366 * OpenSSL dispatch
1367 */ 1367 */
1368const X509V3_EXT_METHOD v3_addr = { 1368const X509V3_EXT_METHOD v3_addr = {
1369 NID_sbgp_ipAddrBlock, /* nid */ 1369 .ext_nid = NID_sbgp_ipAddrBlock,
1370 0, /* flags */ 1370 .ext_flags = 0,
1371 &IPAddrBlocks_it, 1371 .it = &IPAddrBlocks_it,
1372 0, 0, 0, 0, /* old functions, ignored */ 1372 .ext_new = NULL,
1373 0, /* i2s */ 1373 .ext_free = NULL,
1374 0, /* s2i */ 1374 .d2i = NULL,
1375 0, /* i2v */ 1375 .i2d = NULL,
1376 v2i_IPAddrBlocks, /* v2i */ 1376 .i2s = NULL,
1377 i2r_IPAddrBlocks, /* i2r */ 1377 .s2i = NULL,
1378 0, /* r2i */ 1378 .i2v = NULL,
1379 NULL /* extension-specific data */ 1379 .v2i = v2i_IPAddrBlocks,
1380 .i2r = i2r_IPAddrBlocks,
1381 .r2i = NULL,
1382 .usr_data = NULL,
1380}; 1383};
1381 1384
1382/* 1385/*
diff --git a/src/lib/libcrypto/x509/x509_asid.c b/src/lib/libcrypto/x509/x509_asid.c
index 2b4f09d6e6..648f185748 100644
--- a/src/lib/libcrypto/x509/x509_asid.c
+++ b/src/lib/libcrypto/x509/x509_asid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_asid.c,v 1.28 2021/12/24 02:30:15 tb Exp $ */ 1/* $OpenBSD: x509_asid.c,v 1.29 2021/12/25 15:42:32 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -879,17 +879,20 @@ v2i_ASIdentifiers(const struct v3_ext_method *method, struct v3_ext_ctx *ctx,
879 * OpenSSL dispatch. 879 * OpenSSL dispatch.
880 */ 880 */
881const X509V3_EXT_METHOD v3_asid = { 881const X509V3_EXT_METHOD v3_asid = {
882 NID_sbgp_autonomousSysNum, /* nid */ 882 .ext_nid = NID_sbgp_autonomousSysNum,
883 0, /* flags */ 883 .ext_flags = 0,
884 &ASIdentifiers_it, /* template */ 884 .it = &ASIdentifiers_it,
885 0, 0, 0, 0, /* old functions, ignored */ 885 .ext_new = NULL,
886 0, /* i2s */ 886 .ext_free = NULL,
887 0, /* s2i */ 887 .d2i = NULL,
888 0, /* i2v */ 888 .i2d = NULL,
889 v2i_ASIdentifiers, /* v2i */ 889 .i2s = NULL,
890 i2r_ASIdentifiers, /* i2r */ 890 .s2i = NULL,
891 0, /* r2i */ 891 .i2v = NULL,
892 NULL /* extension-specific data */ 892 .v2i = v2i_ASIdentifiers,
893 .i2r = i2r_ASIdentifiers,
894 .r2i = NULL,
895 .usr_data = NULL,
893}; 896};
894 897
895/* 898/*