summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-16 11:52:52 +0000
committertb <>2023-04-16 11:52:52 +0000
commit1c81b2e1283737615af1bca37e71defc4aef6071 (patch)
treee3dec8166e5a7aa117eec08f64ab9555a97dd68d /src/lib
parent10030865c6e4fb5f2dd1d0f4c6998df519a54016 (diff)
downloadopenbsd-1c81b2e1283737615af1bca37e71defc4aef6071.tar.gz
openbsd-1c81b2e1283737615af1bca37e71defc4aef6071.tar.bz2
openbsd-1c81b2e1283737615af1bca37e71defc4aef6071.zip
Merge ext_dat.h back into x509_lib.c
There is no point in having this in a separate internal header. discussed with jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/ext_dat.h77
-rw-r--r--src/lib/libcrypto/x509/x509_lib.c79
2 files changed, 78 insertions, 78 deletions
diff --git a/src/lib/libcrypto/x509/ext_dat.h b/src/lib/libcrypto/x509/ext_dat.h
index 253f1f844c..bbd6ccf0a3 100644
--- a/src/lib/libcrypto/x509/ext_dat.h
+++ b/src/lib/libcrypto/x509/ext_dat.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ext_dat.h,v 1.5 2023/04/16 07:49:36 tb Exp $ */ 1/* $OpenBSD: ext_dat.h,v 1.6 2023/04/16 11:52:52 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 */
@@ -62,81 +62,6 @@ __BEGIN_HIDDEN_DECLS
62 62
63/* This file contains a table of "standard" extensions */ 63/* This file contains a table of "standard" extensions */
64 64
65extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku;
66extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo;
67extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id;
68extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate;
69extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, v3_freshest_crl;
70extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff;
71extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc;
72extern X509V3_EXT_METHOD v3_crl_hold;
73extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints;
74extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp;
75extern const X509V3_EXT_METHOD v3_addr, v3_asid;
76extern const X509V3_EXT_METHOD v3_ct_scts[3];
77
78/* This table will be searched using OBJ_bsearch so it *must* kept in
79 * order of the ext_nid values.
80 */
81
82static const X509V3_EXT_METHOD *standard_exts[] = {
83 &v3_nscert,
84 &v3_ns_ia5_list[0],
85 &v3_ns_ia5_list[1],
86 &v3_ns_ia5_list[2],
87 &v3_ns_ia5_list[3],
88 &v3_ns_ia5_list[4],
89 &v3_ns_ia5_list[5],
90 &v3_ns_ia5_list[6],
91 &v3_skey_id,
92 &v3_key_usage,
93 &v3_pkey_usage_period,
94 &v3_alt[0],
95 &v3_alt[1],
96 &v3_bcons,
97 &v3_crl_num,
98 &v3_cpols,
99 &v3_akey_id,
100 &v3_crld,
101 &v3_ext_ku,
102 &v3_delta_crl,
103 &v3_crl_reason,
104#ifndef OPENSSL_NO_OCSP
105 &v3_crl_invdate,
106#endif
107 &v3_sxnet,
108 &v3_info,
109#ifndef OPENSSL_NO_RFC3779
110 &v3_addr,
111 &v3_asid,
112#endif
113#ifndef OPENSSL_NO_OCSP
114 &v3_ocsp_nonce,
115 &v3_ocsp_crlid,
116 &v3_ocsp_accresp,
117 &v3_ocsp_nocheck,
118 &v3_ocsp_acutoff,
119 &v3_ocsp_serviceloc,
120#endif
121 &v3_sinfo,
122 &v3_policy_constraints,
123#ifndef OPENSSL_NO_OCSP
124 &v3_crl_hold,
125#endif
126 &v3_name_constraints,
127 &v3_policy_mappings,
128 &v3_inhibit_anyp,
129 &v3_idp,
130 &v3_alt[2],
131 &v3_freshest_crl,
132#ifndef OPENSSL_NO_CT
133 &v3_ct_scts[0],
134 &v3_ct_scts[1],
135 &v3_ct_scts[2],
136#endif
137};
138
139/* Number of standard extensions */ 65/* Number of standard extensions */
140#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *))
141 66
142__END_HIDDEN_DECLS 67__END_HIDDEN_DECLS
diff --git a/src/lib/libcrypto/x509/x509_lib.c b/src/lib/libcrypto/x509/x509_lib.c
index 97d54edd3f..b520e53675 100644
--- a/src/lib/libcrypto/x509/x509_lib.c
+++ b/src/lib/libcrypto/x509/x509_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_lib.c,v 1.7 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: x509_lib.c,v 1.8 2023/04/16 11:52:52 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 */
@@ -63,7 +63,6 @@
63#include <openssl/err.h> 63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66#include "ext_dat.h"
67#include "x509_local.h" 66#include "x509_local.h"
68 67
69static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL; 68static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;
@@ -72,6 +71,82 @@ static int ext_cmp(const X509V3_EXT_METHOD * const *a,
72 const X509V3_EXT_METHOD * const *b); 71 const X509V3_EXT_METHOD * const *b);
73static void ext_list_free(X509V3_EXT_METHOD *ext); 72static void ext_list_free(X509V3_EXT_METHOD *ext);
74 73
74extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku;
75extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo;
76extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id;
77extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate;
78extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, v3_freshest_crl;
79extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff;
80extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc;
81extern X509V3_EXT_METHOD v3_crl_hold;
82extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints;
83extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp;
84extern const X509V3_EXT_METHOD v3_addr, v3_asid;
85extern const X509V3_EXT_METHOD v3_ct_scts[3];
86
87/* This table will be searched using OBJ_bsearch so it *must* kept in
88 * order of the ext_nid values.
89 */
90
91static const X509V3_EXT_METHOD *standard_exts[] = {
92 &v3_nscert,
93 &v3_ns_ia5_list[0],
94 &v3_ns_ia5_list[1],
95 &v3_ns_ia5_list[2],
96 &v3_ns_ia5_list[3],
97 &v3_ns_ia5_list[4],
98 &v3_ns_ia5_list[5],
99 &v3_ns_ia5_list[6],
100 &v3_skey_id,
101 &v3_key_usage,
102 &v3_pkey_usage_period,
103 &v3_alt[0],
104 &v3_alt[1],
105 &v3_bcons,
106 &v3_crl_num,
107 &v3_cpols,
108 &v3_akey_id,
109 &v3_crld,
110 &v3_ext_ku,
111 &v3_delta_crl,
112 &v3_crl_reason,
113#ifndef OPENSSL_NO_OCSP
114 &v3_crl_invdate,
115#endif
116 &v3_sxnet,
117 &v3_info,
118#ifndef OPENSSL_NO_RFC3779
119 &v3_addr,
120 &v3_asid,
121#endif
122#ifndef OPENSSL_NO_OCSP
123 &v3_ocsp_nonce,
124 &v3_ocsp_crlid,
125 &v3_ocsp_accresp,
126 &v3_ocsp_nocheck,
127 &v3_ocsp_acutoff,
128 &v3_ocsp_serviceloc,
129#endif
130 &v3_sinfo,
131 &v3_policy_constraints,
132#ifndef OPENSSL_NO_OCSP
133 &v3_crl_hold,
134#endif
135 &v3_name_constraints,
136 &v3_policy_mappings,
137 &v3_inhibit_anyp,
138 &v3_idp,
139 &v3_alt[2],
140 &v3_freshest_crl,
141#ifndef OPENSSL_NO_CT
142 &v3_ct_scts[0],
143 &v3_ct_scts[1],
144 &v3_ct_scts[2],
145#endif
146};
147
148#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *))
149
75int 150int
76X509V3_EXT_add(X509V3_EXT_METHOD *ext) 151X509V3_EXT_add(X509V3_EXT_METHOD *ext)
77{ 152{