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