summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_asid.c
diff options
context:
space:
mode:
authortb <>2024-07-13 15:08:58 +0000
committertb <>2024-07-13 15:08:58 +0000
commitde05eb4f597b95fed408db9aa9e9474eb6daf5e6 (patch)
tree9bceb8f53165bf9b9a2232987ecac3565db027df /src/lib/libcrypto/x509/x509_asid.c
parentd694a3319273a6e59cc84d958713e0342bfc206d (diff)
downloadopenbsd-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_asid.c')
-rw-r--r--src/lib/libcrypto/x509/x509_asid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_asid.c b/src/lib/libcrypto/x509/x509_asid.c
index e3af673202..40ee201a9f 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.44 2024/07/08 14:47:44 beck Exp $ */ 1/* $OpenBSD: x509_asid.c,v 1.45 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").
@@ -946,7 +946,7 @@ v2i_ASIdentifiers(const struct v3_ext_method *method, struct v3_ext_ctx *ctx,
946/* 946/*
947 * OpenSSL dispatch. 947 * OpenSSL dispatch.
948 */ 948 */
949const X509V3_EXT_METHOD v3_asid = { 949static const X509V3_EXT_METHOD x509v3_ext_sbgp_autonomousSysNum = {
950 .ext_nid = NID_sbgp_autonomousSysNum, 950 .ext_nid = NID_sbgp_autonomousSysNum,
951 .ext_flags = 0, 951 .ext_flags = 0,
952 .it = &ASIdentifiers_it, 952 .it = &ASIdentifiers_it,
@@ -963,6 +963,12 @@ const X509V3_EXT_METHOD v3_asid = {
963 .usr_data = NULL, 963 .usr_data = NULL,
964}; 964};
965 965
966const X509V3_EXT_METHOD *
967x509v3_ext_method_sbgp_autonomousSysNum(void)
968{
969 return &x509v3_ext_sbgp_autonomousSysNum;
970}
971
966/* 972/*
967 * Figure out whether extension uses inheritance. 973 * Figure out whether extension uses inheritance.
968 */ 974 */