]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmerr.h
Security-58286.51.6.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / cssmerr.h
1 /*
2 * Copyright (c) 1999-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 * cssmerr.h -- Error Code Definitions for CSSM
24 */
25
26 #ifndef _CSSMERR_H_
27 #define _CSSMERR_H_ 1
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33
34 /*
35 * NOTE: To translate CSSM error codes into something vaguely
36 * human-readable, use the cssmPerror function in cssmapple.h.
37 * This function will also decode other Security layer errors
38 * (i.e. those with names like kSec...).
39 */
40
41
42 /* Common error codes. */
43 enum {
44 CSSM_BASE_ERROR = -0x7FFF0000 /* 0x80010000 */
45 };
46
47 enum {
48 CSSM_ERRORCODE_MODULE_EXTENT = 0x00000800,
49 CSSM_ERRORCODE_CUSTOM_OFFSET = 0x00000400,
50 CSSM_ERRORCODE_COMMON_EXTENT = 0x100
51 };
52
53 /* Macros for convertible error code manipulation. */
54 #define CSSM_ERRCODE(CODE) \
55 (((CODE) - CSSM_BASE_ERROR) & (CSSM_ERRORCODE_MODULE_EXTENT - 1))
56
57 #define CSSM_ERRBASE(CODE) \
58 ((((CODE) - CSSM_BASE_ERROR) & ~(CSSM_ERRORCODE_MODULE_EXTENT - 1)) + CSSM_BASE_ERROR)
59
60 #define CSSM_ERR_IS_CONVERTIBLE(CODE) \
61 (CSSM_ERRCODE(CODE) < CSSM_ERRORCODE_COMMON_EXTENT)
62
63 #define CSSM_ERR_TAG(CODE, BASE) \
64 (CSSM_ERRCODE(CODE) + (BASE))
65
66 /* Error Bases for different module types. */
67 enum {
68 CSSM_CSSM_BASE_ERROR = CSSM_BASE_ERROR,
69 CSSM_CSSM_PRIVATE_ERROR = CSSM_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
70 CSSM_CSP_BASE_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
71 CSSM_CSP_PRIVATE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
72 CSSM_DL_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
73 CSSM_DL_PRIVATE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
74 CSSM_CL_BASE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
75 CSSM_CL_PRIVATE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
76 CSSM_TP_BASE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
77 CSSM_TP_PRIVATE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET ,
78 CSSM_KR_BASE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
79 CSSM_KR_PRIVATE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
80 CSSM_AC_BASE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
81 CSSM_AC_PRIVATE_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET
82 };
83
84 /* XXX @@@ MDS Error Bases same as DL for now. */
85 enum {
86 CSSM_MDS_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
87 CSSM_MDS_PRIVATE_ERROR = CSSM_MDS_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET
88 };
89
90 /* General Error Values. */
91 enum {
92 CSSMERR_CSSM_INVALID_ADDIN_HANDLE = -2147417855,
93 CSSMERR_CSSM_NOT_INITIALIZED = -2147417854,
94 CSSMERR_CSSM_INVALID_HANDLE_USAGE = -2147417853,
95 CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND = -2147417852,
96 CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL = -2147417851,
97 };
98
99 /* Common Error Codes For All Module Types. */
100 enum {
101 CSSM_ERRCODE_INTERNAL_ERROR = 0x0001,
102 CSSM_ERRCODE_MEMORY_ERROR = 0x0002,
103 CSSM_ERRCODE_MDS_ERROR = 0x0003,
104 CSSM_ERRCODE_INVALID_POINTER = 0x0004,
105 CSSM_ERRCODE_INVALID_INPUT_POINTER = 0x0005,
106 CSSM_ERRCODE_INVALID_OUTPUT_POINTER = 0x0006,
107 CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED = 0x0007,
108 CSSM_ERRCODE_SELF_CHECK_FAILED = 0x0008,
109 CSSM_ERRCODE_OS_ACCESS_DENIED = 0x0009,
110 CSSM_ERRCODE_FUNCTION_FAILED = 0x000A,
111 CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED = 0x000B,
112 CSSM_ERRCODE_INVALID_GUID = 0x000C
113 };
114
115 /* Common Error Codes for ACLs */
116 enum {
117 CSSM_ERRCODE_OPERATION_AUTH_DENIED = 0x0020,
118 CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED = 0x0021,
119 CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED = 0x0022,
120 CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED = 0x0023,
121 CSSM_ERRCODE_OBJECT_ACL_REQUIRED = 0x0024,
122 CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS = 0x0025,
123 CSSM_ERRCODE_INVALID_ACL_BASE_CERTS = 0x0026,
124 CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED = 0x0027,
125 CSSM_ERRCODE_INVALID_SAMPLE_VALUE = 0x0028,
126 CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED = 0x0029,
127 CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE = 0x002A,
128 CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED = 0x002B,
129 CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK = 0x002C,
130 CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED = 0x002D,
131 CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG = 0x002E,
132 CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND = 0x002F,
133 CSSM_ERRCODE_INVALID_ACL_EDIT_MODE = 0x0030,
134 CSSM_ERRCODE_ACL_CHANGE_FAILED = 0x0031,
135 CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY = 0x0032,
136 CSSM_ERRCODE_INVALID_NEW_ACL_OWNER = 0x0033,
137 CSSM_ERRCODE_ACL_DELETE_FAILED = 0x0034,
138 CSSM_ERRCODE_ACL_REPLACE_FAILED = 0x0035,
139 CSSM_ERRCODE_ACL_ADD_FAILED = 0x0036
140 };
141
142 /* Common Error Codes for Specific Data Types */
143 enum {
144 CSSM_ERRCODE_INVALID_CONTEXT_HANDLE = 0x0040,
145 CSSM_ERRCODE_INCOMPATIBLE_VERSION = 0x0041,
146 CSSM_ERRCODE_INVALID_CERTGROUP_POINTER = 0x0042,
147 CSSM_ERRCODE_INVALID_CERT_POINTER = 0x0043,
148 CSSM_ERRCODE_INVALID_CRL_POINTER = 0x0044,
149 CSSM_ERRCODE_INVALID_FIELD_POINTER = 0x0045,
150 CSSM_ERRCODE_INVALID_DATA = 0x0046,
151 CSSM_ERRCODE_CRL_ALREADY_SIGNED = 0x0047,
152 CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS = 0x0048,
153 CSSM_ERRCODE_VERIFICATION_FAILURE = 0x0049,
154 CSSM_ERRCODE_INVALID_DB_HANDLE = 0x004A,
155 CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED = 0x004B,
156 CSSM_ERRCODE_INVALID_DB_LIST = 0x004C,
157 CSSM_ERRCODE_INVALID_DB_LIST_POINTER = 0x004D,
158 CSSM_ERRCODE_UNKNOWN_FORMAT = 0x004E,
159 CSSM_ERRCODE_UNKNOWN_TAG = 0x004F,
160 CSSM_ERRCODE_INVALID_CSP_HANDLE = 0x0050,
161 CSSM_ERRCODE_INVALID_DL_HANDLE = 0x0051,
162 CSSM_ERRCODE_INVALID_CL_HANDLE = 0x0052,
163 CSSM_ERRCODE_INVALID_TP_HANDLE = 0x0053,
164 CSSM_ERRCODE_INVALID_KR_HANDLE = 0x0054,
165 CSSM_ERRCODE_INVALID_AC_HANDLE = 0x0055,
166 CSSM_ERRCODE_INVALID_PASSTHROUGH_ID = 0x0056,
167 CSSM_ERRCODE_INVALID_NETWORK_ADDR = 0x0057,
168 CSSM_ERRCODE_INVALID_CRYPTO_DATA = 0x0058
169 };
170
171 /* CSSM Error Values Derived from Common Error Codes For All Module Types. */
172 enum {
173 CSSMERR_CSSM_INTERNAL_ERROR = -2147418111,
174 CSSMERR_CSSM_MEMORY_ERROR = -2147418110,
175 CSSMERR_CSSM_MDS_ERROR = -2147418109,
176 CSSMERR_CSSM_INVALID_POINTER = -2147418108,
177 CSSMERR_CSSM_INVALID_INPUT_POINTER = -2147418107,
178 CSSMERR_CSSM_INVALID_OUTPUT_POINTER = -2147418106,
179 CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED = -2147418105,
180 CSSMERR_CSSM_SELF_CHECK_FAILED = -2147418104,
181 CSSMERR_CSSM_OS_ACCESS_DENIED = -2147418103,
182 CSSMERR_CSSM_FUNCTION_FAILED = -2147418102,
183 CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED = -2147418101,
184 CSSMERR_CSSM_INVALID_GUID = -2147418100,
185 };
186
187 /* CSSM Error Values for Specific Data Types. */
188 enum {
189 CSSMERR_CSSM_INVALID_CONTEXT_HANDLE = -2147418048,
190 CSSMERR_CSSM_INCOMPATIBLE_VERSION = -2147418047,
191 CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED = -2147418037,
192 };
193
194 /* CSSM Module-Specific Error Values */
195 enum {
196 CSSM_CSSM_BASE_CSSM_ERROR =
197 CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 0x10,
198 CSSMERR_CSSM_SCOPE_NOT_SUPPORTED = -2147417839,
199 CSSMERR_CSSM_PVC_ALREADY_CONFIGURED = -2147417838,
200 CSSMERR_CSSM_INVALID_PVC = -2147417837,
201 CSSMERR_CSSM_EMM_LOAD_FAILED = -2147417836,
202 CSSMERR_CSSM_EMM_UNLOAD_FAILED = -2147417835,
203 CSSMERR_CSSM_ADDIN_LOAD_FAILED = -2147417834,
204 CSSMERR_CSSM_INVALID_KEY_HIERARCHY = -2147417833,
205 CSSMERR_CSSM_ADDIN_UNLOAD_FAILED = -2147417832,
206 CSSMERR_CSSM_LIB_REF_NOT_FOUND = -2147417831,
207 CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE = -2147417830,
208 CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED = -2147417829,
209 CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED = -2147417828,
210 CSSMERR_CSSM_INVALID_SERVICE_MASK = -2147417827,
211 CSSMERR_CSSM_MODULE_NOT_LOADED = -2147417826,
212 CSSMERR_CSSM_INVALID_SUBSERVICEID = -2147417825,
213 CSSMERR_CSSM_BUFFER_TOO_SMALL = -2147417824,
214 CSSMERR_CSSM_INVALID_ATTRIBUTE = -2147417823,
215 CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT = -2147417822,
216 CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL = -2147417821,
217 CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND = -2147417820,
218 CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND = -2147417819,
219 };
220
221 /* CSP Error Values Derived from Common Error Codes For All Module Types. */
222 enum {
223 CSSMERR_CSP_INTERNAL_ERROR = -2147416063,
224 CSSMERR_CSP_MEMORY_ERROR = -2147416062,
225 CSSMERR_CSP_MDS_ERROR = -2147416061,
226 CSSMERR_CSP_INVALID_POINTER = -2147416060,
227 CSSMERR_CSP_INVALID_INPUT_POINTER = -2147416059,
228 CSSMERR_CSP_INVALID_OUTPUT_POINTER = -2147416058,
229 CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED = -2147416057,
230 CSSMERR_CSP_SELF_CHECK_FAILED = -2147416056,
231 CSSMERR_CSP_OS_ACCESS_DENIED = -2147416055,
232 CSSMERR_CSP_FUNCTION_FAILED = -2147416054,
233 };
234
235 /* CSP Error Values Derived from ACL-based Error Codes. */
236 enum {
237 CSSMERR_CSP_OPERATION_AUTH_DENIED = -2147416032,
238 CSSMERR_CSP_OBJECT_USE_AUTH_DENIED = -2147416031,
239 CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED = -2147416030,
240 CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED = -2147416029,
241 CSSMERR_CSP_OBJECT_ACL_REQUIRED = -2147416028,
242 CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS = -2147416027,
243 CSSMERR_CSP_INVALID_ACL_BASE_CERTS = -2147416026,
244 CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED = -2147416025,
245 CSSMERR_CSP_INVALID_SAMPLE_VALUE = -2147416024,
246 CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED = -2147416023,
247 CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE = -2147416022,
248 CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147416021,
249 CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK = -2147416020,
250 CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED = -2147416019,
251 CSSMERR_CSP_INVALID_ACL_ENTRY_TAG = -2147416018,
252 CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND = -2147416017,
253 CSSMERR_CSP_INVALID_ACL_EDIT_MODE = -2147416016,
254 CSSMERR_CSP_ACL_CHANGE_FAILED = -2147416015,
255 CSSMERR_CSP_INVALID_NEW_ACL_ENTRY = -2147416014,
256 CSSMERR_CSP_INVALID_NEW_ACL_OWNER = -2147416013,
257 CSSMERR_CSP_ACL_DELETE_FAILED = -2147416012,
258 CSSMERR_CSP_ACL_REPLACE_FAILED = -2147416011,
259 CSSMERR_CSP_ACL_ADD_FAILED = -2147416010,
260 };
261
262 /* CSP Error Values for Specific Data Types. */
263 enum {
264 CSSMERR_CSP_INVALID_CONTEXT_HANDLE = -2147416000,
265 CSSMERR_CSP_PRIVILEGE_NOT_GRANTED = -2147415989,
266 CSSMERR_CSP_INVALID_DATA = -2147415994,
267 CSSMERR_CSP_INVALID_PASSTHROUGH_ID = -2147415978,
268 CSSMERR_CSP_INVALID_CRYPTO_DATA = -2147415976,
269 };
270
271 /* CSP Module-Specific Error Values */
272 enum {
273 /* General CSP Error Values */
274 CSSM_CSP_BASE_CSP_ERROR =
275 CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
276 CSSMERR_CSP_INPUT_LENGTH_ERROR = -2147415807,
277 CSSMERR_CSP_OUTPUT_LENGTH_ERROR = -2147415806,
278 CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED = -2147415805,
279 CSSMERR_CSP_DEVICE_ERROR = -2147415804,
280 CSSMERR_CSP_DEVICE_MEMORY_ERROR = -2147415803,
281 CSSMERR_CSP_ATTACH_HANDLE_BUSY = -2147415802,
282 CSSMERR_CSP_NOT_LOGGED_IN = -2147415801,
283 CSSMERR_CSP_INVALID_KEY = -2147415792,
284 CSSMERR_CSP_INVALID_KEY_REFERENCE = -2147415791,
285 CSSMERR_CSP_INVALID_KEY_CLASS = -2147415790,
286 CSSMERR_CSP_ALGID_MISMATCH = -2147415789,
287 CSSMERR_CSP_KEY_USAGE_INCORRECT = -2147415788,
288 CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT = -2147415787,
289 CSSMERR_CSP_KEY_HEADER_INCONSISTENT = -2147415786,
290 CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT = -2147415785,
291 CSSMERR_CSP_UNSUPPORTED_KEY_SIZE = -2147415784,
292 CSSMERR_CSP_INVALID_KEY_POINTER = -2147415783,
293 CSSMERR_CSP_INVALID_KEYUSAGE_MASK = -2147415782,
294 CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK = -2147415781,
295 CSSMERR_CSP_INVALID_KEYATTR_MASK = -2147415780,
296 CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK = -2147415779,
297 CSSMERR_CSP_INVALID_KEY_LABEL = -2147415778,
298 CSSMERR_CSP_UNSUPPORTED_KEY_LABEL = -2147415777,
299 CSSMERR_CSP_INVALID_KEY_FORMAT = -2147415776,
300
301 CSSMERR_CSP_INVALID_DATA_COUNT = -2147415768,
302 CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED = -2147415767,
303 CSSMERR_CSP_INVALID_INPUT_VECTOR = -2147415766,
304 CSSMERR_CSP_INVALID_OUTPUT_VECTOR = -2147415765,
305
306 CSSMERR_CSP_INVALID_CONTEXT = -2147415760,
307 CSSMERR_CSP_INVALID_ALGORITHM = -2147415759,
308 CSSMERR_CSP_INVALID_ATTR_KEY = -2147415754,
309 CSSMERR_CSP_MISSING_ATTR_KEY = -2147415753,
310 CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR = -2147415752,
311 CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR = -2147415751,
312 CSSMERR_CSP_INVALID_ATTR_SALT = -2147415750,
313 CSSMERR_CSP_MISSING_ATTR_SALT = -2147415749,
314 CSSMERR_CSP_INVALID_ATTR_PADDING = -2147415748,
315 CSSMERR_CSP_MISSING_ATTR_PADDING = -2147415747,
316 CSSMERR_CSP_INVALID_ATTR_RANDOM = -2147415746,
317 CSSMERR_CSP_MISSING_ATTR_RANDOM = -2147415745,
318 CSSMERR_CSP_INVALID_ATTR_SEED = -2147415744,
319 CSSMERR_CSP_MISSING_ATTR_SEED = -2147415743,
320 CSSMERR_CSP_INVALID_ATTR_PASSPHRASE = -2147415742,
321 CSSMERR_CSP_MISSING_ATTR_PASSPHRASE = -2147415741,
322 CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH = -2147415740,
323 CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH = -2147415739,
324 CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE = -2147415738,
325 CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE = -2147415737,
326 CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE = -2147415708,
327 CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE = -2147415707,
328 CSSMERR_CSP_INVALID_ATTR_ROUNDS = -2147415706,
329 CSSMERR_CSP_MISSING_ATTR_ROUNDS = -2147415705,
330 CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS = -2147415704,
331 CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS = -2147415703,
332 CSSMERR_CSP_INVALID_ATTR_LABEL = -2147415702,
333 CSSMERR_CSP_MISSING_ATTR_LABEL = -2147415701,
334 CSSMERR_CSP_INVALID_ATTR_KEY_TYPE = -2147415700,
335 CSSMERR_CSP_MISSING_ATTR_KEY_TYPE = -2147415699,
336 CSSMERR_CSP_INVALID_ATTR_MODE = -2147415698,
337 CSSMERR_CSP_MISSING_ATTR_MODE = -2147415697,
338 CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS = -2147415696,
339 CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS = -2147415695,
340 CSSMERR_CSP_INVALID_ATTR_START_DATE = -2147415694,
341 CSSMERR_CSP_MISSING_ATTR_START_DATE = -2147415693,
342 CSSMERR_CSP_INVALID_ATTR_END_DATE = -2147415692,
343 CSSMERR_CSP_MISSING_ATTR_END_DATE = -2147415691,
344 CSSMERR_CSP_INVALID_ATTR_VERSION = -2147415690,
345 CSSMERR_CSP_MISSING_ATTR_VERSION = -2147415689,
346 CSSMERR_CSP_INVALID_ATTR_PRIME = -2147415688,
347 CSSMERR_CSP_MISSING_ATTR_PRIME = -2147415687,
348 CSSMERR_CSP_INVALID_ATTR_BASE = -2147415686,
349 CSSMERR_CSP_MISSING_ATTR_BASE = -2147415685,
350 CSSMERR_CSP_INVALID_ATTR_SUBPRIME = -2147415684,
351 CSSMERR_CSP_MISSING_ATTR_SUBPRIME = -2147415683,
352 CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT = -2147415682,
353 CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT = -2147415681,
354 CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE = -2147415680,
355 CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE = -2147415679,
356 CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS = -2147415678,
357 CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS = -2147415677,
358 CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT = -2147415676,
359 CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT = -2147415675,
360 CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT = -2147415674,
361 CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT = -2147415673,
362 CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT = -2147415672,
363 CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT = -2147415671,
364 CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT = -2147415670,
365 CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT = -2147415669,
366
367 CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS = -2147415736,
368 CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED = -2147415735,
369 CSSMERR_CSP_VERIFY_FAILED = -2147415734,
370 CSSMERR_CSP_INVALID_SIGNATURE = -2147415733,
371 CSSMERR_CSP_QUERY_SIZE_UNKNOWN = -2147415732,
372 CSSMERR_CSP_BLOCK_SIZE_MISMATCH = -2147415731,
373 CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND = -2147415730,
374 CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT = -2147415729,
375 CSSMERR_CSP_DEVICE_VERIFY_FAILED = -2147415728,
376 CSSMERR_CSP_INVALID_LOGIN_NAME = -2147415727,
377 CSSMERR_CSP_ALREADY_LOGGED_IN = -2147415726,
378 CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS = -2147415725,
379 CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS = -2147415724,
380 CSSMERR_CSP_INVALID_DIGEST_ALGORITHM = -2147415723,
381 CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED = -2147415722,
382 };
383
384
385 /* TP Error Values Derived from Common Error Codes For All Module Types. */
386 enum {
387 CSSMERR_TP_INTERNAL_ERROR = -2147409919,
388 CSSMERR_TP_MEMORY_ERROR = -2147409918,
389 CSSMERR_TP_MDS_ERROR = -2147409917,
390 CSSMERR_TP_INVALID_POINTER = -2147409916,
391 CSSMERR_TP_INVALID_INPUT_POINTER = -2147409915,
392 CSSMERR_TP_INVALID_OUTPUT_POINTER = -2147409914,
393 CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED = -2147409913,
394 CSSMERR_TP_SELF_CHECK_FAILED = -2147409912,
395 CSSMERR_TP_OS_ACCESS_DENIED = -2147409911,
396 CSSMERR_TP_FUNCTION_FAILED = -2147409910,
397 CSSMERR_TP_INVALID_CONTEXT_HANDLE = -2147409856,
398 CSSMERR_TP_INVALID_DATA = -2147409850,
399 CSSMERR_TP_INVALID_DB_LIST = -2147409844,
400 CSSMERR_TP_INVALID_CERTGROUP_POINTER = -2147409854,
401 CSSMERR_TP_INVALID_CERT_POINTER = -2147409853,
402 CSSMERR_TP_INVALID_CRL_POINTER = -2147409852,
403 CSSMERR_TP_INVALID_FIELD_POINTER = -2147409851,
404 CSSMERR_TP_INVALID_NETWORK_ADDR = -2147409833,
405 CSSMERR_TP_CRL_ALREADY_SIGNED = -2147409849,
406 CSSMERR_TP_INVALID_NUMBER_OF_FIELDS = -2147409848,
407 CSSMERR_TP_VERIFICATION_FAILURE = -2147409847,
408 CSSMERR_TP_INVALID_DB_HANDLE = -2147409846,
409 CSSMERR_TP_UNKNOWN_FORMAT = -2147409842,
410 CSSMERR_TP_UNKNOWN_TAG = -2147409841,
411 CSSMERR_TP_INVALID_PASSTHROUGH_ID = -2147409834,
412 CSSMERR_TP_INVALID_CSP_HANDLE = -2147409840,
413 CSSMERR_TP_INVALID_DL_HANDLE = -2147409839,
414 CSSMERR_TP_INVALID_CL_HANDLE = -2147409838,
415 CSSMERR_TP_INVALID_DB_LIST_POINTER = -2147409843,
416 };
417
418 /* TP Module-Specific Error Values */
419 enum {
420 CSSM_TP_BASE_TP_ERROR =
421 CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
422 CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER = -2147409663,
423 CSSMERR_TP_INVALID_IDENTIFIER_POINTER = -2147409662,
424 CSSMERR_TP_INVALID_KEYCACHE_HANDLE = -2147409661,
425 CSSMERR_TP_INVALID_CERTGROUP = -2147409660,
426 CSSMERR_TP_INVALID_CRLGROUP = -2147409659,
427 CSSMERR_TP_INVALID_CRLGROUP_POINTER = -2147409658,
428 CSSMERR_TP_AUTHENTICATION_FAILED = -2147409657,
429 CSSMERR_TP_CERTGROUP_INCOMPLETE = -2147409656,
430 CSSMERR_TP_CERTIFICATE_CANT_OPERATE = -2147409655,
431 CSSMERR_TP_CERT_EXPIRED = -2147409654,
432 CSSMERR_TP_CERT_NOT_VALID_YET = -2147409653,
433 CSSMERR_TP_CERT_REVOKED = -2147409652,
434 CSSMERR_TP_CERT_SUSPENDED = -2147409651,
435 CSSMERR_TP_INSUFFICIENT_CREDENTIALS = -2147409650,
436 CSSMERR_TP_INVALID_ACTION = -2147409649,
437 CSSMERR_TP_INVALID_ACTION_DATA = -2147409648,
438 CSSMERR_TP_INVALID_ANCHOR_CERT = -2147409646,
439 CSSMERR_TP_INVALID_AUTHORITY = -2147409645,
440 CSSMERR_TP_VERIFY_ACTION_FAILED = -2147409644,
441 CSSMERR_TP_INVALID_CERTIFICATE = -2147409643,
442 CSSMERR_TP_INVALID_CERT_AUTHORITY = -2147409642,
443 CSSMERR_TP_INVALID_CRL_AUTHORITY = -2147409641,
444 CSSMERR_TP_INVALID_CRL_ENCODING = -2147409640,
445 CSSMERR_TP_INVALID_CRL_TYPE = -2147409639,
446 CSSMERR_TP_INVALID_CRL = -2147409638,
447 CSSMERR_TP_INVALID_FORM_TYPE = -2147409637,
448 CSSMERR_TP_INVALID_ID = -2147409636,
449 CSSMERR_TP_INVALID_IDENTIFIER = -2147409635,
450 CSSMERR_TP_INVALID_INDEX = -2147409634,
451 CSSMERR_TP_INVALID_NAME = -2147409633,
452 CSSMERR_TP_INVALID_POLICY_IDENTIFIERS = -2147409632,
453 CSSMERR_TP_INVALID_TIMESTRING = -2147409631,
454 CSSMERR_TP_INVALID_REASON = -2147409630,
455 CSSMERR_TP_INVALID_REQUEST_INPUTS = -2147409629,
456 CSSMERR_TP_INVALID_RESPONSE_VECTOR = -2147409628,
457 CSSMERR_TP_INVALID_SIGNATURE = -2147409627,
458 CSSMERR_TP_INVALID_STOP_ON_POLICY = -2147409626,
459 CSSMERR_TP_INVALID_CALLBACK = -2147409625,
460 CSSMERR_TP_INVALID_TUPLE = -2147409624,
461 CSSMERR_TP_NOT_SIGNER = -2147409623,
462 CSSMERR_TP_NOT_TRUSTED = -2147409622,
463 CSSMERR_TP_NO_DEFAULT_AUTHORITY = -2147409621,
464 CSSMERR_TP_REJECTED_FORM = -2147409620,
465 CSSMERR_TP_REQUEST_LOST = -2147409619,
466 CSSMERR_TP_REQUEST_REJECTED = -2147409618,
467 CSSMERR_TP_UNSUPPORTED_ADDR_TYPE = -2147409617,
468 CSSMERR_TP_UNSUPPORTED_SERVICE = -2147409616,
469 CSSMERR_TP_INVALID_TUPLEGROUP_POINTER = -2147409615,
470 CSSMERR_TP_INVALID_TUPLEGROUP = -2147409614,
471 };
472
473 /* AC Error Values Derived from Common Error Codes For All Module Types. */
474 enum {
475 CSSMERR_AC_INTERNAL_ERROR = -2147405823,
476 CSSMERR_AC_MEMORY_ERROR = -2147405822,
477 CSSMERR_AC_MDS_ERROR = -2147405821,
478 CSSMERR_AC_INVALID_POINTER = -2147405820,
479 CSSMERR_AC_INVALID_INPUT_POINTER = -2147405819,
480 CSSMERR_AC_INVALID_OUTPUT_POINTER = -2147405818,
481 CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED = -2147405817,
482 CSSMERR_AC_SELF_CHECK_FAILED = -2147405816,
483 CSSMERR_AC_OS_ACCESS_DENIED = -2147405815,
484 CSSMERR_AC_FUNCTION_FAILED = -2147405814,
485 CSSMERR_AC_INVALID_CONTEXT_HANDLE = -2147405760,
486 CSSMERR_AC_INVALID_DATA = -2147405754,
487 CSSMERR_AC_INVALID_DB_LIST = -2147405748,
488 CSSMERR_AC_INVALID_PASSTHROUGH_ID = -2147405738,
489 CSSMERR_AC_INVALID_DL_HANDLE = -2147405743,
490 CSSMERR_AC_INVALID_CL_HANDLE = -2147405742,
491 CSSMERR_AC_INVALID_TP_HANDLE = -2147405741,
492 CSSMERR_AC_INVALID_DB_HANDLE = -2147405750,
493 CSSMERR_AC_INVALID_DB_LIST_POINTER = -2147405747,
494 };
495
496 /* AC Module-Specific Error Values */
497 enum {
498 CSSM_AC_BASE_AC_ERROR =
499 CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
500 CSSMERR_AC_INVALID_BASE_ACLS = -2147405567,
501 CSSMERR_AC_INVALID_TUPLE_CREDENTIALS = -2147405566,
502 CSSMERR_AC_INVALID_ENCODING = -2147405565,
503 CSSMERR_AC_INVALID_VALIDITY_PERIOD = -2147405564,
504 CSSMERR_AC_INVALID_REQUESTOR = -2147405563,
505 CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR = -2147405562,
506 };
507
508 /* CL Error Values Derived from Common Error Codes For All Module Types. */
509 enum {
510 CSSMERR_CL_INTERNAL_ERROR = -2147411967,
511 CSSMERR_CL_MEMORY_ERROR = -2147411966,
512 CSSMERR_CL_MDS_ERROR = -2147411965,
513 CSSMERR_CL_INVALID_POINTER = -2147411964,
514 CSSMERR_CL_INVALID_INPUT_POINTER = -2147411963,
515 CSSMERR_CL_INVALID_OUTPUT_POINTER = -2147411962,
516 CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED = -2147411961,
517 CSSMERR_CL_SELF_CHECK_FAILED = -2147411960,
518 CSSMERR_CL_OS_ACCESS_DENIED = -2147411959,
519 CSSMERR_CL_FUNCTION_FAILED = -2147411958,
520 CSSMERR_CL_INVALID_CONTEXT_HANDLE = -2147411904,
521 CSSMERR_CL_INVALID_CERTGROUP_POINTER = -2147411902,
522 CSSMERR_CL_INVALID_CERT_POINTER = -2147411901,
523 CSSMERR_CL_INVALID_CRL_POINTER = -2147411900,
524 CSSMERR_CL_INVALID_FIELD_POINTER = -2147411899,
525 CSSMERR_CL_INVALID_DATA = -2147411898,
526 CSSMERR_CL_CRL_ALREADY_SIGNED = -2147411897,
527 CSSMERR_CL_INVALID_NUMBER_OF_FIELDS = -2147411896,
528 CSSMERR_CL_VERIFICATION_FAILURE = -2147411895,
529 CSSMERR_CL_UNKNOWN_FORMAT = -2147411890,
530 CSSMERR_CL_UNKNOWN_TAG = -2147411889,
531 CSSMERR_CL_INVALID_PASSTHROUGH_ID = -2147411882,
532 };
533
534 /* CL Module-Specific Error Values */
535 enum {
536 CSSM_CL_BASE_CL_ERROR =
537 CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
538 CSSMERR_CL_INVALID_BUNDLE_POINTER = -2147411711,
539 CSSMERR_CL_INVALID_CACHE_HANDLE = -2147411710,
540 CSSMERR_CL_INVALID_RESULTS_HANDLE = -2147411709,
541 CSSMERR_CL_INVALID_BUNDLE_INFO = -2147411708,
542 CSSMERR_CL_INVALID_CRL_INDEX = -2147411707,
543 CSSMERR_CL_INVALID_SCOPE = -2147411706,
544 CSSMERR_CL_NO_FIELD_VALUES = -2147411705,
545 CSSMERR_CL_SCOPE_NOT_SUPPORTED = -2147411704,
546 };
547
548 /* DL Error Values Derived from Common Error Codes For All Module Types. */
549 enum {
550 CSSMERR_DL_INTERNAL_ERROR = -2147414015,
551 CSSMERR_DL_MEMORY_ERROR = -2147414014,
552 CSSMERR_DL_MDS_ERROR = -2147414013,
553 CSSMERR_DL_INVALID_POINTER = -2147414012,
554 CSSMERR_DL_INVALID_INPUT_POINTER = -2147414011,
555 CSSMERR_DL_INVALID_OUTPUT_POINTER = -2147414010,
556 CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED = -2147414009,
557 CSSMERR_DL_SELF_CHECK_FAILED = -2147414008,
558 CSSMERR_DL_OS_ACCESS_DENIED = -2147414007,
559 CSSMERR_DL_FUNCTION_FAILED = -2147414006,
560 CSSMERR_DL_INVALID_CSP_HANDLE = -2147413936,
561 CSSMERR_DL_INVALID_DL_HANDLE = -2147413935,
562 CSSMERR_DL_INVALID_CL_HANDLE = -2147413934,
563 CSSMERR_DL_INVALID_DB_LIST_POINTER = -2147413939,
564 };
565
566 /* DL Error Values Derived from ACL-based Error Codes. */
567 enum {
568 CSSMERR_DL_OPERATION_AUTH_DENIED = -2147413984,
569 CSSMERR_DL_OBJECT_USE_AUTH_DENIED = -2147413983,
570 CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED = -2147413982,
571 CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED = -2147413981,
572 CSSMERR_DL_OBJECT_ACL_REQUIRED = -2147413980,
573 CSSMERR_DL_INVALID_ACCESS_CREDENTIALS = -2147413979,
574 CSSMERR_DL_INVALID_ACL_BASE_CERTS = -2147413978,
575 CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED = -2147413977,
576 CSSMERR_DL_INVALID_SAMPLE_VALUE = -2147413976,
577 CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED = -2147413975,
578 CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE = -2147413974,
579 CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147413973,
580 CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK = -2147413972,
581 CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED = -2147413971,
582 CSSMERR_DL_INVALID_ACL_ENTRY_TAG = -2147413970,
583 CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND = -2147413969,
584 CSSMERR_DL_INVALID_ACL_EDIT_MODE = -2147413968,
585 CSSMERR_DL_ACL_CHANGE_FAILED = -2147413967,
586 CSSMERR_DL_INVALID_NEW_ACL_ENTRY = -2147413966,
587 CSSMERR_DL_INVALID_NEW_ACL_OWNER = -2147413965,
588 CSSMERR_DL_ACL_DELETE_FAILED = -2147413964,
589 CSSMERR_DL_ACL_REPLACE_FAILED = -2147413963,
590 CSSMERR_DL_ACL_ADD_FAILED = -2147413962,
591 };
592
593 /* DL Error Values for Specific Data Types. */
594 enum {
595 CSSMERR_DL_INVALID_DB_HANDLE = -2147413942,
596 CSSMERR_DL_INVALID_PASSTHROUGH_ID = -2147413930,
597 CSSMERR_DL_INVALID_NETWORK_ADDR = -2147413929,
598 };
599
600 /* DL Module-Specific Error Values */
601 enum {
602 CSSM_DL_BASE_DL_ERROR =
603 CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
604 CSSMERR_DL_DATABASE_CORRUPT = -2147413759,
605 CSSMERR_DL_INVALID_RECORD_INDEX = -2147413752,
606 CSSMERR_DL_INVALID_RECORDTYPE = -2147413751,
607 CSSMERR_DL_INVALID_FIELD_NAME = -2147413750,
608 CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT = -2147413749,
609 CSSMERR_DL_UNSUPPORTED_INDEX_INFO = -2147413748,
610 CSSMERR_DL_UNSUPPORTED_LOCALITY = -2147413747,
611 CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES = -2147413746,
612 CSSMERR_DL_UNSUPPORTED_NUM_INDEXES = -2147413745,
613 CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES = -2147413744,
614 CSSMERR_DL_UNSUPPORTED_RECORDTYPE = -2147413743,
615 CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE = -2147413742,
616 CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT = -2147413741,
617 CSSMERR_DL_INVALID_PARSING_MODULE = -2147413740,
618 CSSMERR_DL_INVALID_DB_NAME = -2147413738,
619 CSSMERR_DL_DATASTORE_DOESNOT_EXIST = -2147413737,
620 CSSMERR_DL_DATASTORE_ALREADY_EXISTS = -2147413736,
621 CSSMERR_DL_DB_LOCKED = -2147413735,
622 CSSMERR_DL_DATASTORE_IS_OPEN = -2147413734,
623 CSSMERR_DL_RECORD_NOT_FOUND = -2147413733,
624 CSSMERR_DL_MISSING_VALUE = -2147413732,
625 CSSMERR_DL_UNSUPPORTED_QUERY = -2147413731,
626 CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS = -2147413730,
627 CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS = -2147413729,
628 CSSMERR_DL_UNSUPPORTED_OPERATOR = -2147413727,
629 CSSMERR_DL_INVALID_RESULTS_HANDLE = -2147413726,
630 CSSMERR_DL_INVALID_DB_LOCATION = -2147413725,
631 CSSMERR_DL_INVALID_ACCESS_REQUEST = -2147413724,
632 CSSMERR_DL_INVALID_INDEX_INFO = -2147413723,
633 CSSMERR_DL_INVALID_SELECTION_TAG = -2147413722,
634 CSSMERR_DL_INVALID_NEW_OWNER = -2147413721,
635 CSSMERR_DL_INVALID_RECORD_UID = -2147413720,
636 CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA = -2147413719,
637 CSSMERR_DL_INVALID_MODIFY_MODE = -2147413718,
638 CSSMERR_DL_INVALID_OPEN_PARAMETERS = -2147413717,
639 CSSMERR_DL_RECORD_MODIFIED = -2147413716,
640 CSSMERR_DL_ENDOFDATA = -2147413715,
641 CSSMERR_DL_INVALID_QUERY = -2147413714,
642 CSSMERR_DL_INVALID_VALUE = -2147413713,
643 CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED = -2147413712,
644 CSSMERR_DL_STALE_UNIQUE_RECORD = -2147413711,
645 };
646
647
648 #ifdef __cplusplus
649 }
650 #endif
651
652 #endif /* _CSSMERR_H_ */