]> git.saurik.com Git - apple/security.git/blob - libsecurity_keychain/libDER/libDER/oids.c
14c99ddd95e14653dd6454f5a53ba0bb9fae0cca
[apple/security.git] / libsecurity_keychain / libDER / libDER / oids.c
1 /* Copyright (c) 2005-2009 Apple Inc. All Rights Reserved. */
2
3 /*
4 * oids.c - OID consts
5 *
6 * Created Nov. 11 2005 by dmitch
7 */
8
9 #include <libDER/libDER.h>
10 #include <libDER/oids.h>
11
12 #define OID_ISO_CCITT_DIR_SERVICE 85
13 #define OID_DS OID_ISO_CCITT_DIR_SERVICE
14 #define OID_ATTR_TYPE OID_DS, 4
15 #define OID_EXTENSION OID_DS, 29
16 #define OID_ISO_STANDARD 40
17 #define OID_ISO_MEMBER 42
18 #define OID_US OID_ISO_MEMBER, 134, 72
19
20 #define OID_ISO_IDENTIFIED_ORG 43
21 #define OID_OSINET OID_ISO_IDENTIFIED_ORG, 4
22 #define OID_GOSIP OID_ISO_IDENTIFIED_ORG, 5
23 #define OID_DOD OID_ISO_IDENTIFIED_ORG, 6
24 #define OID_OIW OID_ISO_IDENTIFIED_ORG, 14
25
26 /* From the PKCS Standards */
27 #define OID_RSA OID_US, 134, 247, 13
28 #define OID_RSA_HASH OID_RSA, 2
29 #define OID_RSA_ENCRYPT OID_RSA, 3
30 #define OID_PKCS OID_RSA, 1
31 #define OID_PKCS_1 OID_PKCS, 1
32 #define OID_PKCS_2 OID_PKCS, 2
33 #define OID_PKCS_3 OID_PKCS, 3
34 #define OID_PKCS_4 OID_PKCS, 4
35 #define OID_PKCS_5 OID_PKCS, 5
36 #define OID_PKCS_6 OID_PKCS, 6
37 #define OID_PKCS_7 OID_PKCS, 7
38 #define OID_PKCS_8 OID_PKCS, 8
39 #define OID_PKCS_9 OID_PKCS, 9
40 #define OID_PKCS_10 OID_PKCS, 10
41 #define OID_PKCS_11 OID_PKCS, 11
42 #define OID_PKCS_12 OID_PKCS, 12
43
44 /* ANSI X9.62 */
45 #define OID_ANSI_X9_62 OID_US, 206, 61
46 #define OID_PUBLIC_KEY_TYPE OID_ANSI_X9_62, 2
47 #define OID_EC_SIG_TYPE OID_ANSI_X9_62, 4
48 #define OID_ECDSA_WITH_SHA2 OID_EC_SIG_TYPE, 3
49
50 /* ANSI X9.42 */
51 #define OID_ANSI_X9_42 OID_US, 206, 62, 2
52 #define OID_ANSI_X9_42_SCHEME OID_ANSI_X9_42, 3
53 #define OID_ANSI_X9_42_NAMED_SCHEME OID_ANSI_X9_42, 4
54
55 /* DOD IANA Security releated objects. */
56 #define OID_IANA OID_DOD, 1, 5
57
58 /* Kerberos PKINIT */
59 #define OID_KERBv5 OID_IANA, 2
60 #define OID_KERBv5_PKINIT OID_KERBv5, 3
61
62 /* DOD IANA Mechanisms. */
63 #define OID_MECHANISMS OID_IANA, 5
64
65 /* PKIX */
66 #define OID_PKIX OID_MECHANISMS, 7
67 #define OID_PE OID_PKIX, 1
68 #define OID_QT OID_PKIX, 2
69 #define OID_KP OID_PKIX, 3
70 #define OID_OTHER_NAME OID_PKIX, 8
71 #define OID_PDA OID_PKIX, 9
72 #define OID_QCS OID_PKIX, 11
73 #define OID_AD OID_PKIX, 48
74 #define OID_AD_OCSP OID_AD, 1
75 #define OID_AD_CAISSUERS OID_AD, 2
76
77 /* ISAKMP */
78 #define OID_ISAKMP OID_MECHANISMS, 8
79
80 /* ETSI */
81 #define OID_ETSI 0x04, 0x00
82 #define OID_ETSI_QCS 0x04, 0x00, 0x8E, 0x46, 0x01
83
84 #define OID_OIW_SECSIG OID_OIW, 3
85
86 #define OID_OIW_ALGORITHM OID_OIW_SECSIG, 2
87
88 /* NIST defined digest algorithm arc (2, 16, 840, 1, 101, 3, 4, 2) */
89 #define OID_NIST_HASHALG 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02
90
91 /*
92 * Apple-specific OID bases
93 */
94
95 /*
96 * apple OBJECT IDENTIFIER ::=
97 * { iso(1) member-body(2) US(840) 113635 }
98 *
99 * BER = 06 06 2A 86 48 86 F7 63
100 */
101 #define APPLE_OID OID_US, 0x86, 0xf7, 0x63
102
103 /* appleDataSecurity OBJECT IDENTIFIER ::=
104 * { apple 100 }
105 * { 1 2 840 113635 100 }
106 *
107 * BER = 06 07 2A 86 48 86 F7 63 64
108 */
109 #define APPLE_ADS_OID APPLE_OID, 0x64
110
111 /*
112 * appleTrustPolicy OBJECT IDENTIFIER ::=
113 * { appleDataSecurity 1 }
114 * { 1 2 840 113635 100 1 }
115 *
116 * BER = 06 08 2A 86 48 86 F7 63 64 01
117 */
118 #define APPLE_TP_OID APPLE_ADS_OID, 1
119
120 /*
121 * appleSecurityAlgorithm OBJECT IDENTIFIER ::=
122 * { appleDataSecurity 2 }
123 * { 1 2 840 113635 100 2 }
124 *
125 * BER = 06 08 2A 86 48 86 F7 63 64 02
126 */
127 #define APPLE_ALG_OID APPLE_ADS_OID, 2
128
129 /*
130 * appleDotMacCertificate OBJECT IDENTIFIER ::=
131 * { appleDataSecurity 3 }
132 * { 1 2 840 113635 100 3 }
133 */
134 #define APPLE_DOTMAC_CERT_OID APPLE_ADS_OID, 3
135
136 /*
137 * Basis of Policy OIDs for .mac TP requests
138 *
139 * dotMacCertificateRequest OBJECT IDENTIFIER ::=
140 * { appleDotMacCertificate 1 }
141 * { 1 2 840 113635 100 3 1 }
142 */
143 #define APPLE_DOTMAC_CERT_REQ_OID APPLE_DOTMAC_CERT_OID, 1
144
145 /*
146 * Basis of .mac Certificate Extensions
147 *
148 * dotMacCertificateExtension OBJECT IDENTIFIER ::=
149 * { appleDotMacCertificate 2 }
150 * { 1 2 840 113635 100 3 2 }
151 */
152 #define APPLE_DOTMAC_CERT_EXTEN_OID APPLE_DOTMAC_CERT_OID, 2
153
154 /*
155 * Basis of .mac Certificate request OID/value identitifiers
156 *
157 * dotMacCertificateRequestValues OBJECT IDENTIFIER ::=
158 * { appleDotMacCertificate 3 }
159 * { 1 2 840 113635 100 3 3 }
160 */
161 #define APPLE_DOTMAC_CERT_REQ_VALUE_OID APPLE_DOTMAC_CERT_OID, 3
162
163 /*
164 * Basis of Apple-specific extended key usages
165 *
166 * appleExtendedKeyUsage OBJECT IDENTIFIER ::=
167 * { appleDataSecurity 4 }
168 * { 1 2 840 113635 100 4 }
169 */
170 #define APPLE_EKU_OID APPLE_ADS_OID, 4
171
172 /*
173 * Basis of Apple Code Signing extended key usages
174 * appleCodeSigning OBJECT IDENTIFIER ::=
175 * { appleExtendedKeyUsage 1 }
176 * { 1 2 840 113635 100 4 1}
177 */
178 #define APPLE_EKU_CODE_SIGNING APPLE_EKU_OID, 1
179 #define APPLE_EKU_APPLE_ID APPLE_EKU_OID, 7
180
181 /*
182 * Basis of Apple-specific Certific Policy IDs.
183 * appleCertificatePolicies OBJECT IDENTIFIER ::=
184 * { appleDataSecurity 5 }
185 * { 1 2 840 113635 100 5 }
186 */
187 #define APPLE_CERT_POLICIES APPLE_ADS_OID, 5
188
189 /*
190 * Basis of Apple-specific Signing extensions
191 * { appleDataSecurity 6 }
192 */
193 #define APPLE_CERT_EXT APPLE_ADS_OID, 6
194
195 /* Apple Intermediate Marker OIDs */
196 #define APPLE_CERT_EXT_INTERMEDIATE_MARKER APPLE_CERT_EXT, 2
197 /* Apple Apple ID Intermediate Marker */
198 #define APPLE_CERT_EXT_INTERMEDIATE_MARKER_APPLEID APPLE_CERT_EXT_INTERMEDIATE_MARKER, 3
199 /*
200 * Apple Apple ID Intermediate Marker (New subCA, no longer shared with push notification server cert issuer
201 *
202 * appleCertificateExtensionAppleIDIntermediate ::=
203 * { appleCertificateExtensionIntermediateMarker 7 }
204 * { 1 2 840 113635 100 6 2 7 }
205 */
206 #define APPLE_CERT_EXT_INTERMEDIATE_MARKER_APPLEID_2 APPLE_CERT_EXT_INTERMEDIATE_MARKER, 7
207
208
209 /* Secure Boot Embedded Image3 value,
210 co-opted by desktop for "Apple Released Code Signature", without value */
211 #define APPLE_SBOOT_CERT_EXTEN_SBOOT_SPEC_OID APPLE_ADS_OID, 6, 1, 1
212 /* iPhone Provisioning Profile Signing leaf */
213 #define APPLE_PROVISIONING_PROFILE_OID APPLE_ADS_OID, 6, 2, 2, 1
214 /* iPhone Application Signing leaf */
215 #define APPLE_APP_SIGINING_OID APPLE_ADS_OID, 6, 1, 3
216
217 /*
218 * Netscape OIDs.
219 */
220 #define NETSCAPE_BASE_OID 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42
221
222 /*
223 * Netscape cert extension.
224 *
225 * netscape-cert-extension OBJECT IDENTIFIER ::=
226 * { 2 16 840 1 113730 1 }
227 *
228 * BER = 06 08 60 86 48 01 86 F8 42 01
229 */
230 #define NETSCAPE_CERT_EXTEN NETSCAPE_BASE_OID, 0x01
231
232 #define NETSCAPE_CERT_POLICY NETSCAPE_BASE_OID, 0x04
233
234 /* Entrust OIDs. */
235 #define ENTRUST_BASE_OID OID_US, 0x86, 0xf6, 0x7d
236
237 /*
238 * Entrust cert extension.
239 *
240 * entrust-cert-extension OBJECT IDENTIFIER ::=
241 * { 1 2 840 113533 7 65 }
242 *
243 * BER = 06 08 2A 86 48 86 F6 7D 07 41
244 */
245 #define ENTRUST_CERT_EXTEN ENTRUST_BASE_OID, 0x07, 0x41
246
247 /* Microsfot OIDs. */
248 #define MICROSOFT_BASE_OID OID_DOD, 0x01, 0x04, 0x01, 0x82, 0x37
249 #define MICROSOFT_ENROLLMENT_OID MICROSOFT_BASE_OID, 0x14
250
251 /* Algorithm OIDs. */
252 static const DERByte
253 _oidRsa[] = { OID_PKCS_1, 1 },
254 _oidMd2Rsa[] = { OID_PKCS_1, 2 },
255 _oidMd5Rsa[] = { OID_PKCS_1, 4 },
256 _oidSha1Rsa[] = { OID_PKCS_1, 5 },
257 _oidSha256Rsa[] = { OID_PKCS_1, 11 },
258 _oidEcPubKey[] = { OID_PUBLIC_KEY_TYPE, 1 },
259 _oidSha1Ecdsa[] = { OID_EC_SIG_TYPE, 1 }, /* rfc3279 */
260 _oidSha224Ecdsa[] = { OID_ECDSA_WITH_SHA2, 1 }, /* rfc5758 */
261 _oidSha256Ecdsa[] = { OID_ECDSA_WITH_SHA2, 2 }, /* rfc5758 */
262 _oidSha384Ecdsa[] = { OID_ECDSA_WITH_SHA2, 3 }, /* rfc5758 */
263 _oidSha512Ecdsa[] = { OID_ECDSA_WITH_SHA2, 4 }, /* rfc5758 */
264 _oidMd2[] = { OID_RSA_HASH, 2 },
265 _oidMd4[] = { OID_RSA_HASH, 4 },
266 _oidMd5[] = { OID_RSA_HASH, 5 },
267 _oidSha1[] = { OID_OIW_ALGORITHM, 26 },
268 _oidSha256[] = { OID_NIST_HASHALG, 1 },
269 _oidSha384[] = { OID_NIST_HASHALG, 2 },
270 _oidSha512[] = { OID_NIST_HASHALG, 3 },
271 _oidSha224[] = { OID_NIST_HASHALG, 4 };
272
273 const DERItem
274 oidRsa = { (DERByte *)_oidRsa,
275 sizeof(_oidRsa) },
276 oidMd2Rsa = { (DERByte *)_oidMd2Rsa,
277 sizeof(_oidMd2Rsa) },
278 oidMd5Rsa = { (DERByte *)_oidMd5Rsa,
279 sizeof(_oidMd5Rsa) },
280 oidSha1Rsa = { (DERByte *)_oidSha1Rsa,
281 sizeof(_oidSha1Rsa) },
282 oidSha256Rsa = { (DERByte *)_oidSha256Rsa,
283 sizeof(_oidSha256Rsa) },
284 oidEcPubKey = { (DERByte *)_oidEcPubKey,
285 sizeof(_oidEcPubKey) },
286 oidSha1Ecdsa = { (DERByte *)_oidSha1Ecdsa,
287 sizeof(_oidSha1Ecdsa) },
288 oidSha224Ecdsa = { (DERByte *)_oidSha224Ecdsa,
289 sizeof(_oidSha224Ecdsa) },
290 oidSha256Ecdsa = { (DERByte *)_oidSha256Ecdsa,
291 sizeof(_oidSha256Ecdsa) },
292 oidSha384Ecdsa = { (DERByte *)_oidSha384Ecdsa,
293 sizeof(_oidSha384Ecdsa) },
294 oidSha512Ecdsa = { (DERByte *)_oidSha512Ecdsa,
295 sizeof(_oidSha512Ecdsa) },
296 oidMd2 = { (DERByte *)_oidMd2,
297 sizeof(_oidMd2) },
298 oidMd4 = { (DERByte *)_oidMd4,
299 sizeof(_oidMd4) },
300 oidMd5 = { (DERByte *)_oidMd5,
301 sizeof(_oidMd5) },
302 oidSha1 = { (DERByte *)_oidSha1,
303 sizeof(_oidSha1) },
304 oidSha256 = { (DERByte *)_oidSha256,
305 sizeof(_oidSha256) },
306 oidSha384 = { (DERByte *)_oidSha384,
307 sizeof(_oidSha384) },
308 oidSha512 = { (DERByte *)_oidSha512,
309 sizeof(_oidSha512) },
310 oidSha224 = { (DERByte *)_oidSha224,
311 sizeof(_oidSha224) };
312
313 /* Extension OIDs. */
314 static const DERByte
315 _oidSubjectKeyIdentifier[] = { OID_EXTENSION, 14 },
316 _oidKeyUsage[] = { OID_EXTENSION, 15 },
317 _oidPrivateKeyUsagePeriod[] = { OID_EXTENSION, 16 },
318 _oidSubjectAltName[] = { OID_EXTENSION, 17 },
319 _oidIssuerAltName[] = { OID_EXTENSION, 18 },
320 _oidBasicConstraints[] = { OID_EXTENSION, 19 },
321 _oidCrlDistributionPoints[] = { OID_EXTENSION, 31 },
322 _oidCertificatePolicies[] = { OID_EXTENSION, 32 },
323 _oidAnyPolicy[] = { OID_EXTENSION, 32, 0 },
324 _oidPolicyMappings[] = { OID_EXTENSION, 33 },
325 _oidAuthorityKeyIdentifier[] = { OID_EXTENSION, 35 },
326 _oidPolicyConstraints[] = { OID_EXTENSION, 36 },
327 _oidExtendedKeyUsage[] = { OID_EXTENSION, 37 },
328 _oidAnyExtendedKeyUsage[] = { OID_EXTENSION, 37, 0 },
329 _oidInhibitAnyPolicy[] = { OID_EXTENSION, 54 },
330 _oidAuthorityInfoAccess[] = { OID_PE, 1 },
331 _oidSubjectInfoAccess[] = { OID_PE, 11 },
332 _oidAdOCSP[] = { OID_AD_OCSP },
333 _oidAdCAIssuer[] = { OID_AD_CAISSUERS },
334 _oidNetscapeCertType[] = { NETSCAPE_CERT_EXTEN, 1 },
335 _oidEntrustVersInfo[] = { ENTRUST_CERT_EXTEN, 0 },
336 _oidMSNTPrincipalName[] = { MICROSOFT_ENROLLMENT_OID, 2, 3 },
337 /* Policy Qualifier IDs for Internet policy qualifiers. */
338 _oidQtCps[] = { OID_QT, 1 },
339 _oidQtUNotice[] = { OID_QT, 2 },
340 /* X.501 Name IDs. */
341 _oidCommonName[] = { OID_ATTR_TYPE, 3 },
342 _oidCountryName[] = { OID_ATTR_TYPE, 6 },
343 _oidLocalityName[] = { OID_ATTR_TYPE, 7 },
344 _oidStateOrProvinceName[] = { OID_ATTR_TYPE, 8 },
345 _oidOrganizationName[] = { OID_ATTR_TYPE, 10 },
346 _oidOrganizationalUnitName[] = { OID_ATTR_TYPE, 11 },
347 _oidDescription[] = { OID_ATTR_TYPE, 13 },
348 _oidEmailAddress[] = { OID_PKCS_9, 1 },
349 _oidFriendlyName[] = { OID_PKCS_9, 20 },
350 _oidLocalKeyId[] = { OID_PKCS_9, 21 },
351 _oidExtendedKeyUsageServerAuth[] = { OID_KP, 1 },
352 _oidExtendedKeyUsageClientAuth[] = { OID_KP, 2 },
353 _oidExtendedKeyUsageCodeSigning[] = { OID_KP, 3 },
354 _oidExtendedKeyUsageEmailProtection[] = { OID_KP, 4 },
355 _oidExtendedKeyUsageOCSPSigning[] = { OID_KP, 9 },
356 _oidExtendedKeyUsageIPSec[] = { OID_ISAKMP, 2, 2 },
357 _oidExtendedKeyUsageMicrosoftSGC[] = { MICROSOFT_BASE_OID, 10, 3, 3 },
358 _oidExtendedKeyUsageNetscapeSGC[] = { NETSCAPE_CERT_POLICY, 1 },
359 _oidAppleSecureBootCertSpec[] = { APPLE_SBOOT_CERT_EXTEN_SBOOT_SPEC_OID },
360 _oidAppleProvisioningProfile[] = {APPLE_PROVISIONING_PROFILE_OID },
361 _oidAppleApplicationSigning[] = { APPLE_APP_SIGINING_OID },
362 _oidAppleExtendedKeyUsageAppleID[] = { APPLE_EKU_APPLE_ID },
363 _oidAppleIntmMarkerAppleID[] = { APPLE_CERT_EXT_INTERMEDIATE_MARKER_APPLEID },
364 _oidAppleIntmMarkerAppleID2[] = {APPLE_CERT_EXT_INTERMEDIATE_MARKER_APPLEID_2 };
365
366 const DERItem
367 oidSubjectKeyIdentifier = { (DERByte *)_oidSubjectKeyIdentifier,
368 sizeof(_oidSubjectKeyIdentifier) },
369 oidKeyUsage = { (DERByte *)_oidKeyUsage,
370 sizeof(_oidKeyUsage) },
371 oidPrivateKeyUsagePeriod = { (DERByte *)_oidPrivateKeyUsagePeriod,
372 sizeof(_oidPrivateKeyUsagePeriod) },
373 oidSubjectAltName = { (DERByte *)_oidSubjectAltName,
374 sizeof(_oidSubjectAltName) },
375 oidIssuerAltName = { (DERByte *)_oidIssuerAltName,
376 sizeof(_oidIssuerAltName) },
377 oidBasicConstraints = { (DERByte *)_oidBasicConstraints,
378 sizeof(_oidBasicConstraints) },
379 oidCrlDistributionPoints = { (DERByte *)_oidCrlDistributionPoints,
380 sizeof(_oidCrlDistributionPoints) },
381 oidCertificatePolicies = { (DERByte *)_oidCertificatePolicies,
382 sizeof(_oidCertificatePolicies) },
383 oidAnyPolicy = { (DERByte *)_oidAnyPolicy,
384 sizeof(_oidAnyPolicy) },
385 oidPolicyMappings = { (DERByte *)_oidPolicyMappings,
386 sizeof(_oidPolicyMappings) },
387 oidAuthorityKeyIdentifier = { (DERByte *)_oidAuthorityKeyIdentifier,
388 sizeof(_oidAuthorityKeyIdentifier) },
389 oidPolicyConstraints = { (DERByte *)_oidPolicyConstraints,
390 sizeof(_oidPolicyConstraints) },
391 oidExtendedKeyUsage = { (DERByte *)_oidExtendedKeyUsage,
392 sizeof(_oidExtendedKeyUsage) },
393 oidAnyExtendedKeyUsage = { (DERByte *)_oidAnyExtendedKeyUsage,
394 sizeof(_oidAnyExtendedKeyUsage) },
395 oidInhibitAnyPolicy = { (DERByte *)_oidInhibitAnyPolicy,
396 sizeof(_oidInhibitAnyPolicy) },
397 oidAuthorityInfoAccess = { (DERByte *)_oidAuthorityInfoAccess,
398 sizeof(_oidAuthorityInfoAccess) },
399 oidSubjectInfoAccess = { (DERByte *)_oidSubjectInfoAccess,
400 sizeof(_oidSubjectInfoAccess) },
401 oidAdOCSP = { (DERByte *)_oidAdOCSP,
402 sizeof(_oidAdOCSP) },
403 oidAdCAIssuer = { (DERByte *)_oidAdCAIssuer,
404 sizeof(_oidAdCAIssuer) },
405 oidNetscapeCertType = { (DERByte *)_oidNetscapeCertType,
406 sizeof(_oidNetscapeCertType) },
407 oidEntrustVersInfo = { (DERByte *)_oidEntrustVersInfo,
408 sizeof(_oidEntrustVersInfo) },
409 oidMSNTPrincipalName = { (DERByte *)_oidMSNTPrincipalName,
410 sizeof(_oidMSNTPrincipalName) },
411 /* Policy Qualifier IDs for Internet policy qualifiers. */
412 oidQtCps = { (DERByte *)_oidQtCps,
413 sizeof(_oidQtCps) },
414 oidQtUNotice = { (DERByte *)_oidQtUNotice,
415 sizeof(_oidQtUNotice) },
416 /* X.501 Name IDs. */
417 oidCommonName = { (DERByte *)_oidCommonName,
418 sizeof(_oidCommonName) },
419 oidCountryName = { (DERByte *)_oidCountryName,
420 sizeof(_oidCountryName) },
421 oidLocalityName = { (DERByte *)_oidLocalityName,
422 sizeof(_oidLocalityName) },
423 oidStateOrProvinceName = { (DERByte *)_oidStateOrProvinceName,
424 sizeof(_oidStateOrProvinceName) },
425 oidOrganizationName = { (DERByte *)_oidOrganizationName,
426 sizeof(_oidOrganizationName) },
427 oidOrganizationalUnitName = { (DERByte *)_oidOrganizationalUnitName,
428 sizeof(_oidOrganizationalUnitName) },
429 oidDescription = { (DERByte *)_oidDescription,
430 sizeof(_oidDescription) },
431 oidEmailAddress = { (DERByte *)_oidEmailAddress,
432 sizeof(_oidEmailAddress) },
433 oidFriendlyName = { (DERByte *)_oidFriendlyName,
434 sizeof(_oidFriendlyName) },
435 oidLocalKeyId = { (DERByte *)_oidLocalKeyId,
436 sizeof(_oidLocalKeyId) },
437 oidExtendedKeyUsageServerAuth = { (DERByte *)_oidExtendedKeyUsageServerAuth,
438 sizeof(_oidExtendedKeyUsageServerAuth) },
439 oidExtendedKeyUsageClientAuth = { (DERByte *)_oidExtendedKeyUsageClientAuth,
440 sizeof(_oidExtendedKeyUsageClientAuth) },
441 oidExtendedKeyUsageCodeSigning = { (DERByte *)_oidExtendedKeyUsageCodeSigning,
442 sizeof(_oidExtendedKeyUsageCodeSigning) },
443 oidExtendedKeyUsageEmailProtection = { (DERByte *)_oidExtendedKeyUsageEmailProtection,
444 sizeof(_oidExtendedKeyUsageEmailProtection) },
445 oidExtendedKeyUsageOCSPSigning = { (DERByte *)_oidExtendedKeyUsageOCSPSigning,
446 sizeof(_oidExtendedKeyUsageOCSPSigning) },
447 oidExtendedKeyUsageIPSec = { (DERByte *)_oidExtendedKeyUsageIPSec,
448 sizeof(_oidExtendedKeyUsageIPSec) },
449 oidExtendedKeyUsageMicrosoftSGC = { (DERByte *)_oidExtendedKeyUsageMicrosoftSGC,
450 sizeof(_oidExtendedKeyUsageMicrosoftSGC) },
451 oidExtendedKeyUsageNetscapeSGC = { (DERByte *)_oidExtendedKeyUsageNetscapeSGC,
452 sizeof(_oidExtendedKeyUsageNetscapeSGC) },
453 oidAppleSecureBootCertSpec = { (DERByte *)_oidAppleSecureBootCertSpec,
454 sizeof(_oidAppleSecureBootCertSpec) },
455 oidAppleProvisioningProfile = { (DERByte *)_oidAppleProvisioningProfile,
456 sizeof(_oidAppleProvisioningProfile) },
457 oidAppleApplicationSigning = { (DERByte *)_oidAppleApplicationSigning,
458 sizeof(_oidAppleApplicationSigning) },
459 oidAppleExtendedKeyUsageAppleID = { (DERByte *)_oidAppleExtendedKeyUsageAppleID,
460 sizeof(_oidAppleExtendedKeyUsageAppleID) },
461 oidAppleIntmMarkerAppleID = { (DERByte *)_oidAppleIntmMarkerAppleID,
462 sizeof(_oidAppleIntmMarkerAppleID) },
463 oidAppleIntmMarkerAppleID2 = { (DERByte *)_oidAppleIntmMarkerAppleID2,
464 sizeof(_oidAppleIntmMarkerAppleID2) };
465
466
467 bool DEROidCompare(const DERItem *oid1, const DERItem *oid2) {
468 if ((oid1 == NULL) || (oid2 == NULL)) {
469 return false;
470 }
471 if (oid1->length != oid2->length) {
472 return false;
473 }
474 if (!DERMemcmp(oid1->data, oid2->data, oid1->length)) {
475 return true;
476 } else {
477 return false;
478 }
479 }