]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OTDefines.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / ot / OTDefines.h
1 /*
2 * Copyright (c) 2017 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 #ifndef OTDefines_h
25 #define OTDefines_h
26 #if OCTAGON
27 #include <Foundation/Foundation.h>
28 #include <utilities/debugging.h>
29 NS_ASSUME_NONNULL_BEGIN
30
31 extern NSString* const OctagonEventAttributeZoneName;
32 extern NSString* const OctagonEventAttributeFailureReason;
33 extern NSString* const OctagonEventAttributeTimeSinceLastPostedFollowUp;
34
35 extern NSString* OTCKContainerName;
36 extern NSString* const CuttlefishTrustZone;
37 extern NSString* const CuttlefishErrorDomain;
38 extern NSString* const TrustedPeersHelperErrorDomain;
39
40 /* Octagon Errors */
41 typedef enum {
42 OTErrorNoColumn = 1,
43 OTErrorKeyGeneration = 2,
44 OTErrorEmptySecret = 3,
45 OTErrorEmptyDSID = 4,
46 OTErrorNoIdentity = 5,
47 OTErrorRestoreFailed = 6,
48 OTErrorRestoredPeerEncryptionKeyFailure = 7,
49 OTErrorRestoredPeerSigningKeyFailure = 8,
50 OTErrorEntropyCreationFailure = 9,
51 OTErrorDeserializationFailure = 10,
52 OTErrorDecryptFailure = 11,
53 OTErrorPrivateKeyFailure = 12,
54 OTErrorEscrowSigningSPKI = 13,
55 OTErrorBottleID = 14,
56 OTErrorOTLocalStore = 15,
57 OTErrorOTCloudStore = 16,
58 OTErrorEmptyEscrowRecordID = 17,
59 OTErrorNoBottlePeerRecords = 18,
60 OTErrorCoreFollowUp = 19,
61 OTErrorFeatureNotEnabled = 20,
62 OTErrorCKCallback = 21,
63 OTErrorRampInit = 22,
64 OTErrorCKTimeOut = 23,
65 OTErrorNoNetwork = 24,
66 OTErrorNotSignedIn = 25,
67 OTErrorRecordNotFound = 26,
68 OTErrorNoEscrowKeys = 27,
69 OTErrorBottleUpdate = 28,
70 OTErrorNotSupported = 29,
71 OTErrorUnexpectedStateTransition = 30,
72 OTErrorNoSuchContext = 31,
73 OTErrorTimeout = 32,
74 OTErrorMasterKey = 33,
75 OTErrorNotTrusted = 34,
76 OTErrorLimitedPeer = 35,
77 OTErrorNoOctagonKeysInSOS = 36,
78 OTErrorNeedsAuthentication = 37,
79 OTErrorOctagonAdapter = 38,
80 OTErrorSOSAdapter = 39,
81 OctagonErrorNoAccount = 40,
82 } OctagonErrorCode;
83
84 #define OTMasterSecretLength 72
85
86 typedef enum {
87 OctagonSigningKey = 1,
88 OctagonEncryptionKey = 2
89 } OctagonKeyType;
90
91 typedef enum {
92 UNCLEAR = 0,
93 BOTTLE = 1,
94 NOBOTTLE = 2
95 } OctagonBottleCheckState;
96
97 typedef NS_ENUM(NSInteger, TrustedPeersHelperErrorCode) {
98 TrustedPeersHelperErrorNoPreparedIdentity = 1,
99 TrustedPeersHelperErrorNoPeersPreapprovePreparedIdentity = 14,
100 TrustedPeersHelperErrorCodeNotEnrolled = 34,
101 };
102
103 typedef NS_ENUM(NSInteger, CuttlefishErrorCode) {
104 CuttlefishErrorResultGraphNotFullyReachable = 1007,
105 CuttlefishErrorTransactionalFailure = 1019,
106 CuttlefishErrorKeyHierarchyAlreadyExists = 1033,
107 };
108
109 NS_ASSUME_NONNULL_END
110 #endif
111 #endif /* OTDefines_h */