diff options
author | cvs2svn <admin@example.com> | 2002-05-15 02:29:24 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2002-05-15 02:29:24 +0000 |
commit | 027351f729b9e837200dae6e1520cda6577ab930 (patch) | |
tree | e25a717057aa4529e433fc3b1fac8d4df8db3a5c /src/lib/libcrypto/objects | |
parent | aeeae06a79815dc190061534d47236cec09f9e32 (diff) | |
download | openbsd-027351f729b9e837200dae6e1520cda6577ab930.tar.gz openbsd-027351f729b9e837200dae6e1520cda6577ab930.tar.bz2 openbsd-027351f729b9e837200dae6e1520cda6577ab930.zip |
This commit was manufactured by cvs2git to create branch 'unlabeled-1.1.1'.
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/objects/o_names.c | 243 | ||||
-rw-r--r-- | src/lib/libcrypto/objects/obj_mac.num | 392 | ||||
-rw-r--r-- | src/lib/libcrypto/objects/objects.README | 44 | ||||
-rw-r--r-- | src/lib/libcrypto/objects/objects.pl | 224 |
4 files changed, 903 insertions, 0 deletions
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c new file mode 100644 index 0000000000..4da5e45b9c --- /dev/null +++ b/src/lib/libcrypto/objects/o_names.c | |||
@@ -0,0 +1,243 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | |||
5 | #include <openssl/lhash.h> | ||
6 | #include <openssl/objects.h> | ||
7 | |||
8 | /* I use the ex_data stuff to manage the identifiers for the obj_name_types | ||
9 | * that applications may define. I only really use the free function field. | ||
10 | */ | ||
11 | static LHASH *names_lh=NULL; | ||
12 | static int names_type_num=OBJ_NAME_TYPE_NUM; | ||
13 | static STACK *names_cmp=NULL; | ||
14 | static STACK *names_hash=NULL; | ||
15 | static STACK *names_free=NULL; | ||
16 | |||
17 | static unsigned long obj_name_hash(OBJ_NAME *a); | ||
18 | static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); | ||
19 | |||
20 | int OBJ_NAME_init(void) | ||
21 | { | ||
22 | if (names_lh != NULL) return(1); | ||
23 | MemCheck_off(); | ||
24 | names_lh=lh_new(obj_name_hash,obj_name_cmp); | ||
25 | MemCheck_on(); | ||
26 | return(names_lh != NULL); | ||
27 | } | ||
28 | |||
29 | int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(), | ||
30 | void (*free_func)()) | ||
31 | { | ||
32 | int ret; | ||
33 | int i; | ||
34 | |||
35 | if (names_free == NULL) | ||
36 | { | ||
37 | MemCheck_off(); | ||
38 | names_hash=sk_new_null(); | ||
39 | names_cmp=sk_new_null(); | ||
40 | names_free=sk_new_null(); | ||
41 | MemCheck_on(); | ||
42 | } | ||
43 | if ((names_free == NULL) || (names_hash == NULL) || (names_cmp == NULL)) | ||
44 | { | ||
45 | /* ERROR */ | ||
46 | return(0); | ||
47 | } | ||
48 | ret=names_type_num; | ||
49 | names_type_num++; | ||
50 | for (i=sk_num(names_free); i<names_type_num; i++) | ||
51 | { | ||
52 | MemCheck_off(); | ||
53 | sk_push(names_hash,(char *)strcmp); | ||
54 | sk_push(names_cmp,(char *)lh_strhash); | ||
55 | sk_push(names_free,NULL); | ||
56 | MemCheck_on(); | ||
57 | } | ||
58 | if (hash_func != NULL) | ||
59 | sk_set(names_hash,ret,(char *)hash_func); | ||
60 | if (cmp_func != NULL) | ||
61 | sk_set(names_cmp,ret,(char *)cmp_func); | ||
62 | if (free_func != NULL) | ||
63 | sk_set(names_free,ret,(char *)free_func); | ||
64 | return(ret); | ||
65 | } | ||
66 | |||
67 | static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) | ||
68 | { | ||
69 | int ret; | ||
70 | int (*cmp)(); | ||
71 | |||
72 | ret=a->type-b->type; | ||
73 | if (ret == 0) | ||
74 | { | ||
75 | if ((names_cmp != NULL) && (sk_num(names_cmp) > a->type)) | ||
76 | { | ||
77 | cmp=(int (*)())sk_value(names_cmp,a->type); | ||
78 | ret=cmp(a->name,b->name); | ||
79 | } | ||
80 | else | ||
81 | ret=strcmp(a->name,b->name); | ||
82 | } | ||
83 | return(ret); | ||
84 | } | ||
85 | |||
86 | static unsigned long obj_name_hash(OBJ_NAME *a) | ||
87 | { | ||
88 | unsigned long ret; | ||
89 | unsigned long (*hash)(); | ||
90 | |||
91 | if ((names_hash != NULL) && (sk_num(names_hash) > a->type)) | ||
92 | { | ||
93 | hash=(unsigned long (*)())sk_value(names_hash,a->type); | ||
94 | ret=hash(a->name); | ||
95 | } | ||
96 | else | ||
97 | { | ||
98 | ret=lh_strhash(a->name); | ||
99 | } | ||
100 | ret^=a->type; | ||
101 | return(ret); | ||
102 | } | ||
103 | |||
104 | const char *OBJ_NAME_get(const char *name, int type) | ||
105 | { | ||
106 | OBJ_NAME on,*ret; | ||
107 | int num=0,alias; | ||
108 | |||
109 | if (name == NULL) return(NULL); | ||
110 | if ((names_lh == NULL) && !OBJ_NAME_init()) return(NULL); | ||
111 | |||
112 | alias=type&OBJ_NAME_ALIAS; | ||
113 | type&= ~OBJ_NAME_ALIAS; | ||
114 | |||
115 | on.name=name; | ||
116 | on.type=type; | ||
117 | |||
118 | for (;;) | ||
119 | { | ||
120 | ret=(OBJ_NAME *)lh_retrieve(names_lh,(char *)&on); | ||
121 | if (ret == NULL) return(NULL); | ||
122 | if ((ret->alias) && !alias) | ||
123 | { | ||
124 | if (++num > 10) return(NULL); | ||
125 | on.name=ret->data; | ||
126 | } | ||
127 | else | ||
128 | { | ||
129 | return(ret->data); | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
134 | int OBJ_NAME_add(const char *name, int type, const char *data) | ||
135 | { | ||
136 | void (*f)(); | ||
137 | OBJ_NAME *onp,*ret; | ||
138 | int alias; | ||
139 | |||
140 | if ((names_lh == NULL) && !OBJ_NAME_init()) return(0); | ||
141 | |||
142 | alias=type&OBJ_NAME_ALIAS; | ||
143 | type&= ~OBJ_NAME_ALIAS; | ||
144 | |||
145 | onp=(OBJ_NAME *)Malloc(sizeof(OBJ_NAME)); | ||
146 | if (onp == NULL) | ||
147 | { | ||
148 | /* ERROR */ | ||
149 | return(0); | ||
150 | } | ||
151 | |||
152 | onp->name=name; | ||
153 | onp->alias=alias; | ||
154 | onp->type=type; | ||
155 | onp->data=data; | ||
156 | |||
157 | ret=(OBJ_NAME *)lh_insert(names_lh,(char *)onp); | ||
158 | if (ret != NULL) | ||
159 | { | ||
160 | /* free things */ | ||
161 | if ((names_free != NULL) && (sk_num(names_free) > ret->type)) | ||
162 | { | ||
163 | f=(void (*)())sk_value(names_free,ret->type); | ||
164 | f(ret->name,ret->type,ret->data); | ||
165 | } | ||
166 | Free((char *)ret); | ||
167 | } | ||
168 | else | ||
169 | { | ||
170 | if (lh_error(names_lh)) | ||
171 | { | ||
172 | /* ERROR */ | ||
173 | return(0); | ||
174 | } | ||
175 | } | ||
176 | return(1); | ||
177 | } | ||
178 | |||
179 | int OBJ_NAME_remove(const char *name, int type) | ||
180 | { | ||
181 | OBJ_NAME on,*ret; | ||
182 | void (*f)(); | ||
183 | |||
184 | if (names_lh == NULL) return(0); | ||
185 | |||
186 | type&= ~OBJ_NAME_ALIAS; | ||
187 | on.name=name; | ||
188 | on.type=type; | ||
189 | ret=(OBJ_NAME *)lh_delete(names_lh,(char *)&on); | ||
190 | if (ret != NULL) | ||
191 | { | ||
192 | /* free things */ | ||
193 | if ((names_free != NULL) && (sk_num(names_free) > type)) | ||
194 | { | ||
195 | f=(void (*)())sk_value(names_free,type); | ||
196 | f(ret->name,ret->type,ret->data); | ||
197 | } | ||
198 | Free((char *)ret); | ||
199 | return(1); | ||
200 | } | ||
201 | else | ||
202 | return(0); | ||
203 | } | ||
204 | |||
205 | static int free_type; | ||
206 | |||
207 | static void names_lh_free(OBJ_NAME *onp, int type) | ||
208 | { | ||
209 | if(onp == NULL) | ||
210 | return; | ||
211 | |||
212 | if ((free_type < 0) || (free_type == onp->type)) | ||
213 | { | ||
214 | OBJ_NAME_remove(onp->name,onp->type); | ||
215 | } | ||
216 | } | ||
217 | |||
218 | void OBJ_NAME_cleanup(int type) | ||
219 | { | ||
220 | unsigned long down_load; | ||
221 | |||
222 | if (names_lh == NULL) return; | ||
223 | |||
224 | free_type=type; | ||
225 | down_load=names_lh->down_load; | ||
226 | names_lh->down_load=0; | ||
227 | |||
228 | lh_doall(names_lh,names_lh_free); | ||
229 | if (type < 0) | ||
230 | { | ||
231 | lh_free(names_lh); | ||
232 | sk_free(names_hash); | ||
233 | sk_free(names_cmp); | ||
234 | sk_free(names_free); | ||
235 | names_lh=NULL; | ||
236 | names_hash=NULL; | ||
237 | names_cmp=NULL; | ||
238 | names_free=NULL; | ||
239 | } | ||
240 | else | ||
241 | names_lh->down_load=down_load; | ||
242 | } | ||
243 | |||
diff --git a/src/lib/libcrypto/objects/obj_mac.num b/src/lib/libcrypto/objects/obj_mac.num new file mode 100644 index 0000000000..d73a51370f --- /dev/null +++ b/src/lib/libcrypto/objects/obj_mac.num | |||
@@ -0,0 +1,392 @@ | |||
1 | undef 0 | ||
2 | rsadsi 1 | ||
3 | pkcs 2 | ||
4 | md2 3 | ||
5 | md5 4 | ||
6 | rc4 5 | ||
7 | rsaEncryption 6 | ||
8 | md2WithRSAEncryption 7 | ||
9 | md5WithRSAEncryption 8 | ||
10 | pbeWithMD2AndDES_CBC 9 | ||
11 | pbeWithMD5AndDES_CBC 10 | ||
12 | X500 11 | ||
13 | X509 12 | ||
14 | commonName 13 | ||
15 | countryName 14 | ||
16 | localityName 15 | ||
17 | stateOrProvinceName 16 | ||
18 | organizationName 17 | ||
19 | organizationalUnitName 18 | ||
20 | rsa 19 | ||
21 | pkcs7 20 | ||
22 | pkcs7_data 21 | ||
23 | pkcs7_signed 22 | ||
24 | pkcs7_enveloped 23 | ||
25 | pkcs7_signedAndEnveloped 24 | ||
26 | pkcs7_digest 25 | ||
27 | pkcs7_encrypted 26 | ||
28 | pkcs3 27 | ||
29 | dhKeyAgreement 28 | ||
30 | des_ecb 29 | ||
31 | des_cfb64 30 | ||
32 | des_cbc 31 | ||
33 | des_ede 32 | ||
34 | des_ede3 33 | ||
35 | idea_cbc 34 | ||
36 | idea_cfb64 35 | ||
37 | idea_ecb 36 | ||
38 | rc2_cbc 37 | ||
39 | rc2_ecb 38 | ||
40 | rc2_cfb64 39 | ||
41 | rc2_ofb64 40 | ||
42 | sha 41 | ||
43 | shaWithRSAEncryption 42 | ||
44 | des_ede_cbc 43 | ||
45 | des_ede3_cbc 44 | ||
46 | des_ofb64 45 | ||
47 | idea_ofb64 46 | ||
48 | pkcs9 47 | ||
49 | pkcs9_emailAddress 48 | ||
50 | pkcs9_unstructuredName 49 | ||
51 | pkcs9_contentType 50 | ||
52 | pkcs9_messageDigest 51 | ||
53 | pkcs9_signingTime 52 | ||
54 | pkcs9_countersignature 53 | ||
55 | pkcs9_challengePassword 54 | ||
56 | pkcs9_unstructuredAddress 55 | ||
57 | pkcs9_extCertAttributes 56 | ||
58 | netscape 57 | ||
59 | netscape_cert_extension 58 | ||
60 | netscape_data_type 59 | ||
61 | des_ede_cfb64 60 | ||
62 | des_ede3_cfb64 61 | ||
63 | des_ede_ofb64 62 | ||
64 | des_ede3_ofb64 63 | ||
65 | sha1 64 | ||
66 | sha1WithRSAEncryption 65 | ||
67 | dsaWithSHA 66 | ||
68 | dsa_2 67 | ||
69 | pbeWithSHA1AndRC2_CBC 68 | ||
70 | id_pbkdf2 69 | ||
71 | dsaWithSHA1_2 70 | ||
72 | netscape_cert_type 71 | ||
73 | netscape_base_url 72 | ||
74 | netscape_revocation_url 73 | ||
75 | netscape_ca_revocation_url 74 | ||
76 | netscape_renewal_url 75 | ||
77 | netscape_ca_policy_url 76 | ||
78 | netscape_ssl_server_name 77 | ||
79 | netscape_comment 78 | ||
80 | netscape_cert_sequence 79 | ||
81 | desx_cbc 80 | ||
82 | id_ce 81 | ||
83 | subject_key_identifier 82 | ||
84 | key_usage 83 | ||
85 | private_key_usage_period 84 | ||
86 | subject_alt_name 85 | ||
87 | issuer_alt_name 86 | ||
88 | basic_constraints 87 | ||
89 | crl_number 88 | ||
90 | certificate_policies 89 | ||
91 | authority_key_identifier 90 | ||
92 | bf_cbc 91 | ||
93 | bf_ecb 92 | ||
94 | bf_cfb64 93 | ||
95 | bf_ofb64 94 | ||
96 | mdc2 95 | ||
97 | mdc2WithRSA 96 | ||
98 | rc4_40 97 | ||
99 | rc2_40_cbc 98 | ||
100 | givenName 99 | ||
101 | surname 100 | ||
102 | initials 101 | ||
103 | uniqueIdentifier 102 | ||
104 | crl_distribution_points 103 | ||
105 | md5WithRSA 104 | ||
106 | serialNumber 105 | ||
107 | title 106 | ||
108 | description 107 | ||
109 | cast5_cbc 108 | ||
110 | cast5_ecb 109 | ||
111 | cast5_cfb64 110 | ||
112 | cast5_ofb64 111 | ||
113 | pbeWithMD5AndCast5_CBC 112 | ||
114 | dsaWithSHA1 113 | ||
115 | md5_sha1 114 | ||
116 | sha1WithRSA 115 | ||
117 | dsa 116 | ||
118 | ripemd160 117 | ||
119 | ripemd160WithRSA 119 | ||
120 | rc5_cbc 120 | ||
121 | rc5_ecb 121 | ||
122 | rc5_cfb64 122 | ||
123 | rc5_ofb64 123 | ||
124 | rle_compression 124 | ||
125 | zlib_compression 125 | ||
126 | ext_key_usage 126 | ||
127 | id_pkix 127 | ||
128 | id_kp 128 | ||
129 | server_auth 129 | ||
130 | client_auth 130 | ||
131 | code_sign 131 | ||
132 | email_protect 132 | ||
133 | time_stamp 133 | ||
134 | ms_code_ind 134 | ||
135 | ms_code_com 135 | ||
136 | ms_ctl_sign 136 | ||
137 | ms_sgc 137 | ||
138 | ms_efs 138 | ||
139 | ns_sgc 139 | ||
140 | delta_crl 140 | ||
141 | crl_reason 141 | ||
142 | invalidity_date 142 | ||
143 | sxnet 143 | ||
144 | pbe_WithSHA1And128BitRC4 144 | ||
145 | pbe_WithSHA1And40BitRC4 145 | ||
146 | pbe_WithSHA1And3_Key_TripleDES_CBC 146 | ||
147 | pbe_WithSHA1And2_Key_TripleDES_CBC 147 | ||
148 | pbe_WithSHA1And128BitRC2_CBC 148 | ||
149 | pbe_WithSHA1And40BitRC2_CBC 149 | ||
150 | keyBag 150 | ||
151 | pkcs8ShroudedKeyBag 151 | ||
152 | certBag 152 | ||
153 | crlBag 153 | ||
154 | secretBag 154 | ||
155 | safeContentsBag 155 | ||
156 | friendlyName 156 | ||
157 | localKeyID 157 | ||
158 | x509Certificate 158 | ||
159 | sdsiCertificate 159 | ||
160 | x509Crl 160 | ||
161 | pbes2 161 | ||
162 | pbmac1 162 | ||
163 | hmacWithSHA1 163 | ||
164 | id_qt_cps 164 | ||
165 | id_qt_unotice 165 | ||
166 | rc2_64_cbc 166 | ||
167 | SMIMECapabilities 167 | ||
168 | pbeWithMD2AndRC2_CBC 168 | ||
169 | pbeWithMD5AndRC2_CBC 169 | ||
170 | pbeWithSHA1AndDES_CBC 170 | ||
171 | ms_ext_req 171 | ||
172 | ext_req 172 | ||
173 | name 173 | ||
174 | dnQualifier 174 | ||
175 | id_pe 175 | ||
176 | id_ad 176 | ||
177 | info_access 177 | ||
178 | ad_OCSP 178 | ||
179 | ad_ca_issuers 179 | ||
180 | OCSP_sign 180 | ||
181 | iso 181 | ||
182 | member_body 182 | ||
183 | ISO_US 183 | ||
184 | X9_57 184 | ||
185 | X9cm 185 | ||
186 | pkcs1 186 | ||
187 | pkcs5 187 | ||
188 | SMIME 188 | ||
189 | id_smime_mod 189 | ||
190 | id_smime_ct 190 | ||
191 | id_smime_aa 191 | ||
192 | id_smime_alg 192 | ||
193 | id_smime_cd 193 | ||
194 | id_smime_spq 194 | ||
195 | id_smime_cti 195 | ||
196 | id_smime_mod_cms 196 | ||
197 | id_smime_mod_ess 197 | ||
198 | id_smime_mod_oid 198 | ||
199 | id_smime_mod_msg_v3 199 | ||
200 | id_smime_mod_ets_eSignature_88 200 | ||
201 | id_smime_mod_ets_eSignature_97 201 | ||
202 | id_smime_mod_ets_eSigPolicy_88 202 | ||
203 | id_smime_mod_ets_eSigPolicy_97 203 | ||
204 | id_smime_ct_receipt 204 | ||
205 | id_smime_ct_authData 205 | ||
206 | id_smime_ct_publishCert 206 | ||
207 | id_smime_ct_TSTInfo 207 | ||
208 | id_smime_ct_TDTInfo 208 | ||
209 | id_smime_ct_contentInfo 209 | ||
210 | id_smime_ct_DVCSRequestData 210 | ||
211 | id_smime_ct_DVCSResponseData 211 | ||
212 | id_smime_aa_receiptRequest 212 | ||
213 | id_smime_aa_securityLabel 213 | ||
214 | id_smime_aa_mlExpandHistory 214 | ||
215 | id_smime_aa_contentHint 215 | ||
216 | id_smime_aa_msgSigDigest 216 | ||
217 | id_smime_aa_encapContentType 217 | ||
218 | id_smime_aa_contentIdentifier 218 | ||
219 | id_smime_aa_macValue 219 | ||
220 | id_smime_aa_equivalentLabels 220 | ||
221 | id_smime_aa_contentReference 221 | ||
222 | id_smime_aa_encrypKeyPref 222 | ||
223 | id_smime_aa_signingCertificate 223 | ||
224 | id_smime_aa_smimeEncryptCerts 224 | ||
225 | id_smime_aa_timeStampToken 225 | ||
226 | id_smime_aa_ets_sigPolicyId 226 | ||
227 | id_smime_aa_ets_commitmentType 227 | ||
228 | id_smime_aa_ets_signerLocation 228 | ||
229 | id_smime_aa_ets_signerAttr 229 | ||
230 | id_smime_aa_ets_otherSigCert 230 | ||
231 | id_smime_aa_ets_contentTimestamp 231 | ||
232 | id_smime_aa_ets_CertificateRefs 232 | ||
233 | id_smime_aa_ets_RevocationRefs 233 | ||
234 | id_smime_aa_ets_certValues 234 | ||
235 | id_smime_aa_ets_revocationValues 235 | ||
236 | id_smime_aa_ets_escTimeStamp 236 | ||
237 | id_smime_aa_ets_certCRLTimestamp 237 | ||
238 | id_smime_aa_ets_archiveTimeStamp 238 | ||
239 | id_smime_aa_signatureType 239 | ||
240 | id_smime_aa_dvcs_dvc 240 | ||
241 | id_smime_alg_ESDHwith3DES 241 | ||
242 | id_smime_alg_ESDHwithRC2 242 | ||
243 | id_smime_alg_3DESwrap 243 | ||
244 | id_smime_alg_RC2wrap 244 | ||
245 | id_smime_alg_ESDH 245 | ||
246 | id_smime_alg_CMS3DESwrap 246 | ||
247 | id_smime_alg_CMSRC2wrap 247 | ||
248 | id_smime_cd_ldap 248 | ||
249 | id_smime_spq_ets_sqt_uri 249 | ||
250 | id_smime_spq_ets_sqt_unotice 250 | ||
251 | id_smime_cti_ets_proofOfOrigin 251 | ||
252 | id_smime_cti_ets_proofOfReceipt 252 | ||
253 | id_smime_cti_ets_proofOfDelivery 253 | ||
254 | id_smime_cti_ets_proofOfSender 254 | ||
255 | id_smime_cti_ets_proofOfApproval 255 | ||
256 | id_smime_cti_ets_proofOfCreation 256 | ||
257 | md4 257 | ||
258 | id_pkix_mod 258 | ||
259 | id_qt 259 | ||
260 | id_it 260 | ||
261 | id_pkip 261 | ||
262 | id_alg 262 | ||
263 | id_cmc 263 | ||
264 | id_on 264 | ||
265 | id_pda 265 | ||
266 | id_aca 266 | ||
267 | id_qcs 267 | ||
268 | id_cct 268 | ||
269 | id_pkix1_explicit_88 269 | ||
270 | id_pkix1_implicit_88 270 | ||
271 | id_pkix1_explicit_93 271 | ||
272 | id_pkix1_implicit_93 272 | ||
273 | id_mod_crmf 273 | ||
274 | id_mod_cmc 274 | ||
275 | id_mod_kea_profile_88 275 | ||
276 | id_mod_kea_profile_93 276 | ||
277 | id_mod_cmp 277 | ||
278 | id_mod_qualified_cert_88 278 | ||
279 | id_mod_qualified_cert_93 279 | ||
280 | id_mod_attribute_cert 280 | ||
281 | id_mod_timestamp_protocol 281 | ||
282 | id_mod_ocsp 282 | ||
283 | id_mod_dvcs 283 | ||
284 | id_mod_cmp2000 284 | ||
285 | biometricInfo 285 | ||
286 | qcStatements 286 | ||
287 | ac_auditEntity 287 | ||
288 | ac_targeting 288 | ||
289 | aaControls 289 | ||
290 | sbqp_ipAddrBlock 290 | ||
291 | sbqp_autonomousSysNum 291 | ||
292 | sbqp_routerIdentifier 292 | ||
293 | textNotice 293 | ||
294 | ipsecEndSystem 294 | ||
295 | ipsecTunnel 295 | ||
296 | ipsecUser 296 | ||
297 | dvcs 297 | ||
298 | id_it_caProtEncCert 298 | ||
299 | id_it_signKeyPairTypes 299 | ||
300 | id_it_encKeyPairTypes 300 | ||
301 | id_it_preferredSymmAlg 301 | ||
302 | id_it_caKeyUpdateInfo 302 | ||
303 | id_it_currentCRL 303 | ||
304 | id_it_unsupportedOIDs 304 | ||
305 | id_it_subscriptionRequest 305 | ||
306 | id_it_subscriptionResponse 306 | ||
307 | id_it_keyPairParamReq 307 | ||
308 | id_it_keyPairParamRep 308 | ||
309 | id_it_revPassphrase 309 | ||
310 | id_it_implicitConfirm 310 | ||
311 | id_it_confirmWaitTime 311 | ||
312 | id_it_origPKIMessage 312 | ||
313 | id_regCtrl 313 | ||
314 | id_regInfo 314 | ||
315 | id_regCtrl_regToken 315 | ||
316 | id_regCtrl_authenticator 316 | ||
317 | id_regCtrl_pkiPublicationInfo 317 | ||
318 | id_regCtrl_pkiArchiveOptions 318 | ||
319 | id_regCtrl_oldCertID 319 | ||
320 | id_regCtrl_protocolEncrKey 320 | ||
321 | id_regInfo_utf8Pairs 321 | ||
322 | id_regInfo_certReq 322 | ||
323 | id_alg_des40 323 | ||
324 | id_alg_noSignature 324 | ||
325 | id_alg_dh_sig_hmac_sha1 325 | ||
326 | id_alg_dh_pop 326 | ||
327 | id_cmc_statusInfo 327 | ||
328 | id_cmc_identification 328 | ||
329 | id_cmc_identityProof 329 | ||
330 | id_cmc_dataReturn 330 | ||
331 | id_cmc_transactionId 331 | ||
332 | id_cmc_senderNonce 332 | ||
333 | id_cmc_recipientNonce 333 | ||
334 | id_cmc_addExtensions 334 | ||
335 | id_cmc_encryptedPOP 335 | ||
336 | id_cmc_decryptedPOP 336 | ||
337 | id_cmc_lraPOPWitness 337 | ||
338 | id_cmc_getCert 338 | ||
339 | id_cmc_getCRL 339 | ||
340 | id_cmc_revokeRequest 340 | ||
341 | id_cmc_regInfo 341 | ||
342 | id_cmc_responseInfo 342 | ||
343 | id_cmc_queryPending 343 | ||
344 | id_cmc_popLinkRandom 344 | ||
345 | id_cmc_popLinkWitness 345 | ||
346 | id_cmc_confirmCertAcceptance 346 | ||
347 | id_on_personalData 347 | ||
348 | id_pda_dateOfBirth 348 | ||
349 | id_pda_placeOfBirth 349 | ||
350 | id_pda_pseudonym 350 | ||
351 | id_pda_gender 351 | ||
352 | id_pda_countryOfCitizenship 352 | ||
353 | id_pda_countryOfResidence 353 | ||
354 | id_aca_authenticationInfo 354 | ||
355 | id_aca_accessIdentity 355 | ||
356 | id_aca_chargingIdentity 356 | ||
357 | id_aca_group 357 | ||
358 | id_aca_role 358 | ||
359 | id_qcs_pkixQCSyntax_v1 359 | ||
360 | id_cct_crs 360 | ||
361 | id_cct_PKIData 361 | ||
362 | id_cct_PKIResponse 362 | ||
363 | ad_timeStamping 363 | ||
364 | ad_dvcs 364 | ||
365 | id_pkix_OCSP_basic 365 | ||
366 | id_pkix_OCSP_Nonce 366 | ||
367 | id_pkix_OCSP_CrlID 367 | ||
368 | id_pkix_OCSP_acceptableResponses 368 | ||
369 | id_pkix_OCSP_noCheck 369 | ||
370 | id_pkix_OCSP_archiveCutoff 370 | ||
371 | id_pkix_OCSP_serviceLocator 371 | ||
372 | id_pkix_OCSP_extendedStatus 372 | ||
373 | id_pkix_OCSP_valid 373 | ||
374 | id_pkix_OCSP_path 374 | ||
375 | id_pkix_OCSP_trustRoot 375 | ||
376 | algorithm 376 | ||
377 | rsaSignature 377 | ||
378 | X500algorithms 378 | ||
379 | org 379 | ||
380 | dod 380 | ||
381 | iana 381 | ||
382 | Directory 382 | ||
383 | Management 383 | ||
384 | Experimental 384 | ||
385 | Private 385 | ||
386 | Security 386 | ||
387 | SNMPv2 387 | ||
388 | Mail 388 | ||
389 | Enterprises 389 | ||
390 | dcObject 390 | ||
391 | domainComponent 391 | ||
392 | Domain 392 | ||
diff --git a/src/lib/libcrypto/objects/objects.README b/src/lib/libcrypto/objects/objects.README new file mode 100644 index 0000000000..4d745508d8 --- /dev/null +++ b/src/lib/libcrypto/objects/objects.README | |||
@@ -0,0 +1,44 @@ | |||
1 | objects.txt syntax | ||
2 | ------------------ | ||
3 | |||
4 | To cover all the naming hacks that were previously in objects.h needed some | ||
5 | kind of hacks in objects.txt. | ||
6 | |||
7 | The basic syntax for adding an object is as follows: | ||
8 | |||
9 | 1 2 3 4 : shortName : Long Name | ||
10 | |||
11 | If the long name doesn't contain spaces, or no short name | ||
12 | exists, the long name is used as basis for the base name | ||
13 | in C. Otherwise, the short name is used. | ||
14 | |||
15 | The base name (let's call it 'base') will then be used to | ||
16 | create the C macros SN_base, LN_base, NID_base and OBJ_base. | ||
17 | |||
18 | Note that if the base name contains spaces, dashes or periods, | ||
19 | those will be converte to underscore. | ||
20 | |||
21 | Then there are some extra commands: | ||
22 | |||
23 | !Alias foo 1 2 3 4 | ||
24 | |||
25 | This juts makes a name foo for an OID. The C macro | ||
26 | OBJ_foo will be created as a result. | ||
27 | |||
28 | !Cname foo | ||
29 | |||
30 | This makes sure that the name foo will be used as base name | ||
31 | in C. | ||
32 | |||
33 | !module foo | ||
34 | 1 2 3 4 : shortName : Long Name | ||
35 | !global | ||
36 | |||
37 | The !module command was meant to define a kind of modularity. | ||
38 | What it does is to make sure the module name is prepended | ||
39 | to the base name. !global turns this off. This construction | ||
40 | is not recursive. | ||
41 | |||
42 | Lines starting with # are treated as comments, as well as any line starting | ||
43 | with ! and not matching the commands above. | ||
44 | |||
diff --git a/src/lib/libcrypto/objects/objects.pl b/src/lib/libcrypto/objects/objects.pl new file mode 100644 index 0000000000..c956bbb841 --- /dev/null +++ b/src/lib/libcrypto/objects/objects.pl | |||
@@ -0,0 +1,224 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]"; | ||
4 | $max_nid=0; | ||
5 | $o=0; | ||
6 | while(<NUMIN>) | ||
7 | { | ||
8 | chop; | ||
9 | $o++; | ||
10 | s/#.*$//; | ||
11 | next if /^\s*$/; | ||
12 | ($Cname,$mynum) = split; | ||
13 | if (defined($nidn{$mynum})) | ||
14 | { die "$ARGV[1]:$o:There's already an object with NID ",$mynum," on line ",$order{$mynum},"\n"; } | ||
15 | $nid{$Cname} = $mynum; | ||
16 | $nidn{$mynum} = $Cname; | ||
17 | $order{$mynum} = $o; | ||
18 | $max_nid = $mynum if $mynum > $max_nid; | ||
19 | } | ||
20 | close NUMIN; | ||
21 | |||
22 | open (IN,"$ARGV[0]") || die "Can't open input file $ARGV[0]"; | ||
23 | $Cname=""; | ||
24 | $o=0; | ||
25 | while (<IN>) | ||
26 | { | ||
27 | chop; | ||
28 | $o++; | ||
29 | if (/^!module\s+(.*)$/) | ||
30 | { | ||
31 | $module = $1."-"; | ||
32 | $module =~ s/\./_/g; | ||
33 | $module =~ s/-/_/g; | ||
34 | } | ||
35 | if (/^!global$/) | ||
36 | { $module = ""; } | ||
37 | if (/^!Cname\s+(.*)$/) | ||
38 | { $Cname = $1; } | ||
39 | if (/^!Alias\s+(.+?)\s+(.*)$/) | ||
40 | { | ||
41 | $Cname = $module.$1; | ||
42 | $myoid = $2; | ||
43 | $myoid = &process_oid($myoid); | ||
44 | $Cname =~ s/-/_/g; | ||
45 | $ordern{$o} = $Cname; | ||
46 | $order{$Cname} = $o; | ||
47 | $obj{$Cname} = $myoid; | ||
48 | $_ = ""; | ||
49 | $Cname = ""; | ||
50 | } | ||
51 | s/!.*$//; | ||
52 | s/#.*$//; | ||
53 | next if /^\s*$/; | ||
54 | ($myoid,$mysn,$myln) = split ':'; | ||
55 | $mysn =~ s/^\s*//; | ||
56 | $mysn =~ s/\s*$//; | ||
57 | $myln =~ s/^\s*//; | ||
58 | $myln =~ s/\s*$//; | ||
59 | $myoid =~ s/^\s*//; | ||
60 | $myoid =~ s/\s*$//; | ||
61 | if ($myoid ne "") | ||
62 | { | ||
63 | $myoid = &process_oid($myoid); | ||
64 | } | ||
65 | |||
66 | if ($Cname eq "" && !($myln =~ / /)) | ||
67 | { | ||
68 | $Cname = $myln; | ||
69 | $Cname =~ s/\./_/g; | ||
70 | $Cname =~ s/-/_/g; | ||
71 | if ($Cname ne "" && defined($ln{$module.$Cname})) | ||
72 | { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; } | ||
73 | } | ||
74 | if ($Cname eq "") | ||
75 | { | ||
76 | $Cname = $mysn; | ||
77 | $Cname =~ s/-/_/g; | ||
78 | if ($Cname ne "" && defined($sn{$module.$Cname})) | ||
79 | { die "objects.txt:$o:There's already an object with short name ",$sn{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; } | ||
80 | } | ||
81 | if ($Cname eq "") | ||
82 | { | ||
83 | $Cname = $myln; | ||
84 | $Cname =~ s/-/_/g; | ||
85 | $Cname =~ s/\./_/g; | ||
86 | $Cname =~ s/ /_/g; | ||
87 | if ($Cname ne "" && defined($ln{$module.$Cname})) | ||
88 | { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; } | ||
89 | } | ||
90 | $Cname =~ s/\./_/g; | ||
91 | $Cname =~ s/-/_/g; | ||
92 | $Cname = $module.$Cname; | ||
93 | $ordern{$o} = $Cname; | ||
94 | $order{$Cname} = $o; | ||
95 | $sn{$Cname} = $mysn; | ||
96 | $ln{$Cname} = $myln; | ||
97 | $obj{$Cname} = $myoid; | ||
98 | if (!defined($nid{$Cname})) | ||
99 | { | ||
100 | $max_nid++; | ||
101 | $nid{$Cname} = $max_nid; | ||
102 | $nidn{$max_nid} = $Cname; | ||
103 | } | ||
104 | $Cname=""; | ||
105 | } | ||
106 | close IN; | ||
107 | |||
108 | open (NUMOUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]"; | ||
109 | foreach (sort { $a <=> $b } keys %nidn) | ||
110 | { | ||
111 | print NUMOUT $nidn{$_},"\t\t",$_,"\n"; | ||
112 | } | ||
113 | close NUMOUT; | ||
114 | |||
115 | open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]"; | ||
116 | print OUT <<'EOF'; | ||
117 | /* lib/obj/obj_mac.h */ | ||
118 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | ||
119 | * All rights reserved. | ||
120 | * | ||
121 | * This package is an SSL implementation written | ||
122 | * by Eric Young (eay@cryptsoft.com). | ||
123 | * The implementation was written so as to conform with Netscapes SSL. | ||
124 | * | ||
125 | * This library is free for commercial and non-commercial use as long as | ||
126 | * the following conditions are aheared to. The following conditions | ||
127 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
128 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
129 | * included with this distribution is covered by the same copyright terms | ||
130 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
131 | * | ||
132 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
133 | * the code are not to be removed. | ||
134 | * If this package is used in a product, Eric Young should be given attribution | ||
135 | * as the author of the parts of the library used. | ||
136 | * This can be in the form of a textual message at program startup or | ||
137 | * in documentation (online or textual) provided with the package. | ||
138 | * | ||
139 | * Redistribution and use in source and binary forms, with or without | ||
140 | * modification, are permitted provided that the following conditions | ||
141 | * are met: | ||
142 | * 1. Redistributions of source code must retain the copyright | ||
143 | * notice, this list of conditions and the following disclaimer. | ||
144 | * 2. Redistributions in binary form must reproduce the above copyright | ||
145 | * notice, this list of conditions and the following disclaimer in the | ||
146 | * documentation and/or other materials provided with the distribution. | ||
147 | * 3. All advertising materials mentioning features or use of this software | ||
148 | * must display the following acknowledgement: | ||
149 | * "This product includes cryptographic software written by | ||
150 | * Eric Young (eay@cryptsoft.com)" | ||
151 | * The word 'cryptographic' can be left out if the rouines from the library | ||
152 | * being used are not cryptographic related :-). | ||
153 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
154 | * the apps directory (application code) you must include an acknowledgement: | ||
155 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
156 | * | ||
157 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
158 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
159 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
160 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
161 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
162 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
163 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
164 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
165 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
166 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
167 | * SUCH DAMAGE. | ||
168 | * | ||
169 | * The licence and distribution terms for any publically available version or | ||
170 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
171 | * copied and put under another distribution licence | ||
172 | * [including the GNU Public Licence.] | ||
173 | */ | ||
174 | |||
175 | /* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the | ||
176 | * following command: | ||
177 | * perl objects.pl objects.txt obj_mac.num obj_mac.h | ||
178 | */ | ||
179 | |||
180 | #define SN_undef "UNDEF" | ||
181 | #define LN_undef "undefined" | ||
182 | #define NID_undef 0 | ||
183 | #define OBJ_undef 0L | ||
184 | |||
185 | EOF | ||
186 | |||
187 | foreach (sort { $a <=> $b } keys %ordern) | ||
188 | { | ||
189 | $Cname=$ordern{$_}; | ||
190 | print OUT "#define SN_",$Cname,"\t\t\"",$sn{$Cname},"\"\n" if $sn{$Cname} ne ""; | ||
191 | print OUT "#define LN_",$Cname,"\t\t\"",$ln{$Cname},"\"\n" if $ln{$Cname} ne ""; | ||
192 | print OUT "#define NID_",$Cname,"\t\t",$nid{$Cname},"\n" if $nid{$Cname} ne ""; | ||
193 | print OUT "#define OBJ_",$Cname,"\t\t",$obj{$Cname},"\n" if $obj{$Cname} ne ""; | ||
194 | print OUT "\n"; | ||
195 | } | ||
196 | |||
197 | close OUT; | ||
198 | |||
199 | sub process_oid | ||
200 | { | ||
201 | local($oid)=@_; | ||
202 | local(@a,$oid_pref); | ||
203 | |||
204 | @a = split(/\s+/,$myoid); | ||
205 | $pref_oid = ""; | ||
206 | $pref_sep = ""; | ||
207 | if (!($a[0] =~ /^[0-9]+$/)) | ||
208 | { | ||
209 | $a[0] =~ s/-/_/g; | ||
210 | $pref_oid = "OBJ_" . $a[0]; | ||
211 | $pref_sep = ","; | ||
212 | shift @a; | ||
213 | } | ||
214 | $oids = join('L,',@a) . "L"; | ||
215 | if ($oids ne "L") | ||
216 | { | ||
217 | $oids = $pref_oid . $pref_sep . $oids; | ||
218 | } | ||
219 | else | ||
220 | { | ||
221 | $oids = $pref_oid; | ||
222 | } | ||
223 | return($oids); | ||
224 | } | ||