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,
95 #define OTMasterSecretLength 72
97 typedef NS_ENUM(NSInteger
, TrustedPeersHelperErrorCode
) {
98 TrustedPeersHelperErrorNoPreparedIdentity
= 1,
99 TrustedPeersHelperErrorNoPeersPreapprovePreparedIdentity
= 14,
100 TrustedPeersHelperErrorCodeNotEnrolled
= 34,
103 // See cuttlefish/CuttlefishService/Sources/CuttlefishService/CuttlefishError.swift
104 typedef NS_ENUM(NSInteger
, CuttlefishErrorCode
) {
105 CuttlefishErrorEstablishFailed
= 1001,
106 CuttlefishErrorJoinFailed
= 1002,
107 CuttlefishErrorUpdateTrustFailed
= 1004,
108 CuttlefishErrorInvalidChangeToken
= 1005,
109 CuttlefishErrorMalformedRecord
= 1006,
110 CuttlefishErrorResultGraphNotFullyReachable
= 1007,
111 CuttlefishErrorResultGraphHasNoPotentiallyTrustedPeers
= 1008,
112 CuttlefishErrorResultGraphHasSplitKnowledge
= 1009,
113 CuttlefishErrorResultGraphHasPeerWithNoSelf
= 1010,
114 CuttlefishErrorInvalidEscrowProxyOperation
= 1011,
115 CuttlefishErrorRecordWrongType
= 1012,
116 CuttlefishErrorMissingMandatoryField
= 1013,
117 CuttlefishErrorMalformedViewKeyHierarchy
= 1014,
118 CuttlefishErrorUnknownView
= 1015,
119 CuttlefishErrorEstablishPeerFailed
= 1016,
120 CuttlefishErrorEstablishBottleFailed
= 1017,
121 CuttlefishErrorChangeTokenExpired
= 1018,
122 CuttlefishErrorTransactionalFailure
= 1019,
123 CuttlefishErrorSetRecoveryKeyFailed
= 1020,
124 CuttlefishErrorRetryableServerFailure
= 1021,
125 CuttlefishErrorPreflightGraphValidationError
= 1022,
126 CuttlefishErrorKeyHierarchyAlreadyExists
= 1033,
127 CuttlefishErrorDuplicatePeerIdUnderConsideration
= 1034,
130 NS_ASSUME_NONNULL_END
132 #endif /* OTDefines_h */