]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/oidscrl.cpp
Security-59754.41.1.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / oidscrl.cpp
1 /*
2 * Copyright (c) 2000-2002,2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25 /*
26
27 File: oidscrl.cpp
28
29 Contains: Object Identifiers for X509 CRLs and OCSP
30
31 Copyright (c) 1999,2001-2002,2004,2011,2014 Apple Inc. All Rights Reserved.
32
33 */
34
35 #include <Security/oidscrl.h>
36
37 static const uint8
38
39 /* CRL OIDs */
40 X509V2CRLSignedCrlStruct[] = {INTEL_X509V2_CRL_R08, 0},
41 X509V2CRLSignedCrlCStruct [] = {INTEL_X509V2_CRL_R08, 0, INTEL_X509_C_DATATYPE},
42 X509V2CRLTbsCertListStruct [] = {INTEL_X509V2_CRL_R08, 1},
43 X509V2CRLTbsCertListCStruct[] = {INTEL_X509V2_CRL_R08, 1, INTEL_X509_C_DATATYPE},
44 X509V2CRLVersion [] = {INTEL_X509V2_CRL_R08, 2},
45 X509V1CRLIssuerStruct[] = {INTEL_X509V2_CRL_R08, 3},
46 X509V1CRLIssuerNameCStruct[] = {INTEL_X509V2_CRL_R08, 3, INTEL_X509_C_DATATYPE},
47 X509V1CRLIssuerNameLDAP[] = {INTEL_X509V2_CRL_R08, 3,
48 INTEL_X509_LDAPSTRING_DATATYPE},
49 X509V1CRLThisUpdate[] = {INTEL_X509V2_CRL_R08, 4},
50 X509V1CRLNextUpdate[] = {INTEL_X509V2_CRL_R08, 5},
51
52 /* CRL Entry (CRL CertList) OIDS */
53 X509V1CRLRevokedCertificatesStruct[] = {INTEL_X509V2_CRL_R08, 7},
54 X509V1CRLRevokedCertificatesCStruct[] = {INTEL_X509V2_CRL_R08, 7, INTEL_X509_C_DATATYPE},
55 X509V1CRLNumberOfRevokedCertEntries[] = {INTEL_X509V2_CRL_R08, 6},
56 X509V1CRLRevokedEntryStruct[] = {INTEL_X509V2_CRL_R08, 15},
57 X509V1CRLRevokedEntryCStruct[] = {INTEL_X509V2_CRL_R08, 15, INTEL_X509_C_DATATYPE},
58 X509V1CRLRevokedEntrySerialNumber[] = {INTEL_X509V2_CRL_R08, 16},
59 X509V1CRLRevokedEntryRevocationDate[] = {INTEL_X509V2_CRL_R08, 17},
60
61 /* CRL Entry (CRL CertList) Extension OIDs */
62 X509V2CRLRevokedEntryAllExtensionsStruct[] = {INTEL_X509V2_CRL_R08, 18},
63 X509V2CRLRevokedEntryAllExtensionsCStruct[] = {INTEL_X509V2_CRL_R08, 18, INTEL_X509_C_DATATYPE},
64 X509V2CRLRevokedEntryNumberOfExtensions[] = {INTEL_X509V2_CRL_R08, 20},
65 X509V2CRLRevokedEntrySingleExtensionStruct[]= {INTEL_X509V2_CRL_R08, 19},
66 X509V2CRLRevokedEntrySingleExtensionCStruct[]= {INTEL_X509V2_CRL_R08, 19, INTEL_X509_C_DATATYPE},
67 X509V2CRLRevokedEntryExtensionId[] = {INTEL_X509V2_CRL_R08, 21},
68 X509V2CRLRevokedEntryExtensionCritical[] = {INTEL_X509V2_CRL_R08, 22},
69 X509V2CRLRevokedEntryExtensionType[] = {INTEL_X509V2_CRL_R08, 23},
70 X509V2CRLRevokedEntryExtensionValue[] = {INTEL_X509V2_CRL_R08, 24},
71
72 /* CRL Extension OIDs */
73 X509V2CRLAllExtensionsStruct[] = {INTEL_X509V2_CRL_R08, 8},
74 X509V2CRLAllExtensionsCStruct[] = {INTEL_X509V2_CRL_R08, 8, INTEL_X509_C_DATATYPE},
75 X509V2CRLNumberOfExtensions[] = {INTEL_X509V2_CRL_R08, 10},
76 X509V2CRLSingleExtensionStruct[] = {INTEL_X509V2_CRL_R08, 9},
77 X509V2CRLSingleExtensionCStruct[] = {INTEL_X509V2_CRL_R08, 9, INTEL_X509_C_DATATYPE},
78 X509V2CRLExtensionId[] = {INTEL_X509V2_CRL_R08, 11},
79 X509V2CRLExtensionCritical[] = {INTEL_X509V2_CRL_R08, 12},
80 X509V2CRLExtensionType[] = {INTEL_X509V2_CRL_R08, 13},
81
82 /* OCSP */
83 OID_PKIX_OCSP[] = { OID_AD_OCSP },
84 OID_PKIX_OCSP_BASIC[] = { OID_AD_OCSP, 1 },
85 OID_PKIX_OCSP_NONCE[] = { OID_AD_OCSP, 2 },
86 OID_PKIX_OCSP_CRL[] = { OID_AD_OCSP, 3 },
87 OID_PKIX_OCSP_RESPONSE[] = { OID_AD_OCSP, 4 },
88 OID_PKIX_OCSP_NOCHECK[] = { OID_AD_OCSP, 5 },
89 OID_PKIX_OCSP_ARCHIVE_CUTOFF[] = { OID_AD_OCSP, 6 },
90 OID_PKIX_OCSP_SERVICE_LOCATOR[] = { OID_AD_OCSP, 7 };
91
92 const CSSM_OID
93
94 /* CRL OIDs */
95 CSSMOID_X509V2CRLSignedCrlStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
96 (uint8 *)X509V2CRLSignedCrlStruct},
97 CSSMOID_X509V2CRLSignedCrlCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
98 (uint8 *)X509V2CRLSignedCrlCStruct},
99 CSSMOID_X509V2CRLTbsCertListStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
100 (uint8 *)X509V2CRLTbsCertListStruct},
101 CSSMOID_X509V2CRLTbsCertListCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
102 (uint8 *)X509V2CRLTbsCertListCStruct},
103 CSSMOID_X509V2CRLVersion = {INTEL_X509V2_CRL_R08_LENGTH+1,
104 (uint8 *)X509V2CRLVersion},
105 CSSMOID_X509V1CRLIssuerStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
106 (uint8 *)X509V1CRLIssuerStruct},
107 CSSMOID_X509V1CRLIssuerNameCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
108 (uint8 *)X509V1CRLIssuerNameCStruct},
109 CSSMOID_X509V1CRLIssuerNameLDAP = {INTEL_X509V2_CRL_R08_LENGTH+2,
110 (uint8 *)X509V1CRLIssuerNameLDAP},
111 CSSMOID_X509V1CRLThisUpdate = {INTEL_X509V2_CRL_R08_LENGTH+1,
112 (uint8 *)X509V1CRLThisUpdate},
113 CSSMOID_X509V1CRLNextUpdate = {INTEL_X509V2_CRL_R08_LENGTH+1,
114 (uint8 *)X509V1CRLNextUpdate},
115
116 /* CRL Entry (CRL CertList) OIDS */
117 CSSMOID_X509V1CRLRevokedCertificatesStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
118 (uint8 *)X509V1CRLRevokedCertificatesStruct},
119 CSSMOID_X509V1CRLRevokedCertificatesCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
120 (uint8 *)X509V1CRLRevokedCertificatesCStruct},
121 CSSMOID_X509V1CRLNumberOfRevokedCertEntries = {INTEL_X509V2_CRL_R08_LENGTH+1,
122 (uint8 *)X509V1CRLNumberOfRevokedCertEntries},
123 CSSMOID_X509V1CRLRevokedEntryStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
124 (uint8 *)X509V1CRLRevokedEntryStruct},
125 CSSMOID_X509V1CRLRevokedEntryCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
126 (uint8 *)X509V1CRLRevokedEntryCStruct},
127 CSSMOID_X509V1CRLRevokedEntrySerialNumber = {INTEL_X509V2_CRL_R08_LENGTH+1,
128 (uint8 *)X509V1CRLRevokedEntrySerialNumber},
129 CSSMOID_X509V1CRLRevokedEntryRevocationDate = {INTEL_X509V2_CRL_R08_LENGTH+1,
130 (uint8 *)X509V1CRLRevokedEntryRevocationDate},
131
132 /* CRL Entry (CRL CertList) Extension OIDs */
133 CSSMOID_X509V2CRLRevokedEntryAllExtensionsStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
134 (uint8 *)X509V2CRLRevokedEntryAllExtensionsStruct},
135 CSSMOID_X509V2CRLRevokedEntryAllExtensionsCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
136 (uint8 *)X509V2CRLRevokedEntryAllExtensionsCStruct},
137 CSSMOID_X509V2CRLRevokedEntryNumberOfExtensions = {INTEL_X509V2_CRL_R08_LENGTH+1,
138 (uint8 *)X509V2CRLRevokedEntryNumberOfExtensions},
139 CSSMOID_X509V2CRLRevokedEntrySingleExtensionStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
140 (uint8 *)X509V2CRLRevokedEntrySingleExtensionStruct},
141 CSSMOID_X509V2CRLRevokedEntrySingleExtensionCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
142 (uint8 *)X509V2CRLRevokedEntrySingleExtensionCStruct},
143 CSSMOID_X509V2CRLRevokedEntryExtensionId = {INTEL_X509V2_CRL_R08_LENGTH+1,
144 (uint8 *)X509V2CRLRevokedEntryExtensionId},
145 CSSMOID_X509V2CRLRevokedEntryExtensionCritical = {INTEL_X509V2_CRL_R08_LENGTH+1,
146 (uint8 *)X509V2CRLRevokedEntryExtensionCritical},
147 CSSMOID_X509V2CRLRevokedEntryExtensionType = {INTEL_X509V2_CRL_R08_LENGTH+1,
148 (uint8 *)X509V2CRLRevokedEntryExtensionType},
149 CSSMOID_X509V2CRLRevokedEntryExtensionValue = {INTEL_X509V2_CRL_R08_LENGTH+1,
150 (uint8 *)X509V2CRLRevokedEntryExtensionValue},
151
152 /* CRL Extension OIDs */
153 CSSMOID_X509V2CRLAllExtensionsStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
154 (uint8 *)X509V2CRLAllExtensionsStruct},
155 CSSMOID_X509V2CRLAllExtensionsCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
156 (uint8 *)X509V2CRLAllExtensionsCStruct},
157 CSSMOID_X509V2CRLNumberOfExtensions = {INTEL_X509V2_CRL_R08_LENGTH+1,
158 (uint8 *)X509V2CRLNumberOfExtensions},
159 CSSMOID_X509V2CRLSingleExtensionStruct = {INTEL_X509V2_CRL_R08_LENGTH+1,
160 (uint8 *)X509V2CRLSingleExtensionStruct},
161 CSSMOID_X509V2CRLSingleExtensionCStruct = {INTEL_X509V2_CRL_R08_LENGTH+2,
162 (uint8 *)X509V2CRLSingleExtensionCStruct},
163 CSSMOID_X509V2CRLExtensionId = {INTEL_X509V2_CRL_R08_LENGTH+1,
164 (uint8 *)X509V2CRLExtensionId},
165 CSSMOID_X509V2CRLExtensionCritical = {INTEL_X509V2_CRL_R08_LENGTH+1,
166 (uint8 *)X509V2CRLExtensionCritical},
167 CSSMOID_X509V2CRLExtensionType = {INTEL_X509V2_CRL_R08_LENGTH+1,
168 (uint8 *)X509V2CRLExtensionType};
169
170 const CSSM_OID
171 /* OCSP OIDs */
172 CSSMOID_PKIX_OCSP = { OID_AD_OCSP_LENGTH, (uint8 *)OID_PKIX_OCSP },
173 CSSMOID_PKIX_OCSP_BASIC = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_BASIC},
174 CSSMOID_PKIX_OCSP_NONCE = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_NONCE},
175 CSSMOID_PKIX_OCSP_CRL = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_CRL},
176 CSSMOID_PKIX_OCSP_RESPONSE = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_RESPONSE},
177 CSSMOID_PKIX_OCSP_NOCHECK = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_NOCHECK},
178 CSSMOID_PKIX_OCSP_ARCHIVE_CUTOFF = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_ARCHIVE_CUTOFF},
179 CSSMOID_PKIX_OCSP_SERVICE_LOCATOR = { OID_AD_OCSP_LENGTH+1, (uint8 *)OID_PKIX_OCSP_SERVICE_LOCATOR};