diff options
author | tb <> | 2024-07-13 15:08:58 +0000 |
---|---|---|
committer | tb <> | 2024-07-13 15:08:58 +0000 |
commit | de05eb4f597b95fed408db9aa9e9474eb6daf5e6 (patch) | |
tree | 9bceb8f53165bf9b9a2232987ecac3565db027df /src/lib/libcrypto/x509/x509_pmaps.c | |
parent | d694a3319273a6e59cc84d958713e0342bfc206d (diff) | |
download | openbsd-de05eb4f597b95fed408db9aa9e9474eb6daf5e6.tar.gz openbsd-de05eb4f597b95fed408db9aa9e9474eb6daf5e6.tar.bz2 openbsd-de05eb4f597b95fed408db9aa9e9474eb6daf5e6.zip |
Unify X.509v3 extension methods
Use C99 initializers for all structs (some were forgotten).
Make all the structs static, call them x509v3_ext_* matching NID_*.
Add accessors called x509v3_ext_method_* and use these to implement
X509V3_EXT_get_nid().
This adds consistency and avoids a few contortions like grouping
a few extensions in arrays to save a couple externs.
ok beck jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_pmaps.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_pmaps.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_pmaps.c b/src/lib/libcrypto/x509/x509_pmaps.c index b2d74dce1d..7a91917f65 100644 --- a/src/lib/libcrypto/x509/x509_pmaps.c +++ b/src/lib/libcrypto/x509/x509_pmaps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_pmaps.c,v 1.4 2024/07/08 14:47:44 beck Exp $ */ | 1 | /* $OpenBSD: x509_pmaps.c,v 1.5 2024/07/13 15:08:58 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. | 3 | * project. |
4 | */ | 4 | */ |
@@ -69,7 +69,7 @@ static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, | |||
69 | static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS( | 69 | static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS( |
70 | const X509V3_EXT_METHOD *method, void *pmps, STACK_OF(CONF_VALUE) *extlist); | 70 | const X509V3_EXT_METHOD *method, void *pmps, STACK_OF(CONF_VALUE) *extlist); |
71 | 71 | ||
72 | const X509V3_EXT_METHOD v3_policy_mappings = { | 72 | static const X509V3_EXT_METHOD x509v3_ext_policy_mappings = { |
73 | .ext_nid = NID_policy_mappings, | 73 | .ext_nid = NID_policy_mappings, |
74 | .ext_flags = 0, | 74 | .ext_flags = 0, |
75 | .it = &POLICY_MAPPINGS_it, | 75 | .it = &POLICY_MAPPINGS_it, |
@@ -86,6 +86,12 @@ const X509V3_EXT_METHOD v3_policy_mappings = { | |||
86 | .usr_data = NULL, | 86 | .usr_data = NULL, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | const X509V3_EXT_METHOD * | ||
90 | x509v3_ext_method_policy_mappings(void) | ||
91 | { | ||
92 | return &x509v3_ext_policy_mappings; | ||
93 | } | ||
94 | |||
89 | static const ASN1_TEMPLATE POLICY_MAPPING_seq_tt[] = { | 95 | static const ASN1_TEMPLATE POLICY_MAPPING_seq_tt[] = { |
90 | { | 96 | { |
91 | .flags = 0, | 97 | .flags = 0, |