]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OTDefines.h
Security-59754.41.1.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 #import "keychain/ot/OTConstants.h"
30
31 NS_ASSUME_NONNULL_BEGIN
32
33 extern NSString* const OctagonEventAttributeZoneName;
34 extern NSString* const OctagonEventAttributeFailureReason;
35 extern NSString* const OctagonEventAttributeTimeSinceLastPostedFollowUp;
36
37 extern NSString* OTCKContainerName;
38 extern NSString* const CuttlefishTrustZone;
39 extern NSString* const TrustedPeersHelperErrorDomain;
40
41 /* Octagon Errors */
42 typedef NS_ERROR_ENUM(OctagonErrorDomain, OctagonError) {
43 //OTErrorNoColumn = 1,
44 //OTErrorKeyGeneration = 2,
45 //OTErrorEmptySecret = 3,
46 //OTErrorEmptyDSID = 4,
47 OTErrorNoIdentity = 5,
48 //OTErrorRestoreFailed = 6,
49 //OTErrorRestoredPeerEncryptionKeyFailure = 7,
50 //OTErrorRestoredPeerSigningKeyFailure = 8,
51 //OTErrorEntropyCreationFailure = 9,
52 OTErrorDeserializationFailure = 10,
53 //OTErrorDecryptFailure = 11,
54 //OTErrorPrivateKeyFailure = 12,
55 //OTErrorEscrowSigningSPKI = 13,
56 //OTErrorBottleID = 14,
57 //OTErrorOTLocalStore = 15,
58 //OTErrorOTCloudStore = 16,
59 //OTErrorEmptyEscrowRecordID = 17,
60 //OTErrorNoBottlePeerRecords = 18,
61 //OTErrorCoreFollowUp = 19,
62 OTErrorFeatureNotEnabled = 20,
63 OTErrorCKCallback = 21,
64 //OTErrorRampInit = 22,
65 OTErrorCKTimeOut = 23,
66 OTErrorNoNetwork = 24,
67 OTErrorNotSignedIn = 25,
68 OTErrorRecordNotFound = 26,
69 //OTErrorNoEscrowKeys = 27,
70 //OTErrorBottleUpdate = 28,
71 OTErrorNotSupported = 29,
72 OTErrorUnexpectedStateTransition = 30,
73 OTErrorNoSuchContext = 31,
74 //OTErrorTimeout = 32,
75 //OTErrorMasterKey = 33,
76 //OTErrorNotTrusted = 34,
77 OTErrorLimitedPeer = 35,
78 //OTErrorNoOctagonKeysInSOS = 36,
79 //OTErrorNeedsAuthentication = 37,
80 OTErrorOctagonAdapter = 38,
81 OTErrorSOSAdapter = 39,
82 //OctagonErrorNoAccount = 40,
83 OTErrorRecoveryKeyMalformed = 41,
84 OTAuthKitNoAltDSID = 42,
85 OTAuthKitAKDeviceListRequestContextClass = 43,
86 OTAuthKitNoPrimaryAccount = 44,
87 OTAuthKitNoAuthenticationController = 45,
88 OTAuthKitMachineIDMissing = 46,
89 OTAuthKitPrimaryAccountHaveNoDSID = 47,
90 OTErrorFailedToLeaveClique = 48,
91 OTErrorSyncPolicyMissing = 49,
92 };
93
94 #define OTMasterSecretLength 72
95
96 typedef NS_ENUM(NSInteger, TrustedPeersHelperErrorCode) {
97 TrustedPeersHelperErrorNoPreparedIdentity = 1,
98 TrustedPeersHelperErrorNoPeersPreapprovePreparedIdentity = 14,
99 TrustedPeersHelperErrorCodeUntrustedRecoveryKeys = 32,
100 TrustedPeersHelperErrorCodeNotEnrolled = 34,
101 TrustedPeersHelperErrorNoPeersPreapprovedBySelf = 47,
102 };
103
104 // See cuttlefish/CuttlefishService/Sources/CuttlefishService/CuttlefishError.swift
105 typedef NS_ENUM(NSInteger, CuttlefishErrorCode) {
106 CuttlefishErrorEstablishFailed = 1001,
107 CuttlefishErrorJoinFailed = 1002,
108 CuttlefishErrorUpdateTrustFailed = 1004,
109 CuttlefishErrorInvalidChangeToken = 1005,
110 CuttlefishErrorMalformedRecord = 1006,
111 CuttlefishErrorResultGraphNotFullyReachable = 1007,
112 CuttlefishErrorResultGraphHasNoPotentiallyTrustedPeers = 1008,
113 CuttlefishErrorResultGraphHasSplitKnowledge = 1009,
114 CuttlefishErrorResultGraphHasPeerWithNoSelf = 1010,
115 CuttlefishErrorInvalidEscrowProxyOperation = 1011,
116 CuttlefishErrorRecordWrongType = 1012,
117 CuttlefishErrorMissingMandatoryField = 1013,
118 CuttlefishErrorMalformedViewKeyHierarchy = 1014,
119 CuttlefishErrorUnknownView = 1015,
120 CuttlefishErrorEstablishPeerFailed = 1016,
121 CuttlefishErrorEstablishBottleFailed = 1017,
122 CuttlefishErrorChangeTokenExpired = 1018,
123 CuttlefishErrorTransactionalFailure = 1019,
124 CuttlefishErrorSetRecoveryKeyFailed = 1020,
125 CuttlefishErrorRetryableServerFailure = 1021,
126 CuttlefishErrorPreflightGraphValidationError = 1022,
127 CuttlefishErrorKeyHierarchyAlreadyExists = 1033,
128 CuttlefishErrorDuplicatePeerIdUnderConsideration = 1034,
129 CuttlefishErrorIneligibleExclusionDenied = 1035,
130 CuttlefishErrorMultiplePreapprovedJoinDenied = 1036,
131 CuttlefishErrorUpdateTrustPeerNotFound = 1037,
132 };
133
134 NS_ASSUME_NONNULL_END
135 #endif
136 #endif /* OTDefines_h */