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_cpols.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_cpols.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_cpols.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_cpols.c b/src/lib/libcrypto/x509/x509_cpols.c index 34c9345a4f..7a701ea659 100644 --- a/src/lib/libcrypto/x509/x509_cpols.c +++ b/src/lib/libcrypto/x509/x509_cpols.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_cpols.c,v 1.12 2024/07/08 14:47:44 beck Exp $ */ | 1 | /* $OpenBSD: x509_cpols.c,v 1.13 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 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -82,7 +82,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, | |||
82 | STACK_OF(CONF_VALUE) *unot, int ia5org); | 82 | STACK_OF(CONF_VALUE) *unot, int ia5org); |
83 | static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); | 83 | static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); |
84 | 84 | ||
85 | const X509V3_EXT_METHOD v3_cpols = { | 85 | static const X509V3_EXT_METHOD x509v3_ext_certificate_policies = { |
86 | .ext_nid = NID_certificate_policies, | 86 | .ext_nid = NID_certificate_policies, |
87 | .ext_flags = 0, | 87 | .ext_flags = 0, |
88 | .it = &CERTIFICATEPOLICIES_it, | 88 | .it = &CERTIFICATEPOLICIES_it, |
@@ -99,6 +99,12 @@ const X509V3_EXT_METHOD v3_cpols = { | |||
99 | .usr_data = NULL, | 99 | .usr_data = NULL, |
100 | }; | 100 | }; |
101 | 101 | ||
102 | const X509V3_EXT_METHOD * | ||
103 | x509v3_ext_method_certificate_policies(void) | ||
104 | { | ||
105 | return &x509v3_ext_certificate_policies; | ||
106 | } | ||
107 | |||
102 | static const ASN1_TEMPLATE CERTIFICATEPOLICIES_item_tt = { | 108 | static const ASN1_TEMPLATE CERTIFICATEPOLICIES_item_tt = { |
103 | .flags = ASN1_TFLG_SEQUENCE_OF, | 109 | .flags = ASN1_TFLG_SEQUENCE_OF, |
104 | .tag = 0, | 110 | .tag = 0, |