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_addr.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_addr.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_addr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c index 864b7bbf3d..2208cc434e 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.92 2024/07/08 14:47:44 beck Exp $ */ | 1 | /* $OpenBSD: x509_addr.c,v 1.93 2024/07/13 15:08:58 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"). |
@@ -1714,7 +1714,7 @@ v2i_IPAddrBlocks(const struct v3_ext_method *method, struct v3_ext_ctx *ctx, | |||
1714 | /* | 1714 | /* |
1715 | * OpenSSL dispatch | 1715 | * OpenSSL dispatch |
1716 | */ | 1716 | */ |
1717 | const X509V3_EXT_METHOD v3_addr = { | 1717 | static const X509V3_EXT_METHOD x509v3_ext_sbgp_ipAddrBlock = { |
1718 | .ext_nid = NID_sbgp_ipAddrBlock, | 1718 | .ext_nid = NID_sbgp_ipAddrBlock, |
1719 | .ext_flags = 0, | 1719 | .ext_flags = 0, |
1720 | .it = &IPAddrBlocks_it, | 1720 | .it = &IPAddrBlocks_it, |
@@ -1731,6 +1731,12 @@ const X509V3_EXT_METHOD v3_addr = { | |||
1731 | .usr_data = NULL, | 1731 | .usr_data = NULL, |
1732 | }; | 1732 | }; |
1733 | 1733 | ||
1734 | const X509V3_EXT_METHOD * | ||
1735 | x509v3_ext_method_sbgp_ipAddrBlock(void) | ||
1736 | { | ||
1737 | return &x509v3_ext_sbgp_ipAddrBlock; | ||
1738 | } | ||
1739 | |||
1734 | /* | 1740 | /* |
1735 | * Figure out whether extension uses inheritance. | 1741 | * Figure out whether extension uses inheritance. |
1736 | */ | 1742 | */ |