]> git.saurik.com Git - apple/security.git/blob - sec/Security/SecBasePriv.h
Security-55178.0.1.tar.gz
[apple/security.git] / sec / Security / SecBasePriv.h
1 /*
2 * Copyright (c) 2008-2009 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 @header SecBasePriv
26 SecBasePriv contains private error codes from the Security framework.
27 */
28
29 #ifndef _SECURITY_SECBASEPRIV_H_
30 #define _SECURITY_SECBASEPRIV_H_
31
32 #include <Security/SecBase.h>
33 #include <MacErrors.h>
34
35 #if defined(__cplusplus)
36 extern "C" {
37 #endif
38
39 /*******************************************************
40 *** Private OSStatus values unique to Security APIs ***
41 *******************************************************/
42
43 /*
44 Note: the comments that appear after these errors are used to create SecErrorMessages.strings.
45 The comments must not be multi-line, and should be in a form meaningful to an end user. If
46 a different or additional comment is needed, it can be put in the header doc format, or on a
47 line that does not start with errZZZ.
48 */
49
50 enum
51 {
52 errSecReadOnly = -25292, /* This keychain cannot be modified. */
53 errSecNoSuchKeychain = -25294, /* The specified keychain could not be found. */
54 errSecInvalidKeychain = -25295, /* The specified keychain is not a valid keychain file. */
55 errSecDuplicateKeychain = -25296, /* A keychain with the same name already exists. */
56 errSecDuplicateCallback = -25297, /* The specified callback function is already installed. */
57 errSecInvalidCallback = -25298, /* The specified callback function is not valid. */
58 errSecBufferTooSmall = -25301, /* There is not enough memory available to use the specified item. */
59 errSecDataTooLarge = -25302, /* This item contains information which is too large or in a format that cannot be displayed. */
60 errSecNoSuchAttr = errSecParam, // -25303, /* The specified attribute does not exist. */
61 errSecInvalidItemRef = -25304, /* The specified item is no longer valid. It may have been deleted from the keychain. */
62 errSecInvalidSearchRef = -25305, /* Unable to search the current keychain. */
63 errSecNoSuchClass = errSecParam, // -25306, /* The specified item does not appear to be a valid keychain item. */
64 errSecNoDefaultKeychain = -25307, /* A default keychain could not be found. */
65 errSecReadOnlyAttr = -25309, /* The specified attribute could not be modified. */
66 errSecWrongSecVersion = -25310, /* This keychain was created by a different version of the system software and cannot be opened. */
67 errSecKeySizeNotAllowed = errSecParam, // -25311, /* This item specifies a key size which is too large. */
68 errSecNoStorageModule = -25312, /* A required component (data storage module) could not be loaded. You may need to restart your computer. */
69 errSecNoCertificateModule = -25313, /* A required component (certificate module) could not be loaded. You may need to restart your computer. */
70 errSecNoPolicyModule = -25314, /* A required component (policy module) could not be loaded. You may need to restart your computer. */
71 errSecInteractionRequired = -25315, /* User interaction is required, but is currently not allowed. */
72 errSecDataNotAvailable = -25316, /* The contents of this item cannot be retrieved. */
73 errSecDataNotModifiable = -25317, /* The contents of this item cannot be modified. */
74 errSecCreateChainFailed = -25318, /* One or more certificates required to validate this certificate cannot be found. */
75 errSecACLNotSimple = -25240, /* The specified access control list is not in standard (simple) form. */
76 errSecInvalidTrustSetting = -25242, /* The specified trust setting is invalid. */
77 errSecNoAccessForItem = -25243, /* The specified item has no access control. */
78 errSecInvalidOwnerEdit = -25244, /* Invalid attempt to change the owner of this item. */
79 errSecInvalidPrefsDomain = -25319, /* The specified preferences domain is not valid. */
80 errSecTrustNotAvailable = -25245, /* No trust results are available. */
81 errSecUnsupportedFormat = -25256, /* Import/Export format unsupported. */
82 errSecUnknownFormat = -25257, /* Unknown format in import. */
83 errSecKeyIsSensitive = -25258, /* Key material must be wrapped for export. */
84 errSecMultiplePrivKeys = -25259, /* An attempt was made to import multiple private keys. */
85 errSecPassphraseRequired = -25260, /* Passphrase is required for import/export. */
86 errSecInvalidPasswordRef = -25261, /* The password reference was invalid. */
87 errSecInvalidTrustSettings = -25262, /* The Trust Settings record was corrupted. */
88 errSecNoTrustSettings = -25263, /* No Trust Settings were found. */
89 errSecPkcs12VerifyFailure = -25264, /* MAC verification failed during PKCS12 import. */
90 errSecInvalidCertificate = errSecDecode, // -26265, /* This certificate could not be decoded. */
91 errSecNotSigner = -26267, /* A certificate was not signed by its proposed parent. */
92 errSecPolicyDenied = -26270, /* The certificate chain was not trusted due to a policy not accepting it. */
93 errSecInvalidKey = errSecDecode, // -26274, /* The provided key material was not valid. */
94 errSecInternal = -26276, /* An internal error occured in the Security framework. */
95 errSecUnsupportedAlgorithm = errSecUnimplemented, // -26268, /* An unsupported algorithm was encountered. */
96 errSecUnsupportedOperation = errSecUnimplemented, // -26271, /* The operation you requested is not supported by this key. */
97 errSecUnsupportedPadding = errSecParam, // -26273, /* The padding you requested is not supported. */
98 errSecItemInvalidKey = errSecParam, // -34000, /* A string key in dictionary is not one of the supported keys. */
99 errSecItemInvalidKeyType = errSecParam, // -34001, /* A key in a dictionary is neither a CFStringRef nor a CFNumberRef. */
100 errSecItemInvalidValue = errSecParam, // -34002, /* A value in a dictionary is an invalid (or unsupported) CF type. */
101 errSecItemClassMissing = errSecParam, // -34003, /* No kSecItemClass key was specified in a dictionary. */
102 errSecItemMatchUnsupported = errSecParam, // -34004, /* The caller passed one or more kSecMatch keys to a function which does not support matches. */
103 errSecUseItemListUnsupported = errSecParam, // -34005, /* The caller passed in a kSecUseItemList key to a function which does not support it. */
104 errSecUseKeychainUnsupported = errSecParam, // -34006, /* The caller passed in a kSecUseKeychain key to a function which does not support it. */
105 errSecUseKeychainListUnsupported = errSecParam, // -34007, /* The caller passed in a kSecUseKeychainList key to a function which does not support it. */
106 errSecReturnDataUnsupported = errSecParam, // -34008, /* The caller passed in a kSecReturnData key to a function which does not support it. */
107 errSecReturnAttributesUnsupported = errSecParam, // -34009, /* The caller passed in a kSecReturnAttributes key to a function which does not support it. */
108 errSecReturnRefUnsupported = errSecParam, // -34010, /* The caller passed in a kSecReturnRef key to a function which does not support it. */
109 errSecValueRefUnsupported = errSecParam, // -34012, /* The caller passed in a kSecValueRef key to a function which does not support it. */
110 errSecValuePersistentRefUnsupported = errSecParam, // -34013, /* The caller passed in a kSecValuePersistentRef key to a function which does not support it. */
111 errSecReturnMissingPointer = errSecParam, // -34014, /* The caller passed asked for something to be returned but did not pass in a result pointer. */
112 errSecMatchLimitUnsupported = errSecParam, // -34015, /* The caller passed in a kSecMatchLimit key to a call which does not support limits. */
113 errSecItemIllegalQuery = errSecParam, // -34016, /* The caller passed in a query which contained too many keys. */
114 errSecWaitForCallback = -34017, /* This operation is incomplete, until the callback is invoked (not an error). */
115 errSecMissingEntitlement = -34018, /* Internal error when a required entitlement isn't present. */
116 errSecUpgradePending = -34019, /* Error returned if keychain database needs a schema migration but the device is locked, clients should wait for a device unlock notification and retry the command. */
117
118 errSecMPSignatureInvalid = -25327, /* Signature invalid on MP message */
119 errSecOTRTooOld = -25328, /* Message is too old to use */
120 errSecOTRIDTooNew = -25329, /* Key ID is too new to use! Message from the future? */
121
122 };
123
124
125 #if defined(__cplusplus)
126 }
127 #endif
128
129 #endif /* !_SECURITY_SECBASEPRIV_H_ */