]> git.saurik.com Git - apple/security.git/blob - libsecurity_smime/lib/secoid.c
Security-58286.51.6.tar.gz
[apple/security.git] / libsecurity_smime / lib / secoid.c
1 /*
2 * The contents of this file are subject to the Mozilla Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/MPL/
6 *
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
11 *
12 * The Original Code is the Netscape security libraries.
13 *
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1994-2000 Netscape Communications Corporation. All
17 * Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * Alternatively, the contents of this file may be used under the
22 * terms of the GNU General Public License Version 2 or later (the
23 * "GPL"), in which case the provisions of the GPL are applicable
24 * instead of those above. If you wish to allow use of your
25 * version of this file only under the terms of the GPL and not to
26 * allow others to use your version of this file under the MPL,
27 * indicate your decision by deleting the provisions above and
28 * replace them with the notice and other provisions required by
29 * the GPL. If you do not delete the provisions above, a recipient
30 * may use your version of this file under either the MPL or the
31 * GPL.
32 */
33
34 #include "secoid.h"
35 #include "SecAsn1Item.h"
36 #include "plhash.h"
37
38 #include <security_asn1/secerr.h>
39 #include <security_asn1/secport.h>
40
41 #if USE_CDSA_CRYPTO
42 #include <Security/cssmapple.h>
43 #else
44 #include <Security/oidsalg.h>
45 #include <CommonCrypto/CommonCryptor.h>
46 #endif
47 #include <pthread.h>
48
49 /* MISSI Mosaic Object ID space */
50 #define USGOV 0x60, 0x86, 0x48, 0x01, 0x65
51 #define MISSI USGOV, 0x02, 0x01, 0x01
52 #define MISSI_OLD_KEA_DSS MISSI, 0x0c
53 #define MISSI_OLD_DSS MISSI, 0x02
54 #define MISSI_KEA_DSS MISSI, 0x14
55 #define MISSI_DSS MISSI, 0x13
56 #define MISSI_KEA MISSI, 0x0a
57 #define MISSI_ALT_KEA MISSI, 0x16
58
59 #define NISTALGS USGOV, 3, 4
60 #define AES NISTALGS, 1
61 #define SHAXXX NISTALGS, 2
62
63 /**
64 ** The Netscape OID space is allocated by Terry Hayes. If you need
65 ** a piece of the space, contact him at thayes@netscape.com.
66 **/
67
68 /* Netscape Communications Corporation Object ID space */
69 /* { 2 16 840 1 113730 } */
70 #define NETSCAPE_OID 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42
71 #define NETSCAPE_CERT_EXT NETSCAPE_OID, 0x01
72 #define NETSCAPE_DATA_TYPE NETSCAPE_OID, 0x02
73 /* netscape directory oid - owned by Mark Smith (mcs@netscape.com) */
74 #define NETSCAPE_DIRECTORY NETSCAPE_OID, 0x03
75 #define NETSCAPE_POLICY NETSCAPE_OID, 0x04
76 #define NETSCAPE_CERT_SERVER NETSCAPE_OID, 0x05
77 #define NETSCAPE_ALGS NETSCAPE_OID, 0x06 /* algorithm OIDs */
78 #define NETSCAPE_NAME_COMPONENTS NETSCAPE_OID, 0x07
79
80 #define NETSCAPE_CERT_EXT_AIA NETSCAPE_CERT_EXT, 0x10
81 #define NETSCAPE_CERT_SERVER_CRMF NETSCAPE_CERT_SERVER, 0x01
82
83 /* these are old and should go away soon */
84 #define OLD_NETSCAPE 0x60, 0x86, 0x48, 0xd8, 0x6a
85 #define NS_CERT_EXT OLD_NETSCAPE, 0x01
86 #define NS_FILE_TYPE OLD_NETSCAPE, 0x02
87 #define NS_IMAGE_TYPE OLD_NETSCAPE, 0x03
88
89 /* RSA OID name space */
90 #define RSADSI 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d
91 #define PKCS RSADSI, 0x01
92 #define DIGEST RSADSI, 0x02
93 #define CIPHER RSADSI, 0x03
94 #define PKCS1 PKCS, 0x01
95 #define PKCS5 PKCS, 0x05
96 #define PKCS7 PKCS, 0x07
97 #define PKCS9 PKCS, 0x09
98 #define PKCS12 PKCS, 0x0c
99
100 /* Fortezza algorithm OID space: { 2 16 840 1 101 2 1 1 } */
101 /* ### mwelch -- Is this just for algorithms, or all of Fortezza? */
102 #define FORTEZZA_ALG 0x60, 0x86, 0x48, 0x01, 0x65, 0x02, 0x01, 0x01
103
104 /* Other OID name spaces */
105 #define ALGORITHM 0x2b, 0x0e, 0x03, 0x02
106 #define X500 0x55
107 #define X520_ATTRIBUTE_TYPE X500, 0x04
108 #define X500_ALG X500, 0x08
109 #define X500_ALG_ENCRYPTION X500_ALG, 0x01
110
111 /** X.509 v3 Extension OID
112 ** {joint-iso-ccitt (2) ds(5) 29}
113 **/
114 #define ID_CE_OID X500, 0x1d
115
116 #define RFC1274_ATTR_TYPE 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x1
117 /* #define RFC2247_ATTR_TYPE 0x09, 0x92, 0x26, 0xf5, 0x98, 0x1e, 0x64, 0x1 this is WRONG! */
118
119 /* PKCS #12 name spaces */
120 #define PKCS12_MODE_IDS PKCS12, 0x01
121 #define PKCS12_ESPVK_IDS PKCS12, 0x02
122 #define PKCS12_BAG_IDS PKCS12, 0x03
123 #define PKCS12_CERT_BAG_IDS PKCS12, 0x04
124 #define PKCS12_OIDS PKCS12, 0x05
125 #define PKCS12_PBE_IDS PKCS12_OIDS, 0x01
126 #define PKCS12_ENVELOPING_IDS PKCS12_OIDS, 0x02
127 #define PKCS12_SIGNATURE_IDS PKCS12_OIDS, 0x03
128 #define PKCS12_V2_PBE_IDS PKCS12, 0x01
129 #define PKCS9_CERT_TYPES PKCS9, 0x16
130 #define PKCS9_CRL_TYPES PKCS9, 0x17
131 #define PKCS9_SMIME_IDS PKCS9, 0x10
132 #define PKCS9_SMIME_CTYPE PKCS9_SMIME_IDS, 1
133 #define PKCS9_SMIME_ATTRS PKCS9_SMIME_IDS, 2
134 #define PKCS9_SMIME_ALGS PKCS9_SMIME_IDS, 3
135 #define PKCS12_VERSION1 PKCS12, 0x0a
136 #define PKCS12_V1_BAG_IDS PKCS12_VERSION1, 1
137
138 /* for DSA algorithm */
139 /* { iso(1) member-body(2) us(840) x9-57(10040) x9algorithm(4) } */
140 #define ANSI_X9_ALGORITHM 0x2a, 0x86, 0x48, 0xce, 0x38, 0x4
141
142 /* for DH algorithm */
143 /* { iso(1) member-body(2) us(840) x9-57(10046) number-type(2) } */
144 /* need real OID person to look at this, copied the above line
145 * and added 6 to second to last value (and changed '4' to '2' */
146 #define ANSI_X942_ALGORITHM 0x2a, 0x86, 0x48, 0xce, 0x3e, 0x2
147
148 #define VERISIGN 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45
149
150 #define PKIX 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07
151 #define PKIX_CERT_EXTENSIONS PKIX, 1
152 #define PKIX_POLICY_QUALIFIERS PKIX, 2
153 #define PKIX_KEY_USAGE PKIX, 3
154 #define PKIX_ACCESS_DESCRIPTION PKIX, 0x30
155 #define PKIX_OCSP PKIX_ACCESS_DESCRIPTION, 1
156
157 #define PKIX_ID_PKIP PKIX, 5
158 #define PKIX_ID_REGCTRL PKIX_ID_PKIP, 1
159 #define PKIX_ID_REGINFO PKIX_ID_PKIP, 2
160
161 /* Microsoft Object ID space */
162 /* { 1.3.6.1.4.1.311 } */
163 #define MICROSOFT_OID 0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37
164
165 /* ECDSA OIDs from X9.62 */
166 #define ANSI_X9_62 0x2A, 0x86, 0x48, 0xCE, 0x3D
167 #define ANSI_X9_62_FIELD_TYPE ANSI_X9_62, 1
168 #define ANSI_X9_62_PUBKEY_TYPE ANSI_X9_62, 2
169 #define ANSI_X9_62_SIG_TYPE ANSI_X9_62, 4
170 #define ECDSA_WITH_SHA2 ANSI_X9_62_SIG_TYPE, 3
171
172 /* X9.63 schemes */
173 #define ANSI_X9_63 0x2B, 0x81, 0x05, 0x10, 0x86, 0x48, 0x3F
174 #define ANSI_X9_63_SCHEME ANSI_X9_63, 0
175
176 /* ECDH curves */
177 #define CERTICOM_ELL_CURVE 0x2B, 0x81, 0x04, 0x00
178
179 /* Apple OID sapce */
180 /* 1.2.840.113635 */
181 #define APPLE_OID 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x63
182 #define APPLE_DATA_SECURITY APPLE_OID, 0x64
183 #define APPLE_CMS_ATTRIBUTES APPLE_DATA_SECURITY, 0x9
184
185 #define CONST_OID static const unsigned char
186
187 CONST_OID null_oid[] = { };
188
189 CONST_OID md2[] = { DIGEST, 0x02 };
190 CONST_OID md4[] = { DIGEST, 0x04 };
191 CONST_OID md5[] = { DIGEST, 0x05 };
192
193 CONST_OID rc2cbc[] = { CIPHER, 0x02 };
194 CONST_OID rc4[] = { CIPHER, 0x04 };
195 CONST_OID desede3cbc[] = { CIPHER, 0x07 };
196 CONST_OID rc5cbcpad[] = { CIPHER, 0x09 };
197
198 CONST_OID desecb[] = { ALGORITHM, 0x06 };
199 CONST_OID descbc[] = { ALGORITHM, 0x07 };
200 CONST_OID desofb[] = { ALGORITHM, 0x08 };
201 CONST_OID descfb[] = { ALGORITHM, 0x09 };
202 CONST_OID desmac[] = { ALGORITHM, 0x0a };
203 CONST_OID sdn702DSASignature[] = { ALGORITHM, 0x0c };
204 CONST_OID isoSHAWithRSASignature[] = { ALGORITHM, 0x0f };
205 CONST_OID desede[] = { ALGORITHM, 0x11 };
206 CONST_OID sha1[] = { ALGORITHM, 0x1a };
207 CONST_OID bogusDSASignaturewithSHA1Digest[] = { ALGORITHM, 0x1b };
208
209 CONST_OID pkcs1RSAEncryption[] = { PKCS1, 0x01 };
210 CONST_OID pkcs1MD2WithRSAEncryption[] = { PKCS1, 0x02 };
211 CONST_OID pkcs1MD4WithRSAEncryption[] = { PKCS1, 0x03 };
212 CONST_OID pkcs1MD5WithRSAEncryption[] = { PKCS1, 0x04 };
213 CONST_OID pkcs1SHA1WithRSAEncryption[] = { PKCS1, 0x05 };
214 CONST_OID pkcs1SHA256WithRSAEncryption[] = { PKCS1, 11 };
215 CONST_OID pkcs1SHA384WithRSAEncryption[] = { PKCS1, 12 };
216 CONST_OID pkcs1SHA512WithRSAEncryption[] = { PKCS1, 13 };
217
218 CONST_OID pkcs5PbeWithMD2AndDEScbc[] = { PKCS5, 0x01 };
219 CONST_OID pkcs5PbeWithMD5AndDEScbc[] = { PKCS5, 0x03 };
220 CONST_OID pkcs5PbeWithSha1AndDEScbc[] = { PKCS5, 0x0a };
221
222 CONST_OID pkcs7[] = { PKCS7 };
223 CONST_OID pkcs7Data[] = { PKCS7, 0x01 };
224 CONST_OID pkcs7SignedData[] = { PKCS7, 0x02 };
225 CONST_OID pkcs7EnvelopedData[] = { PKCS7, 0x03 };
226 CONST_OID pkcs7SignedEnvelopedData[] = { PKCS7, 0x04 };
227 CONST_OID pkcs7DigestedData[] = { PKCS7, 0x05 };
228 CONST_OID pkcs7EncryptedData[] = { PKCS7, 0x06 };
229
230 CONST_OID pkcs9EmailAddress[] = { PKCS9, 0x01 };
231 CONST_OID pkcs9UnstructuredName[] = { PKCS9, 0x02 };
232 CONST_OID pkcs9ContentType[] = { PKCS9, 0x03 };
233 CONST_OID pkcs9MessageDigest[] = { PKCS9, 0x04 };
234 CONST_OID pkcs9SigningTime[] = { PKCS9, 0x05 };
235 CONST_OID pkcs9CounterSignature[] = { PKCS9, 0x06 };
236 CONST_OID pkcs9ChallengePassword[] = { PKCS9, 0x07 };
237 CONST_OID pkcs9UnstructuredAddress[] = { PKCS9, 0x08 };
238 CONST_OID pkcs9ExtendedCertificateAttributes[] = { PKCS9, 0x09 };
239 CONST_OID pkcs9SMIMECapabilities[] = { PKCS9, 15 };
240 CONST_OID pkcs9FriendlyName[] = { PKCS9, 20 };
241 CONST_OID pkcs9LocalKeyID[] = { PKCS9, 21 };
242
243 CONST_OID pkcs9X509Certificate[] = { PKCS9_CERT_TYPES, 1 };
244 CONST_OID pkcs9SDSICertificate[] = { PKCS9_CERT_TYPES, 2 };
245 CONST_OID pkcs9X509CRL[] = { PKCS9_CRL_TYPES, 1 };
246
247 /* RFC2630 (CMS) OIDs */
248 CONST_OID cmsESDH[] = { PKCS9_SMIME_ALGS, 5 };
249 CONST_OID cms3DESwrap[] = { PKCS9_SMIME_ALGS, 6 };
250 CONST_OID cmsRC2wrap[] = { PKCS9_SMIME_ALGS, 7 };
251
252 /* RFC2633 SMIME message attributes */
253 CONST_OID smimeEncryptionKeyPreference[] = { PKCS9_SMIME_ATTRS, 11 };
254 CONST_OID ms_smimeEncryptionKeyPreference[] = { MICROSOFT_OID, 0x10, 0x4 };
255
256 CONST_OID smimeSigningCertificate[] = { PKCS9_SMIME_ATTRS, 12 };
257 CONST_OID smimeTimeStampToken[] = { PKCS9_SMIME_ATTRS, 14 };
258 CONST_OID smimeTimeStampTokenInfo[] = { PKCS9_SMIME_CTYPE, 0x04 };
259
260 CONST_OID x520CommonName[] = { X520_ATTRIBUTE_TYPE, 3 };
261 CONST_OID x520CountryName[] = { X520_ATTRIBUTE_TYPE, 6 };
262 CONST_OID x520LocalityName[] = { X520_ATTRIBUTE_TYPE, 7 };
263 CONST_OID x520StateOrProvinceName[] = { X520_ATTRIBUTE_TYPE, 8 };
264 CONST_OID x520OrgName[] = { X520_ATTRIBUTE_TYPE, 10 };
265 CONST_OID x520OrgUnitName[] = { X520_ATTRIBUTE_TYPE, 11 };
266 CONST_OID x520DnQualifier[] = { X520_ATTRIBUTE_TYPE, 46 };
267
268 CONST_OID nsTypeGIF[] = { NETSCAPE_DATA_TYPE, 0x01 };
269 CONST_OID nsTypeJPEG[] = { NETSCAPE_DATA_TYPE, 0x02 };
270 CONST_OID nsTypeURL[] = { NETSCAPE_DATA_TYPE, 0x03 };
271 CONST_OID nsTypeHTML[] = { NETSCAPE_DATA_TYPE, 0x04 };
272 CONST_OID nsTypeCertSeq[] = { NETSCAPE_DATA_TYPE, 0x05 };
273
274 CONST_OID missiCertKEADSSOld[] = { MISSI_OLD_KEA_DSS };
275 CONST_OID missiCertDSSOld[] = { MISSI_OLD_DSS };
276 CONST_OID missiCertKEADSS[] = { MISSI_KEA_DSS };
277 CONST_OID missiCertDSS[] = { MISSI_DSS };
278 CONST_OID missiCertKEA[] = { MISSI_KEA };
279 CONST_OID missiCertAltKEA[] = { MISSI_ALT_KEA };
280 CONST_OID x500RSAEncryption[] = { X500_ALG_ENCRYPTION, 0x01 };
281
282 /* added for alg 1485 */
283 CONST_OID rfc1274Uid[] = { RFC1274_ATTR_TYPE, 1 };
284 CONST_OID rfc1274Mail[] = { RFC1274_ATTR_TYPE, 3 };
285 CONST_OID rfc2247DomainComponent[] = { RFC1274_ATTR_TYPE, 25 };
286
287 /* Netscape private certificate extensions */
288 CONST_OID nsCertExtNetscapeOK[] = { NS_CERT_EXT, 1 };
289 CONST_OID nsCertExtIssuerLogo[] = { NS_CERT_EXT, 2 };
290 CONST_OID nsCertExtSubjectLogo[] = { NS_CERT_EXT, 3 };
291 CONST_OID nsExtCertType[] = { NETSCAPE_CERT_EXT, 0x01 };
292 CONST_OID nsExtBaseURL[] = { NETSCAPE_CERT_EXT, 0x02 };
293 CONST_OID nsExtRevocationURL[] = { NETSCAPE_CERT_EXT, 0x03 };
294 CONST_OID nsExtCARevocationURL[] = { NETSCAPE_CERT_EXT, 0x04 };
295 CONST_OID nsExtCACRLURL[] = { NETSCAPE_CERT_EXT, 0x05 };
296 CONST_OID nsExtCACertURL[] = { NETSCAPE_CERT_EXT, 0x06 };
297 CONST_OID nsExtCertRenewalURL[] = { NETSCAPE_CERT_EXT, 0x07 };
298 CONST_OID nsExtCAPolicyURL[] = { NETSCAPE_CERT_EXT, 0x08 };
299 CONST_OID nsExtHomepageURL[] = { NETSCAPE_CERT_EXT, 0x09 };
300 CONST_OID nsExtEntityLogo[] = { NETSCAPE_CERT_EXT, 0x0a };
301 CONST_OID nsExtUserPicture[] = { NETSCAPE_CERT_EXT, 0x0b };
302 CONST_OID nsExtSSLServerName[] = { NETSCAPE_CERT_EXT, 0x0c };
303 CONST_OID nsExtComment[] = { NETSCAPE_CERT_EXT, 0x0d };
304
305 /* the following 2 extensions are defined for and used by Cartman(NSM) */
306 CONST_OID nsExtLostPasswordURL[] = { NETSCAPE_CERT_EXT, 0x0e };
307 CONST_OID nsExtCertRenewalTime[] = { NETSCAPE_CERT_EXT, 0x0f };
308
309 CONST_OID nsExtAIACertRenewal[] = { NETSCAPE_CERT_EXT_AIA, 0x01 };
310 CONST_OID nsExtCertScopeOfUse[] = { NETSCAPE_CERT_EXT, 0x11 };
311 /* Reserved Netscape (2 16 840 1 113730 1 18) = { NETSCAPE_CERT_EXT, 0x12 }; */
312
313 /* Netscape policy values */
314 CONST_OID nsKeyUsageGovtApproved[] = { NETSCAPE_POLICY, 0x01 };
315
316 /* Netscape other name types */
317 CONST_OID netscapeNickname[] = { NETSCAPE_NAME_COMPONENTS, 0x01};
318 /* Reserved Netscape REF605437
319 (2 16 840 1 113730 7 2) = { NETSCAPE_NAME_COMPONENTS, 0x02 }; */
320
321 /* OIDs needed for cert server */
322 CONST_OID netscapeRecoveryRequest[] = { NETSCAPE_CERT_SERVER_CRMF, 0x01 };
323
324
325 /* Standard x.509 v3 Certificate Extensions */
326 CONST_OID x509SubjectDirectoryAttr[] = { ID_CE_OID, 9 };
327 CONST_OID x509SubjectKeyID[] = { ID_CE_OID, 14 };
328 CONST_OID x509KeyUsage[] = { ID_CE_OID, 15 };
329 CONST_OID x509PrivateKeyUsagePeriod[] = { ID_CE_OID, 16 };
330 CONST_OID x509SubjectAltName[] = { ID_CE_OID, 17 };
331 CONST_OID x509IssuerAltName[] = { ID_CE_OID, 18 };
332 CONST_OID x509BasicConstraints[] = { ID_CE_OID, 19 };
333 CONST_OID x509NameConstraints[] = { ID_CE_OID, 30 };
334 CONST_OID x509CRLDistPoints[] = { ID_CE_OID, 31 };
335 CONST_OID x509CertificatePolicies[] = { ID_CE_OID, 32 };
336 CONST_OID x509PolicyMappings[] = { ID_CE_OID, 33 };
337 CONST_OID x509PolicyConstraints[] = { ID_CE_OID, 34 };
338 CONST_OID x509AuthKeyID[] = { ID_CE_OID, 35 };
339 CONST_OID x509ExtKeyUsage[] = { ID_CE_OID, 37 };
340 CONST_OID x509AuthInfoAccess[] = { PKIX_CERT_EXTENSIONS, 1 };
341
342 /* Standard x.509 v3 CRL Extensions */
343 CONST_OID x509CrlNumber[] = { ID_CE_OID, 20};
344 CONST_OID x509ReasonCode[] = { ID_CE_OID, 21};
345 CONST_OID x509InvalidDate[] = { ID_CE_OID, 24};
346
347 /* pkcs 12 additions */
348 CONST_OID pkcs12[] = { PKCS12 };
349 CONST_OID pkcs12ModeIDs[] = { PKCS12_MODE_IDS };
350 CONST_OID pkcs12ESPVKIDs[] = { PKCS12_ESPVK_IDS };
351 CONST_OID pkcs12BagIDs[] = { PKCS12_BAG_IDS };
352 CONST_OID pkcs12CertBagIDs[] = { PKCS12_CERT_BAG_IDS };
353 CONST_OID pkcs12OIDs[] = { PKCS12_OIDS };
354 CONST_OID pkcs12PBEIDs[] = { PKCS12_PBE_IDS };
355 CONST_OID pkcs12EnvelopingIDs[] = { PKCS12_ENVELOPING_IDS };
356 CONST_OID pkcs12SignatureIDs[] = { PKCS12_SIGNATURE_IDS };
357 CONST_OID pkcs12PKCS8KeyShrouding[] = { PKCS12_ESPVK_IDS, 0x01 };
358 CONST_OID pkcs12KeyBagID[] = { PKCS12_BAG_IDS, 0x01 };
359 CONST_OID pkcs12CertAndCRLBagID[] = { PKCS12_BAG_IDS, 0x02 };
360 CONST_OID pkcs12SecretBagID[] = { PKCS12_BAG_IDS, 0x03 };
361 CONST_OID pkcs12X509CertCRLBag[] = { PKCS12_CERT_BAG_IDS, 0x01 };
362 CONST_OID pkcs12SDSICertBag[] = { PKCS12_CERT_BAG_IDS, 0x02 };
363 CONST_OID pkcs12PBEWithSha1And128BitRC4[] = { PKCS12_PBE_IDS, 0x01 };
364 CONST_OID pkcs12PBEWithSha1And40BitRC4[] = { PKCS12_PBE_IDS, 0x02 };
365 CONST_OID pkcs12PBEWithSha1AndTripleDESCBC[] = { PKCS12_PBE_IDS, 0x03 };
366 CONST_OID pkcs12PBEWithSha1And128BitRC2CBC[] = { PKCS12_PBE_IDS, 0x04 };
367 CONST_OID pkcs12PBEWithSha1And40BitRC2CBC[] = { PKCS12_PBE_IDS, 0x05 };
368 CONST_OID pkcs12RSAEncryptionWith128BitRC4[] = { PKCS12_ENVELOPING_IDS, 0x01 };
369 CONST_OID pkcs12RSAEncryptionWith40BitRC4[] = { PKCS12_ENVELOPING_IDS, 0x02 };
370 CONST_OID pkcs12RSAEncryptionWithTripleDES[] = { PKCS12_ENVELOPING_IDS, 0x03 };
371 CONST_OID pkcs12RSASignatureWithSHA1Digest[] = { PKCS12_SIGNATURE_IDS, 0x01 };
372
373 /* pkcs 12 version 1.0 ids */
374 CONST_OID pkcs12V2PBEWithSha1And128BitRC4[] = { PKCS12_V2_PBE_IDS, 0x01 };
375 CONST_OID pkcs12V2PBEWithSha1And40BitRC4[] = { PKCS12_V2_PBE_IDS, 0x02 };
376 CONST_OID pkcs12V2PBEWithSha1And3KeyTripleDEScbc[]= { PKCS12_V2_PBE_IDS, 0x03 };
377 CONST_OID pkcs12V2PBEWithSha1And2KeyTripleDEScbc[]= { PKCS12_V2_PBE_IDS, 0x04 };
378 CONST_OID pkcs12V2PBEWithSha1And128BitRC2cbc[] = { PKCS12_V2_PBE_IDS, 0x05 };
379 CONST_OID pkcs12V2PBEWithSha1And40BitRC2cbc[] = { PKCS12_V2_PBE_IDS, 0x06 };
380
381 CONST_OID pkcs12SafeContentsID[] = { PKCS12_BAG_IDS, 0x04 };
382 CONST_OID pkcs12PKCS8ShroudedKeyBagID[] = { PKCS12_BAG_IDS, 0x05 };
383
384 CONST_OID pkcs12V1KeyBag[] = { PKCS12_V1_BAG_IDS, 0x01 };
385 CONST_OID pkcs12V1PKCS8ShroudedKeyBag[] = { PKCS12_V1_BAG_IDS, 0x02 };
386 CONST_OID pkcs12V1CertBag[] = { PKCS12_V1_BAG_IDS, 0x03 };
387 CONST_OID pkcs12V1CRLBag[] = { PKCS12_V1_BAG_IDS, 0x04 };
388 CONST_OID pkcs12V1SecretBag[] = { PKCS12_V1_BAG_IDS, 0x05 };
389 CONST_OID pkcs12V1SafeContentsBag[] = { PKCS12_V1_BAG_IDS, 0x06 };
390
391 CONST_OID pkcs12KeyUsageAttr[] = { 2, 5, 29, 15 };
392
393 CONST_OID ansix9DSASignature[] = { ANSI_X9_ALGORITHM, 0x01 };
394 CONST_OID ansix9DSASignaturewithSHA1Digest[] = { ANSI_X9_ALGORITHM, 0x03 };
395
396 /* verisign OIDs */
397 CONST_OID verisignUserNotices[] = { VERISIGN, 1, 7, 1, 1 };
398
399 /* pkix OIDs */
400 CONST_OID pkixCPSPointerQualifier[] = { PKIX_POLICY_QUALIFIERS, 1 };
401 CONST_OID pkixUserNoticeQualifier[] = { PKIX_POLICY_QUALIFIERS, 2 };
402
403 CONST_OID pkixOCSP[] = { PKIX_OCSP };
404 CONST_OID pkixOCSPBasicResponse[] = { PKIX_OCSP, 1 };
405 CONST_OID pkixOCSPNonce[] = { PKIX_OCSP, 2 };
406 CONST_OID pkixOCSPCRL[] = { PKIX_OCSP, 3 };
407 CONST_OID pkixOCSPResponse[] = { PKIX_OCSP, 4 };
408 CONST_OID pkixOCSPNoCheck[] = { PKIX_OCSP, 5 };
409 CONST_OID pkixOCSPArchiveCutoff[] = { PKIX_OCSP, 6 };
410 CONST_OID pkixOCSPServiceLocator[] = { PKIX_OCSP, 7 };
411
412 CONST_OID pkixRegCtrlRegToken[] = { PKIX_ID_REGCTRL, 1};
413 CONST_OID pkixRegCtrlAuthenticator[] = { PKIX_ID_REGCTRL, 2};
414 CONST_OID pkixRegCtrlPKIPubInfo[] = { PKIX_ID_REGCTRL, 3};
415 CONST_OID pkixRegCtrlPKIArchOptions[] = { PKIX_ID_REGCTRL, 4};
416 CONST_OID pkixRegCtrlOldCertID[] = { PKIX_ID_REGCTRL, 5};
417 CONST_OID pkixRegCtrlProtEncKey[] = { PKIX_ID_REGCTRL, 6};
418 CONST_OID pkixRegInfoUTF8Pairs[] = { PKIX_ID_REGINFO, 1};
419 CONST_OID pkixRegInfoCertReq[] = { PKIX_ID_REGINFO, 2};
420
421 CONST_OID pkixExtendedKeyUsageServerAuth[] = { PKIX_KEY_USAGE, 1 };
422 CONST_OID pkixExtendedKeyUsageClientAuth[] = { PKIX_KEY_USAGE, 2 };
423 CONST_OID pkixExtendedKeyUsageCodeSign[] = { PKIX_KEY_USAGE, 3 };
424 CONST_OID pkixExtendedKeyUsageEMailProtect[] = { PKIX_KEY_USAGE, 4 };
425 CONST_OID pkixExtendedKeyUsageTimeStamp[] = { PKIX_KEY_USAGE, 8 };
426 CONST_OID pkixOCSPResponderExtendedKeyUsage[] = { PKIX_KEY_USAGE, 9 };
427
428 /* OIDs for Netscape defined algorithms */
429 CONST_OID netscapeSMimeKEA[] = { NETSCAPE_ALGS, 0x01 };
430
431 /* Fortezza algorithm OIDs */
432 CONST_OID skipjackCBC[] = { FORTEZZA_ALG, 0x04 };
433 CONST_OID dhPublicKey[] = { ANSI_X942_ALGORITHM, 0x1 };
434
435 CONST_OID aes128_ECB[] = { AES, 1 };
436 CONST_OID aes128_CBC[] = { AES, 2 };
437 #ifdef DEFINE_ALL_AES_CIPHERS
438 CONST_OID aes128_OFB[] = { AES, 3 };
439 CONST_OID aes128_CFB[] = { AES, 4 };
440 #endif
441 CONST_OID aes128_KEY_WRAP[] = { AES, 5 };
442
443 CONST_OID aes192_ECB[] = { AES, 21 };
444 CONST_OID aes192_CBC[] = { AES, 22 };
445 #ifdef DEFINE_ALL_AES_CIPHERS
446 CONST_OID aes192_OFB[] = { AES, 23 };
447 CONST_OID aes192_CFB[] = { AES, 24 };
448 #endif
449 CONST_OID aes192_KEY_WRAP[] = { AES, 25 };
450
451 CONST_OID aes256_ECB[] = { AES, 41 };
452 CONST_OID aes256_CBC[] = { AES, 42 };
453 #ifdef DEFINE_ALL_AES_CIPHERS
454 CONST_OID aes256_OFB[] = { AES, 43 };
455 CONST_OID aes256_CFB[] = { AES, 44 };
456 #endif
457 CONST_OID aes256_KEY_WRAP[] = { AES, 45 };
458
459 CONST_OID sha256[] = { SHAXXX, 1 };
460 CONST_OID sha384[] = { SHAXXX, 2 };
461 CONST_OID sha512[] = { SHAXXX, 3 };
462 CONST_OID sha224[] = { SHAXXX, 4 };
463
464 CONST_OID ecdsaWithSHA1[] = { ANSI_X9_62_SIG_TYPE, 1 };
465 CONST_OID ecdsaWithSHA256[] = { ECDSA_WITH_SHA2, 2 };
466 CONST_OID ecdsaWithSHA384[] = { ECDSA_WITH_SHA2, 3 };
467 CONST_OID ecdsaWithSHA512[] = { ECDSA_WITH_SHA2, 4 };
468 CONST_OID ecPublicKey[] = { ANSI_X9_62_PUBKEY_TYPE, 1 };
469 /* This OID doesn't appear in a CMS msg */
470 __unused CONST_OID ecdsaSig[] = { ANSI_X9_62_SIG_TYPE };
471
472 /* ECDH curves */
473 CONST_OID secp256r1[] = { 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07 };
474 CONST_OID secp384r1[] = { CERTICOM_ELL_CURVE, 0x22 };
475 CONST_OID secp521r1[] = { CERTICOM_ELL_CURVE, 0x23 };
476
477 /* RFC 3278 */
478 CONST_OID dhSinglePassStdDHsha1kdf[] = {ANSI_X9_63_SCHEME, 2 };
479 __unused CONST_OID dhSinglePassCofactorDHsha1kdf[] = {ANSI_X9_63_SCHEME, 3 };
480 __unused CONST_OID mqvSinglePassSha1kdf[] = {ANSI_X9_63_SCHEME, 4 };
481
482 /* Apple Hash Agility */
483 CONST_OID appleHashAgility[] = {APPLE_CMS_ATTRIBUTES, 1};
484 CONST_OID appleHashAgilityV2[] = {APPLE_CMS_ATTRIBUTES, 2};
485
486 /* a special case: always associated with a caller-specified OID */
487 CONST_OID noOid[] = { 0 };
488
489 #define OI(x) { sizeof x, (uint8_t *)x }
490 #ifndef SECOID_NO_STRINGS
491 #if USE_CDSA_CRYPTO
492 #define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, mech, ext }
493 #else
494 #define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, ext }
495 #endif
496 #else
497 #define OD(oid,tag,desc,mech,ext) { OI(oid), tag, 0, mech, ext }
498 #endif
499
500 /*
501 NOTE: the order of these entries must match the SECOidTag enum in secoidt.h!
502 @@@ We are sticking a enum type in a field of type SecAsn1AlgId, which is
503 defined as:
504 typedef struct {
505 SecAsn1Oid algorithm;
506 SecAsn1Item parameters;
507 } SecAsn1AlgId;
508 */
509 static const SECOidData oids[] = {
510 OD( null_oid, SEC_OID_UNKNOWN, "Unknown OID", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
511 OD( md2, SEC_OID_MD2, "MD2", CSSM_ALGID_MD2, INVALID_CERT_EXTENSION ),
512 OD( md4, SEC_OID_MD4, "MD4", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
513 OD( md5, SEC_OID_MD5, "MD5", CSSM_ALGID_MD5, INVALID_CERT_EXTENSION ),
514 OD( sha1, SEC_OID_SHA1, "SHA-1", CSSM_ALGID_SHA1, INVALID_CERT_EXTENSION ),
515 OD( rc2cbc, SEC_OID_RC2_CBC,
516 "RC2-CBC", CSSM_ALGID_RC2, INVALID_CERT_EXTENSION ),
517 OD( rc4, SEC_OID_RC4, "RC4", CSSM_ALGID_RC4, INVALID_CERT_EXTENSION ),
518 OD( desede3cbc, SEC_OID_DES_EDE3_CBC,
519 "DES-EDE3-CBC", CSSM_ALGID_3DES_3KEY_EDE, INVALID_CERT_EXTENSION ),
520 OD( rc5cbcpad, SEC_OID_RC5_CBC_PAD,
521 "RC5-CBCPad", CSSM_ALGID_RC5, INVALID_CERT_EXTENSION ),
522 OD( desecb, SEC_OID_DES_ECB,
523 "DES-ECB", CSSM_ALGID_DES, INVALID_CERT_EXTENSION ),
524 OD( descbc, SEC_OID_DES_CBC,
525 "DES-CBC", CSSM_ALGID_DES, INVALID_CERT_EXTENSION ),
526 OD( desofb, SEC_OID_DES_OFB,
527 "DES-OFB", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
528 OD( descfb, SEC_OID_DES_CFB,
529 "DES-CFB", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
530 OD( desmac, SEC_OID_DES_MAC,
531 "DES-MAC", CSSM_ALGID_DES, INVALID_CERT_EXTENSION ),
532 OD( desede, SEC_OID_DES_EDE,
533 "DES-EDE", CSSM_ALGID_3DES_3KEY_EDE, INVALID_CERT_EXTENSION ),
534 OD( isoSHAWithRSASignature, SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE,
535 "ISO SHA with RSA Signature",
536 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
537 OD( pkcs1RSAEncryption, SEC_OID_PKCS1_RSA_ENCRYPTION,
538 "PKCS #1 RSA Encryption", CSSM_ALGID_RSA, INVALID_CERT_EXTENSION ),
539
540 /* the following Signing CSSM_ALGORITHMS should get new CKM_ values when
541 * values for CKM_RSA_WITH_MDX and CKM_RSA_WITH_SHA_1 get defined in
542 * PKCS #11.
543 */
544 OD( pkcs1MD2WithRSAEncryption, SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION,
545 "PKCS #1 MD2 With RSA Encryption", CSSM_ALGID_MD2WithRSA,
546 INVALID_CERT_EXTENSION ),
547 OD( pkcs1MD4WithRSAEncryption, SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION,
548 "PKCS #1 MD4 With RSA Encryption",
549 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
550 OD( pkcs1MD5WithRSAEncryption, SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION,
551 "PKCS #1 MD5 With RSA Encryption", CSSM_ALGID_MD5WithRSA,
552 INVALID_CERT_EXTENSION ),
553 OD( pkcs1SHA1WithRSAEncryption, SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION,
554 "PKCS #1 SHA-1 With RSA Encryption", CSSM_ALGID_SHA1WithRSA,
555 INVALID_CERT_EXTENSION ),
556
557 OD( pkcs5PbeWithMD2AndDEScbc, SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC,
558 "PKCS #5 Password Based Encryption with MD2 and DES CBC",
559 CSSM_ALGID_PKCS5_PBKDF1_MD2, INVALID_CERT_EXTENSION ),
560 OD( pkcs5PbeWithMD5AndDEScbc, SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC,
561 "PKCS #5 Password Based Encryption with MD5 and DES CBC",
562 CSSM_ALGID_PKCS5_PBKDF1_MD5, INVALID_CERT_EXTENSION ),
563 OD( pkcs5PbeWithSha1AndDEScbc, SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC,
564 "PKCS #5 Password Based Encryption with SHA1 and DES CBC",
565 CSSM_ALGID_PKCS5_PBKDF1_SHA1, INVALID_CERT_EXTENSION ),
566 OD( pkcs7, SEC_OID_PKCS7,
567 "PKCS #7", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
568 OD( pkcs7Data, SEC_OID_PKCS7_DATA,
569 "PKCS #7 Data", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
570 OD( pkcs7SignedData, SEC_OID_PKCS7_SIGNED_DATA,
571 "PKCS #7 Signed Data", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
572 OD( pkcs7EnvelopedData, SEC_OID_PKCS7_ENVELOPED_DATA,
573 "PKCS #7 Enveloped Data",
574 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
575 OD( pkcs7SignedEnvelopedData, SEC_OID_PKCS7_SIGNED_ENVELOPED_DATA,
576 "PKCS #7 Signed And Enveloped Data",
577 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
578 OD( pkcs7DigestedData, SEC_OID_PKCS7_DIGESTED_DATA,
579 "PKCS #7 Digested Data",
580 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
581 OD( pkcs7EncryptedData, SEC_OID_PKCS7_ENCRYPTED_DATA,
582 "PKCS #7 Encrypted Data",
583 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
584 OD( pkcs9EmailAddress, SEC_OID_PKCS9_EMAIL_ADDRESS,
585 "PKCS #9 Email Address",
586 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
587 OD( pkcs9UnstructuredName, SEC_OID_PKCS9_UNSTRUCTURED_NAME,
588 "PKCS #9 Unstructured Name",
589 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
590 OD( pkcs9ContentType, SEC_OID_PKCS9_CONTENT_TYPE,
591 "PKCS #9 Content Type",
592 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
593 OD( pkcs9MessageDigest, SEC_OID_PKCS9_MESSAGE_DIGEST,
594 "PKCS #9 Message Digest",
595 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
596 OD( pkcs9SigningTime, SEC_OID_PKCS9_SIGNING_TIME,
597 "PKCS #9 Signing Time",
598 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
599 OD( pkcs9CounterSignature, SEC_OID_PKCS9_COUNTER_SIGNATURE,
600 "PKCS #9 Counter Signature",
601 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
602 OD( pkcs9ChallengePassword, SEC_OID_PKCS9_CHALLENGE_PASSWORD,
603 "PKCS #9 Challenge Password",
604 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
605 OD( pkcs9UnstructuredAddress, SEC_OID_PKCS9_UNSTRUCTURED_ADDRESS,
606 "PKCS #9 Unstructured Address",
607 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
608 OD( pkcs9ExtendedCertificateAttributes,
609 SEC_OID_PKCS9_EXTENDED_CERTIFICATE_ATTRIBUTES,
610 "PKCS #9 Extended Certificate Attributes",
611 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
612 OD( pkcs9SMIMECapabilities, SEC_OID_PKCS9_SMIME_CAPABILITIES,
613 "PKCS #9 S/MIME Capabilities",
614 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
615 OD( x520CommonName, SEC_OID_AVA_COMMON_NAME,
616 "X520 Common Name", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
617 OD( x520CountryName, SEC_OID_AVA_COUNTRY_NAME,
618 "X520 Country Name", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
619 OD( x520LocalityName, SEC_OID_AVA_LOCALITY,
620 "X520 Locality Name", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
621 OD( x520StateOrProvinceName, SEC_OID_AVA_STATE_OR_PROVINCE,
622 "X520 State Or Province Name",
623 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
624 OD( x520OrgName, SEC_OID_AVA_ORGANIZATION_NAME,
625 "X520 Organization Name",
626 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
627 OD( x520OrgUnitName, SEC_OID_AVA_ORGANIZATIONAL_UNIT_NAME,
628 "X520 Organizational Unit Name",
629 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
630 OD( x520DnQualifier, SEC_OID_AVA_DN_QUALIFIER,
631 "X520 DN Qualifier", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
632 OD( rfc2247DomainComponent, SEC_OID_AVA_DC,
633 "RFC 2247 Domain Component",
634 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
635
636 OD( nsTypeGIF, SEC_OID_NS_TYPE_GIF,
637 "GIF", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
638 OD( nsTypeJPEG, SEC_OID_NS_TYPE_JPEG,
639 "JPEG", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
640 OD( nsTypeURL, SEC_OID_NS_TYPE_URL,
641 "URL", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
642 OD( nsTypeHTML, SEC_OID_NS_TYPE_HTML,
643 "HTML", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
644 OD( nsTypeCertSeq, SEC_OID_NS_TYPE_CERT_SEQUENCE,
645 "Certificate Sequence",
646 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
647 OD( missiCertKEADSSOld, SEC_OID_MISSI_KEA_DSS_OLD,
648 "MISSI KEA and DSS Algorithm (Old)",
649 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
650 OD( missiCertDSSOld, SEC_OID_MISSI_DSS_OLD,
651 "MISSI DSS Algorithm (Old)",
652 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
653 OD( missiCertKEADSS, SEC_OID_MISSI_KEA_DSS,
654 "MISSI KEA and DSS Algorithm",
655 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
656 OD( missiCertDSS, SEC_OID_MISSI_DSS,
657 "MISSI DSS Algorithm",
658 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
659 OD( missiCertKEA, SEC_OID_MISSI_KEA,
660 "MISSI KEA Algorithm",
661 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
662 OD( missiCertAltKEA, SEC_OID_MISSI_ALT_KEA,
663 "MISSI Alternate KEA Algorithm",
664 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
665
666 /* Netscape private extensions */
667 OD( nsCertExtNetscapeOK, SEC_OID_NS_CERT_EXT_NETSCAPE_OK,
668 "Netscape says this cert is OK",
669 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
670 OD( nsCertExtIssuerLogo, SEC_OID_NS_CERT_EXT_ISSUER_LOGO,
671 "Certificate Issuer Logo",
672 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
673 OD( nsCertExtSubjectLogo, SEC_OID_NS_CERT_EXT_SUBJECT_LOGO,
674 "Certificate Subject Logo",
675 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
676 OD( nsExtCertType, SEC_OID_NS_CERT_EXT_CERT_TYPE,
677 "Certificate Type",
678 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
679 OD( nsExtBaseURL, SEC_OID_NS_CERT_EXT_BASE_URL,
680 "Certificate Extension Base URL",
681 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
682 OD( nsExtRevocationURL, SEC_OID_NS_CERT_EXT_REVOCATION_URL,
683 "Certificate Revocation URL",
684 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
685 OD( nsExtCARevocationURL, SEC_OID_NS_CERT_EXT_CA_REVOCATION_URL,
686 "Certificate Authority Revocation URL",
687 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
688 OD( nsExtCACRLURL, SEC_OID_NS_CERT_EXT_CA_CRL_URL,
689 "Certificate Authority CRL Download URL",
690 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
691 OD( nsExtCACertURL, SEC_OID_NS_CERT_EXT_CA_CERT_URL,
692 "Certificate Authority Certificate Download URL",
693 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
694 OD( nsExtCertRenewalURL, SEC_OID_NS_CERT_EXT_CERT_RENEWAL_URL,
695 "Certificate Renewal URL",
696 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
697 OD( nsExtCAPolicyURL, SEC_OID_NS_CERT_EXT_CA_POLICY_URL,
698 "Certificate Authority Policy URL",
699 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
700 OD( nsExtHomepageURL, SEC_OID_NS_CERT_EXT_HOMEPAGE_URL,
701 "Certificate Homepage URL",
702 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
703 OD( nsExtEntityLogo, SEC_OID_NS_CERT_EXT_ENTITY_LOGO,
704 "Certificate Entity Logo",
705 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
706 OD( nsExtUserPicture, SEC_OID_NS_CERT_EXT_USER_PICTURE,
707 "Certificate User Picture",
708 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
709 OD( nsExtSSLServerName, SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME,
710 "Certificate SSL Server Name",
711 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
712 OD( nsExtComment, SEC_OID_NS_CERT_EXT_COMMENT,
713 "Certificate Comment",
714 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
715 OD( nsExtLostPasswordURL, SEC_OID_NS_CERT_EXT_LOST_PASSWORD_URL,
716 "Lost Password URL",
717 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
718 OD( nsExtCertRenewalTime, SEC_OID_NS_CERT_EXT_CERT_RENEWAL_TIME,
719 "Certificate Renewal Time",
720 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
721 OD( nsKeyUsageGovtApproved, SEC_OID_NS_KEY_USAGE_GOVT_APPROVED,
722 "Strong Crypto Export Approved",
723 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
724
725
726 /* x.509 v3 certificate extensions */
727 OD( x509SubjectDirectoryAttr, SEC_OID_X509_SUBJECT_DIRECTORY_ATTR,
728 "Certificate Subject Directory Attributes",
729 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION),
730 OD( x509SubjectKeyID, SEC_OID_X509_SUBJECT_KEY_ID,
731 "Certificate Subject Key ID",
732 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
733 OD( x509KeyUsage, SEC_OID_X509_KEY_USAGE,
734 "Certificate Key Usage",
735 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
736 OD( x509PrivateKeyUsagePeriod, SEC_OID_X509_PRIVATE_KEY_USAGE_PERIOD,
737 "Certificate Private Key Usage Period",
738 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
739 OD( x509SubjectAltName, SEC_OID_X509_SUBJECT_ALT_NAME,
740 "Certificate Subject Alt Name",
741 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
742 OD( x509IssuerAltName, SEC_OID_X509_ISSUER_ALT_NAME,
743 "Certificate Issuer Alt Name",
744 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
745 OD( x509BasicConstraints, SEC_OID_X509_BASIC_CONSTRAINTS,
746 "Certificate Basic Constraints",
747 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
748 OD( x509NameConstraints, SEC_OID_X509_NAME_CONSTRAINTS,
749 "Certificate Name Constraints",
750 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
751 OD( x509CRLDistPoints, SEC_OID_X509_CRL_DIST_POINTS,
752 "CRL Distribution Points",
753 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
754 OD( x509CertificatePolicies, SEC_OID_X509_CERTIFICATE_POLICIES,
755 "Certificate Policies",
756 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
757 OD( x509PolicyMappings, SEC_OID_X509_POLICY_MAPPINGS,
758 "Certificate Policy Mappings",
759 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
760 OD( x509PolicyConstraints, SEC_OID_X509_POLICY_CONSTRAINTS,
761 "Certificate Policy Constraints",
762 CSSM_ALGID_NONE, UNSUPPORTED_CERT_EXTENSION ),
763 OD( x509AuthKeyID, SEC_OID_X509_AUTH_KEY_ID,
764 "Certificate Authority Key Identifier",
765 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
766 OD( x509ExtKeyUsage, SEC_OID_X509_EXT_KEY_USAGE,
767 "Extended Key Usage",
768 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
769 OD( x509AuthInfoAccess, SEC_OID_X509_AUTH_INFO_ACCESS,
770 "Authority Information Access",
771 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
772
773 /* x.509 v3 CRL extensions */
774 OD( x509CrlNumber, SEC_OID_X509_CRL_NUMBER,
775 "CRL Number", CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
776 OD( x509ReasonCode, SEC_OID_X509_REASON_CODE,
777 "CRL reason code", CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
778 OD( x509InvalidDate, SEC_OID_X509_INVALID_DATE,
779 "Invalid Date", CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
780 OD( x500RSAEncryption, SEC_OID_X500_RSA_ENCRYPTION,
781 "X500 RSA Encryption", CSSM_ALGID_RSA, INVALID_CERT_EXTENSION ),
782 /* added for alg 1485 */
783 OD( rfc1274Uid, SEC_OID_RFC1274_UID,
784 "RFC1274 User Id", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
785 OD( rfc1274Mail, SEC_OID_RFC1274_MAIL,
786 "RFC1274 E-mail Address",
787 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
788
789 /* pkcs 12 additions */
790 OD( pkcs12, SEC_OID_PKCS12,
791 "PKCS #12", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
792 OD( pkcs12ModeIDs, SEC_OID_PKCS12_MODE_IDS,
793 "PKCS #12 Mode IDs", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
794 OD( pkcs12ESPVKIDs, SEC_OID_PKCS12_ESPVK_IDS,
795 "PKCS #12 ESPVK IDs", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
796 OD( pkcs12BagIDs, SEC_OID_PKCS12_BAG_IDS,
797 "PKCS #12 Bag IDs", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
798 OD( pkcs12CertBagIDs, SEC_OID_PKCS12_CERT_BAG_IDS,
799 "PKCS #12 Cert Bag IDs",
800 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
801 OD( pkcs12OIDs, SEC_OID_PKCS12_OIDS,
802 "PKCS #12 OIDs", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
803 OD( pkcs12PBEIDs, SEC_OID_PKCS12_PBE_IDS,
804 "PKCS #12 PBE IDs", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
805 OD( pkcs12SignatureIDs, SEC_OID_PKCS12_SIGNATURE_IDS,
806 "PKCS #12 Signature IDs",
807 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
808 OD( pkcs12EnvelopingIDs, SEC_OID_PKCS12_ENVELOPING_IDS,
809 "PKCS #12 Enveloping IDs",
810 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
811 OD( pkcs12PKCS8KeyShrouding, SEC_OID_PKCS12_PKCS8_KEY_SHROUDING,
812 "PKCS #12 Key Shrouding",
813 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
814 OD( pkcs12KeyBagID, SEC_OID_PKCS12_KEY_BAG_ID,
815 "PKCS #12 Key Bag ID",
816 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
817 OD( pkcs12CertAndCRLBagID, SEC_OID_PKCS12_CERT_AND_CRL_BAG_ID,
818 "PKCS #12 Cert And CRL Bag ID",
819 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
820 OD( pkcs12SecretBagID, SEC_OID_PKCS12_SECRET_BAG_ID,
821 "PKCS #12 Secret Bag ID",
822 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
823 OD( pkcs12X509CertCRLBag, SEC_OID_PKCS12_X509_CERT_CRL_BAG,
824 "PKCS #12 X509 Cert CRL Bag",
825 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
826 OD( pkcs12SDSICertBag, SEC_OID_PKCS12_SDSI_CERT_BAG,
827 "PKCS #12 SDSI Cert Bag",
828 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
829 OD( pkcs12PBEWithSha1And128BitRC4,
830 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC4,
831 "PKCS #12 PBE With Sha1 and 128 Bit RC4",
832 CSSM_ALGID_PKCS12_SHA1_PBE, INVALID_CERT_EXTENSION ),
833 OD( pkcs12PBEWithSha1And40BitRC4,
834 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC4,
835 "PKCS #12 PBE With Sha1 and 40 Bit RC4",
836 CSSM_ALGID_PKCS12_SHA1_PBE, INVALID_CERT_EXTENSION ),
837 OD( pkcs12PBEWithSha1AndTripleDESCBC,
838 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_TRIPLE_DES_CBC,
839 "PKCS #12 PBE With Sha1 and Triple DES CBC",
840 CSSM_ALGID_PKCS12_SHA1_PBE, INVALID_CERT_EXTENSION ),
841 OD( pkcs12PBEWithSha1And128BitRC2CBC,
842 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC,
843 "PKCS #12 PBE With Sha1 and 128 Bit RC2 CBC",
844 CSSM_ALGID_PKCS12_SHA1_PBE, INVALID_CERT_EXTENSION ),
845 OD( pkcs12PBEWithSha1And40BitRC2CBC,
846 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC,
847 "PKCS #12 PBE With Sha1 and 40 Bit RC2 CBC",
848 CSSM_ALGID_PKCS12_SHA1_PBE, INVALID_CERT_EXTENSION ),
849 OD( pkcs12RSAEncryptionWith128BitRC4,
850 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_128_BIT_RC4,
851 "PKCS #12 RSA Encryption with 128 Bit RC4",
852 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
853 OD( pkcs12RSAEncryptionWith40BitRC4,
854 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_40_BIT_RC4,
855 "PKCS #12 RSA Encryption with 40 Bit RC4",
856 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
857 OD( pkcs12RSAEncryptionWithTripleDES,
858 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_TRIPLE_DES,
859 "PKCS #12 RSA Encryption with Triple DES",
860 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
861 OD( pkcs12RSASignatureWithSHA1Digest,
862 SEC_OID_PKCS12_RSA_SIGNATURE_WITH_SHA1_DIGEST,
863 "PKCS #12 RSA Encryption with Triple DES",
864 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
865
866 /* DSA signatures */
867 OD( ansix9DSASignature, SEC_OID_ANSIX9_DSA_SIGNATURE,
868 "ANSI X9.57 DSA Signature", CSSM_ALGID_DSA, INVALID_CERT_EXTENSION ),
869 OD( ansix9DSASignaturewithSHA1Digest,
870 SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST,
871 "ANSI X9.57 DSA Signature with SHA1 Digest",
872 CSSM_ALGID_SHA1WithDSA, INVALID_CERT_EXTENSION ),
873 OD( bogusDSASignaturewithSHA1Digest,
874 SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST,
875 "FORTEZZA DSA Signature with SHA1 Digest",
876 CSSM_ALGID_SHA1WithDSA, INVALID_CERT_EXTENSION ),
877
878 /* verisign oids */
879 OD( verisignUserNotices, SEC_OID_VERISIGN_USER_NOTICES,
880 "Verisign User Notices",
881 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
882
883 /* pkix oids */
884 OD( pkixCPSPointerQualifier, SEC_OID_PKIX_CPS_POINTER_QUALIFIER,
885 "PKIX CPS Pointer Qualifier",
886 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
887 OD( pkixUserNoticeQualifier, SEC_OID_PKIX_USER_NOTICE_QUALIFIER,
888 "PKIX User Notice Qualifier",
889 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
890
891 OD( pkixOCSP, SEC_OID_PKIX_OCSP,
892 "PKIX Online Certificate Status Protocol",
893 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
894 OD( pkixOCSPBasicResponse, SEC_OID_PKIX_OCSP_BASIC_RESPONSE,
895 "OCSP Basic Response", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
896 OD( pkixOCSPNonce, SEC_OID_PKIX_OCSP_NONCE,
897 "OCSP Nonce Extension", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
898 OD( pkixOCSPCRL, SEC_OID_PKIX_OCSP_CRL,
899 "OCSP CRL Reference Extension",
900 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
901 OD( pkixOCSPResponse, SEC_OID_PKIX_OCSP_RESPONSE,
902 "OCSP Response Types Extension",
903 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
904 OD( pkixOCSPNoCheck, SEC_OID_PKIX_OCSP_NO_CHECK,
905 "OCSP No Check Extension",
906 CSSM_ALGID_NONE, SUPPORTED_CERT_EXTENSION ),
907 OD( pkixOCSPArchiveCutoff, SEC_OID_PKIX_OCSP_ARCHIVE_CUTOFF,
908 "OCSP Archive Cutoff Extension",
909 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
910 OD( pkixOCSPServiceLocator, SEC_OID_PKIX_OCSP_SERVICE_LOCATOR,
911 "OCSP Service Locator Extension",
912 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
913
914 OD( pkixRegCtrlRegToken, SEC_OID_PKIX_REGCTRL_REGTOKEN,
915 "PKIX CRMF Registration Control, Registration Token",
916 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
917 OD( pkixRegCtrlAuthenticator, SEC_OID_PKIX_REGCTRL_AUTHENTICATOR,
918 "PKIX CRMF Registration Control, Registration Authenticator",
919 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
920 OD( pkixRegCtrlPKIPubInfo, SEC_OID_PKIX_REGCTRL_PKIPUBINFO,
921 "PKIX CRMF Registration Control, PKI Publication Info",
922 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
923 OD( pkixRegCtrlPKIArchOptions,
924 SEC_OID_PKIX_REGCTRL_PKI_ARCH_OPTIONS,
925 "PKIX CRMF Registration Control, PKI Archive Options",
926 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
927 OD( pkixRegCtrlOldCertID, SEC_OID_PKIX_REGCTRL_OLD_CERT_ID,
928 "PKIX CRMF Registration Control, Old Certificate ID",
929 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
930 OD( pkixRegCtrlProtEncKey, SEC_OID_PKIX_REGCTRL_PROTOCOL_ENC_KEY,
931 "PKIX CRMF Registration Control, Protocol Encryption Key",
932 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
933 OD( pkixRegInfoUTF8Pairs, SEC_OID_PKIX_REGINFO_UTF8_PAIRS,
934 "PKIX CRMF Registration Info, UTF8 Pairs",
935 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
936 OD( pkixRegInfoCertReq, SEC_OID_PKIX_REGINFO_CERT_REQUEST,
937 "PKIX CRMF Registration Info, Certificate Request",
938 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
939 OD( pkixExtendedKeyUsageServerAuth,
940 SEC_OID_EXT_KEY_USAGE_SERVER_AUTH,
941 "TLS Web Server Authentication Certificate",
942 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
943 OD( pkixExtendedKeyUsageClientAuth,
944 SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH,
945 "TLS Web Client Authentication Certificate",
946 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
947 OD( pkixExtendedKeyUsageCodeSign, SEC_OID_EXT_KEY_USAGE_CODE_SIGN,
948 "Code Signing Certificate",
949 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
950 OD( pkixExtendedKeyUsageEMailProtect,
951 SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT,
952 "E-Mail Protection Certificate",
953 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
954 OD( pkixExtendedKeyUsageTimeStamp,
955 SEC_OID_EXT_KEY_USAGE_TIME_STAMP,
956 "Time Stamping Certifcate",
957 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
958 OD( pkixOCSPResponderExtendedKeyUsage, SEC_OID_OCSP_RESPONDER,
959 "OCSP Responder Certificate",
960 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
961
962 /* Netscape Algorithm OIDs */
963
964 OD( netscapeSMimeKEA, SEC_OID_NETSCAPE_SMIME_KEA,
965 "Netscape S/MIME KEA", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
966 /* Skipjack OID -- ### mwelch temporary */
967 OD( skipjackCBC, SEC_OID_FORTEZZA_SKIPJACK,
968 "Skipjack CBC64", CSSM_ALGID_SKIPJACK, INVALID_CERT_EXTENSION ),
969 /* pkcs12 v2 oids */
970 OD( pkcs12V2PBEWithSha1And128BitRC4,
971 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4,
972 "PKCS12 V2 PBE With SHA1 And 128 Bit RC4",
973 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
974 OD( pkcs12V2PBEWithSha1And40BitRC4,
975 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4,
976 "PKCS12 V2 PBE With SHA1 And 40 Bit RC4",
977 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
978 OD( pkcs12V2PBEWithSha1And3KeyTripleDEScbc,
979 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC,
980 "PKCS12 V2 PBE With SHA1 And 3KEY Triple DES-cbc",
981 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
982 OD( pkcs12V2PBEWithSha1And2KeyTripleDEScbc,
983 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_2KEY_TRIPLE_DES_CBC,
984 "PKCS12 V2 PBE With SHA1 And 2KEY Triple DES-cbc",
985 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
986 OD( pkcs12V2PBEWithSha1And128BitRC2cbc,
987 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC,
988 "PKCS12 V2 PBE With SHA1 And 128 Bit RC2 CBC",
989 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
990 OD( pkcs12V2PBEWithSha1And40BitRC2cbc,
991 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC,
992 "PKCS12 V2 PBE With SHA1 And 40 Bit RC2 CBC",
993 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
994 OD( pkcs12SafeContentsID, SEC_OID_PKCS12_SAFE_CONTENTS_ID,
995 "PKCS #12 Safe Contents ID",
996 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
997 OD( pkcs12PKCS8ShroudedKeyBagID,
998 SEC_OID_PKCS12_PKCS8_SHROUDED_KEY_BAG_ID,
999 "PKCS #12 Safe Contents ID",
1000 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1001 OD( pkcs12V1KeyBag, SEC_OID_PKCS12_V1_KEY_BAG_ID,
1002 "PKCS #12 V1 Key Bag",
1003 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1004 OD( pkcs12V1PKCS8ShroudedKeyBag,
1005 SEC_OID_PKCS12_V1_PKCS8_SHROUDED_KEY_BAG_ID,
1006 "PKCS #12 V1 PKCS8 Shrouded Key Bag",
1007 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1008 OD( pkcs12V1CertBag, SEC_OID_PKCS12_V1_CERT_BAG_ID,
1009 "PKCS #12 V1 Cert Bag",
1010 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1011 OD( pkcs12V1CRLBag, SEC_OID_PKCS12_V1_CRL_BAG_ID,
1012 "PKCS #12 V1 CRL Bag",
1013 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1014 OD( pkcs12V1SecretBag, SEC_OID_PKCS12_V1_SECRET_BAG_ID,
1015 "PKCS #12 V1 Secret Bag",
1016 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1017 OD( pkcs12V1SafeContentsBag, SEC_OID_PKCS12_V1_SAFE_CONTENTS_BAG_ID,
1018 "PKCS #12 V1 Safe Contents Bag",
1019 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1020
1021 OD( pkcs9X509Certificate, SEC_OID_PKCS9_X509_CERT,
1022 "PKCS #9 X509 Certificate",
1023 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1024 OD( pkcs9SDSICertificate, SEC_OID_PKCS9_SDSI_CERT,
1025 "PKCS #9 SDSI Certificate",
1026 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1027 OD( pkcs9X509CRL, SEC_OID_PKCS9_X509_CRL,
1028 "PKCS #9 X509 CRL", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1029 OD( pkcs9FriendlyName, SEC_OID_PKCS9_FRIENDLY_NAME,
1030 "PKCS #9 Friendly Name",
1031 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1032 OD( pkcs9LocalKeyID, SEC_OID_PKCS9_LOCAL_KEY_ID,
1033 "PKCS #9 Local Key ID",
1034 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1035 OD( pkcs12KeyUsageAttr, SEC_OID_PKCS12_KEY_USAGE,
1036 "PKCS 12 Key Usage", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1037 OD( dhPublicKey, SEC_OID_X942_DIFFIE_HELMAN_KEY,
1038 "Diffie-Helman Public Key", CSSM_ALGID_DH,
1039 INVALID_CERT_EXTENSION ),
1040 OD( netscapeNickname, SEC_OID_NETSCAPE_NICKNAME,
1041 "Netscape Nickname", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1042
1043 /* Cert Server specific OIDs */
1044 OD( netscapeRecoveryRequest, SEC_OID_NETSCAPE_RECOVERY_REQUEST,
1045 "Recovery Request OID",
1046 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1047
1048 OD( nsExtAIACertRenewal, SEC_OID_CERT_RENEWAL_LOCATOR,
1049 "Certificate Renewal Locator OID", CSSM_ALGID_NONE,
1050 INVALID_CERT_EXTENSION ),
1051
1052 OD( nsExtCertScopeOfUse, SEC_OID_NS_CERT_EXT_SCOPE_OF_USE,
1053 "Certificate Scope-of-Use Extension", CSSM_ALGID_NONE,
1054 SUPPORTED_CERT_EXTENSION ),
1055
1056 /* CMS stuff */
1057 OD( cmsESDH, SEC_OID_CMS_EPHEMERAL_STATIC_DIFFIE_HELLMAN,
1058 "Ephemeral-Static Diffie-Hellman", CSSM_ALGID_NONE /* XXX */,
1059 INVALID_CERT_EXTENSION ),
1060 OD( cms3DESwrap, SEC_OID_CMS_3DES_KEY_WRAP,
1061 "CMS 3DES Key Wrap", CSSM_ALGID_NONE /* XXX */,
1062 INVALID_CERT_EXTENSION ),
1063 OD( cmsRC2wrap, SEC_OID_CMS_RC2_KEY_WRAP,
1064 "CMS RC2 Key Wrap", CSSM_ALGID_NONE /* XXX */,
1065 INVALID_CERT_EXTENSION ),
1066 OD( smimeEncryptionKeyPreference, SEC_OID_SMIME_ENCRYPTION_KEY_PREFERENCE,
1067 "S/MIME Encryption Key Preference",
1068 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1069
1070 /* AES algorithm OIDs */
1071 OD( aes128_ECB, SEC_OID_AES_128_ECB,
1072 "AES-128-ECB", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1073 OD( aes128_CBC, SEC_OID_AES_128_CBC,
1074 "AES-128-CBC", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1075 OD( aes192_ECB, SEC_OID_AES_192_ECB,
1076 "AES-192-ECB", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1077 OD( aes192_CBC, SEC_OID_AES_192_CBC,
1078 "AES-192-CBC", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1079 OD( aes256_ECB, SEC_OID_AES_256_ECB,
1080 "AES-256-ECB", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1081 OD( aes256_CBC, SEC_OID_AES_256_CBC,
1082 "AES-256-CBC", CSSM_ALGID_AES, INVALID_CERT_EXTENSION ),
1083
1084 /* More bogus DSA OIDs */
1085 OD( sdn702DSASignature, SEC_OID_SDN702_DSA_SIGNATURE,
1086 "SDN.702 DSA Signature", CSSM_ALGID_SHA1WithDSA, INVALID_CERT_EXTENSION ),
1087
1088 OD( ms_smimeEncryptionKeyPreference,
1089 SEC_OID_MS_SMIME_ENCRYPTION_KEY_PREFERENCE,
1090 "Microsoft S/MIME Encryption Key Preference",
1091 CSSM_ALGID_NONE, INVALID_CERT_EXTENSION ),
1092
1093 OD( sha224, SEC_OID_SHA224, "SHA-224", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1094 OD( sha256, SEC_OID_SHA256, "SHA-256", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1095 OD( sha384, SEC_OID_SHA384, "SHA-384", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1096 OD( sha512, SEC_OID_SHA512, "SHA-512", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1097
1098 OD( pkcs1SHA256WithRSAEncryption, SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION,
1099 "PKCS #1 SHA-256 With RSA Encryption", CSSM_ALGID_NONE,
1100 INVALID_CERT_EXTENSION ),
1101 OD( pkcs1SHA384WithRSAEncryption, SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION,
1102 "PKCS #1 SHA-384 With RSA Encryption", CSSM_ALGID_NONE,
1103 INVALID_CERT_EXTENSION ),
1104 OD( pkcs1SHA512WithRSAEncryption, SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION,
1105 "PKCS #1 SHA-512 With RSA Encryption", CSSM_ALGID_NONE,
1106 INVALID_CERT_EXTENSION ),
1107
1108 OD( aes128_KEY_WRAP, SEC_OID_AES_128_KEY_WRAP,
1109 "AES-128 Key Wrap", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1110 OD( aes192_KEY_WRAP, SEC_OID_AES_192_KEY_WRAP,
1111 "AES-192 Key Wrap", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1112 OD( aes256_KEY_WRAP, SEC_OID_AES_256_KEY_WRAP,
1113 "AES-256 Key Wrap", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1114
1115 /* caller-specified OID for eContentType */
1116 OD( noOid, SEC_OID_OTHER,
1117 "Caller-specified eContentType", CSSM_ALGID_NONE, INVALID_CERT_EXTENSION),
1118
1119 OD( ecPublicKey, SEC_OID_EC_PUBLIC_KEY,
1120 "ECDSA Public Key", CSSM_ALGID_NONE,
1121 INVALID_CERT_EXTENSION ),
1122 OD( ecdsaWithSHA1, SEC_OID_ECDSA_WithSHA1,
1123 "SHA-1 With ECDSA", CSSM_ALGID_NONE,
1124 INVALID_CERT_EXTENSION ),
1125 OD( dhSinglePassStdDHsha1kdf, SEC_OID_DH_SINGLE_STD_SHA1KDF,
1126 "ECDH With SHA1 KDF", CSSM_ALGID_NONE,
1127 INVALID_CERT_EXTENSION ),
1128 OD( secp256r1, SEC_OID_SECP_256_R1,
1129 "secp256r1", CSSM_ALGID_NONE,
1130 INVALID_CERT_EXTENSION ),
1131 OD( secp384r1, SEC_OID_SECP_384_R1,
1132 "secp384r1", CSSM_ALGID_NONE,
1133 INVALID_CERT_EXTENSION ),
1134 OD( secp521r1, SEC_OID_SECP_521_R1,
1135 "secp521r1", CSSM_ALGID_NONE,
1136 INVALID_CERT_EXTENSION ),
1137
1138 OD( smimeTimeStampTokenInfo, SEC_OID_PKCS9_ID_CT_TSTInfo,
1139 "id-ct-TSTInfo", CSSM_ALGID_NONE,
1140 INVALID_CERT_EXTENSION ),
1141
1142 OD( smimeTimeStampToken, SEC_OID_PKCS9_TIMESTAMP_TOKEN,
1143 "id-aa-timeStampToken", CSSM_ALGID_NONE,
1144 INVALID_CERT_EXTENSION ),
1145
1146 OD( smimeSigningCertificate, SEC_OID_PKCS9_SIGNING_CERTIFICATE,
1147 "id-aa-signing-certificate", CSSM_ALGID_NONE,
1148 INVALID_CERT_EXTENSION ),
1149
1150 /* ECDSA with SHA2 */
1151 OD( ecdsaWithSHA256, SEC_OID_ECDSA_WITH_SHA256,
1152 "ECDSA With SHA-256", CSSM_ALGID_SHA256WithECDSA,
1153 INVALID_CERT_EXTENSION ),
1154 OD( ecdsaWithSHA384, SEC_OID_ECDSA_WITH_SHA384,
1155 "ECDSA With SHA-384", CSSM_ALGID_SHA384WithECDSA,
1156 INVALID_CERT_EXTENSION ),
1157 OD( ecdsaWithSHA512, SEC_OID_ECDSA_WITH_SHA512,
1158 "ECDSA With SHA-512", CSSM_ALGID_SHA512WithECDSA,
1159 INVALID_CERT_EXTENSION ),
1160
1161 /* Apple Hash Agility */
1162 OD( appleHashAgility, SEC_OID_APPLE_HASH_AGILITY,
1163 "appleCodesigningHashAgilityAttribute", CSSM_ALGID_NONE,
1164 INVALID_CERT_EXTENSION),
1165 OD( appleHashAgilityV2, SEC_OID_APPLE_HASH_AGILITY_V2,
1166 "appleCodesigningHashAgilityAttributeV2", CSSM_ALGID_NONE,
1167 INVALID_CERT_EXTENSION),
1168
1169 };
1170
1171 /*
1172 * now the dynamic table. The dynamic table gets build at init time.
1173 * and gets modified if the user loads new crypto modules.
1174 */
1175
1176 #if 0 /* disabled since its not used (the only function that could "add" items was disabled before */
1177
1178 // TODO: protect this: used multi-threaded
1179 static PLHashTable *oid_d_hash = 0;
1180 static SECOidData **secoidDynamicTable = NULL;
1181 static int secoidDynamicTableSize = 0;
1182 static int secoidLastDynamicEntry = 0;
1183 static int secoidLastHashEntry = 0;
1184
1185 static SECStatus
1186 secoid_DynamicRehash(void)
1187 {
1188 SECOidData *oid;
1189 PLHashEntry *entry;
1190 int i;
1191 int last = secoidLastDynamicEntry;
1192
1193 if (!oid_d_hash) {
1194 oid_d_hash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
1195 PL_CompareValues, NULL, NULL);
1196 }
1197
1198
1199 if ( !oid_d_hash ) {
1200 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1201 return(SECFailure);
1202 }
1203
1204 for ( i = secoidLastHashEntry; i < last; i++ ) {
1205 oid = secoidDynamicTable[i];
1206
1207 entry = PL_HashTableAdd( oid_d_hash, &oid->oid, oid );
1208 if ( entry == NULL ) {
1209 return(SECFailure);
1210 }
1211 }
1212 secoidLastHashEntry = last;
1213 return(SECSuccess);
1214 }
1215
1216
1217
1218 /*
1219 * Lookup a Dynamic OID. Dynamic OID's still change slowly, so it's
1220 * cheaper to rehash the table when it changes than it is to do the loop
1221 * each time. Worry: what about thread safety here? Global Static data with
1222 * no locks.... (sigh).
1223 */
1224 static SECOidData *
1225 secoid_FindDynamic(const SecAsn1Item *key) {
1226 SECOidData *ret = NULL;
1227 if (secoidDynamicTable == NULL) {
1228 /* PORT_SetError! */
1229 return NULL;
1230 }
1231 if (secoidLastHashEntry != secoidLastDynamicEntry) {
1232 SECStatus rv = secoid_DynamicRehash();
1233 if ( rv != SECSuccess ) {
1234 return NULL;
1235 }
1236 }
1237 ret = (SECOidData *)PL_HashTableLookup (oid_d_hash, key);
1238 return ret;
1239
1240 }
1241
1242 static SECOidData *
1243 secoid_FindDynamicByTag(SECOidTag tagnum)
1244 {
1245 int tagNumDiff;
1246
1247 if (secoidDynamicTable == NULL) {
1248 return NULL;
1249 }
1250
1251 if (tagnum < SEC_OID_TOTAL) {
1252 return NULL;
1253 }
1254
1255 tagNumDiff = tagnum - SEC_OID_TOTAL;
1256 if (tagNumDiff >= secoidLastDynamicEntry) {
1257 return NULL;
1258 }
1259
1260 return(secoidDynamicTable[tagNumDiff]);
1261 }
1262
1263 /*
1264 * this routine is definately not thread safe. It is only called out
1265 * of the UI, or at init time. If we want to call it any other time,
1266 * we need to make it thread safe.
1267 */
1268 SECStatus
1269 SECOID_AddEntry(SecAsn1Item *oid, char *description, SecAsn1AlgId cssmAlgorithm) {
1270 SECOidData *oiddp = (SECOidData *)PORT_Alloc(sizeof(SECOidData));
1271 int last = secoidLastDynamicEntry;
1272 int tableSize = secoidDynamicTableSize;
1273 int next = last++;
1274 SECOidData **newTable = secoidDynamicTable;
1275 SECOidData **oldTable = NULL;
1276
1277 if (oid == NULL) {
1278 return SECFailure;
1279 }
1280
1281 /* fill in oid structure */
1282 if (SECITEM_CopyItem(NULL,&oiddp->oid,oid) != SECSuccess) {
1283 PORT_Free(oiddp);
1284 return SECFailure;
1285 }
1286 oiddp->offset = (SECOidTag)(next + SEC_OID_TOTAL);
1287 /* may we should just reference the copy passed to us? */
1288 oiddp->desc = PORT_Strdup(description);
1289 oiddp->cssmAlgorithm = cssmAlgorithm;
1290
1291
1292 if (last > tableSize) {
1293 int oldTableSize = tableSize;
1294 tableSize += 10;
1295 oldTable = newTable;
1296 newTable = (SECOidData **)PORT_ZAlloc(sizeof(SECOidData *)*tableSize);
1297 if (newTable == NULL) {
1298 PORT_Free(oiddp->oid.Data);
1299 PORT_Free(oiddp);
1300 return SECFailure;
1301 }
1302 PORT_Memcpy(newTable,oldTable,sizeof(SECOidData *)*oldTableSize);
1303 PORT_Free(oldTable);
1304 }
1305
1306 newTable[next] = oiddp;
1307 secoidDynamicTable = newTable;
1308 secoidDynamicTableSize = tableSize;
1309 secoidLastDynamicEntry= last;
1310 return SECSuccess;
1311 }
1312 #endif
1313
1314 /* normal static table processing */
1315
1316 /* TODO: MORE GLOBAL DATA */
1317 static pthread_once_t hash_once = PTHREAD_ONCE_INIT;
1318 static PLHashTable *oidhash = NULL;
1319 static PLHashTable *oidmechhash = NULL;
1320
1321 static PLHashNumber
1322 secoid_HashNumber(const void *key)
1323 {
1324 /* This truncate the hash to the lower 32 bits -- probably safe right ??? */
1325 return (PLHashNumber)(PRUword)key;
1326 }
1327
1328
1329 static SECStatus
1330 InitOIDHash(void)
1331 {
1332 PLHashEntry *entry;
1333 const SECOidData *oid;
1334 size_t ix;
1335
1336 oidhash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
1337 PL_CompareValues, NULL, NULL);
1338 oidmechhash = PL_NewHashTable(0, secoid_HashNumber, PL_CompareValues,
1339 PL_CompareValues, NULL, NULL);
1340
1341 if ( !oidhash || !oidmechhash) {
1342 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1343 PORT_Assert(0); /*This function should never fail. */
1344 return(SECFailure);
1345 }
1346
1347 for ( ix = 0; ix < ( sizeof(oids) / sizeof(SECOidData) ); ix++ ) {
1348 oid = &oids[ix];
1349
1350 PORT_Assert ( oid->offset == ix );
1351
1352 entry = PL_HashTableAdd( oidhash, &oid->oid, (void *)oid );
1353 if ( entry == NULL ) {
1354 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1355 PORT_Assert(0); /*This function should never fail. */
1356 return(SECFailure);
1357 }
1358
1359 #if USE_CDSA_CRYPTO
1360 if ( oid->cssmAlgorithm.algorithm.Length /*CSSM_ALGID_NONE*/ ) {
1361 entry = PL_HashTableAdd( oidmechhash,
1362 (void *)&(oid->cssmAlgorithm), (void *)oid );
1363 if ( entry == NULL ) {
1364 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1365 PORT_Assert(0); /* This function should never fail. */
1366 return(SECFailure);
1367 }
1368 }
1369 #endif
1370 }
1371
1372 PORT_Assert (ix == SEC_OID_TOTAL);
1373
1374 return(SECSuccess);
1375 }
1376
1377 static void InitOIDHashOnce()
1378 {
1379 if (SECSuccess != InitOIDHash())
1380 abort();
1381 }
1382
1383 /* TODO: appears to be the public entry point */
1384 SECOidData *
1385 SECOID_FindOIDByCssmAlgorithm(SecAsn1AlgId cssmAlgorithm)
1386 {
1387 SECOidData *ret;
1388
1389 pthread_once(&hash_once, InitOIDHashOnce);
1390
1391 ret = PL_HashTableLookupConst ( oidmechhash, (void *)&cssmAlgorithm);
1392 if ( ret == NULL ) {
1393 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1394 }
1395
1396 return (ret);
1397 }
1398
1399 /* TODO: appears to be the public entry point */
1400 SECOidData *
1401 SECOID_FindOID(const SecAsn1Item *oid)
1402 {
1403 SECOidData *ret;
1404
1405 pthread_once(&hash_once, InitOIDHashOnce);
1406
1407 ret = PL_HashTableLookupConst ( oidhash, oid );
1408 if ( ret == NULL ) {
1409 #if 0
1410 ret = secoid_FindDynamic(oid);
1411 #endif
1412 if (ret == NULL) {
1413 PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
1414 }
1415 }
1416
1417 return(ret);
1418 }
1419
1420 SECOidTag
1421 SECOID_FindOIDTag(const SecAsn1Item *oid)
1422 {
1423 SECOidData *oiddata;
1424
1425 oiddata = SECOID_FindOID (oid);
1426 if (oiddata == NULL)
1427 return SEC_OID_UNKNOWN;
1428
1429 return oiddata->offset;
1430 }
1431
1432 /* This really should return const. */
1433 SECOidData *
1434 SECOID_FindOIDByTag(SECOidTag tagnum)
1435 {
1436 pthread_once(&hash_once, InitOIDHashOnce);
1437
1438 #if 0
1439 if (tagnum >= SEC_OID_TOTAL) {
1440 return secoid_FindDynamicByTag(tagnum);
1441 }
1442 #else
1443 if (tagnum >= SEC_OID_TOTAL)
1444 return NULL;
1445 #endif
1446
1447 PORT_Assert((unsigned int)tagnum < (sizeof(oids) / sizeof(SECOidData)));
1448 return (SECOidData *)(&oids[tagnum]);
1449 }
1450
1451 Boolean SECOID_KnownCertExtenOID (const SecAsn1Item *extenOid)
1452 {
1453 SECOidData * oidData;
1454
1455 oidData = SECOID_FindOID (extenOid);
1456 if (oidData == (SECOidData *)NULL)
1457 return (PR_FALSE);
1458 return ((oidData->supportedExtension == SUPPORTED_CERT_EXTENSION) ?
1459 PR_TRUE : PR_FALSE);
1460 }
1461
1462
1463 const char *
1464 SECOID_FindOIDTagDescription(SECOidTag tagnum)
1465 {
1466 const SECOidData *oidData = SECOID_FindOIDByTag(tagnum);
1467 return oidData ? oidData->desc : 0;
1468 }
1469
1470 #if 0
1471 /*
1472 * free up the oid tables.
1473 */
1474 SECStatus
1475 SECOID_Shutdown(void)
1476 {
1477 int i;
1478
1479 if (oidhash) {
1480 PL_HashTableDestroy(oidhash);
1481 oidhash = NULL;
1482 }
1483 if (oidmechhash) {
1484 PL_HashTableDestroy(oidmechhash);
1485 oidmechhash = NULL;
1486 }
1487 if (oid_d_hash) {
1488 PL_HashTableDestroy(oid_d_hash);
1489 oid_d_hash = NULL;
1490 }
1491 if (secoidDynamicTable) {
1492 for (i=0; i < secoidLastDynamicEntry; i++) {
1493 PORT_Free(secoidDynamicTable[i]);
1494 }
1495 PORT_Free(secoidDynamicTable);
1496 secoidDynamicTable = NULL;
1497 secoidDynamicTableSize = 0;
1498 secoidLastDynamicEntry = 0;
1499 secoidLastHashEntry = 0;
1500 }
1501 return SECSuccess;
1502 }
1503 #endif