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