]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OTConstants.h
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / ot / OTConstants.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 OTConstants_h
25 #define OTConstants_h
26
27 #include <stdbool.h>
28
29 bool OctagonIsEnabled(void);
30 bool SecErrorIsNestedErrorCappingEnabled(void);
31
32 #if __OBJC__
33
34 #import <Foundation/Foundation.h>
35
36 extern NSString* OTDefaultContext;
37
38 extern NSErrorDomain const OctagonErrorDomain;
39
40 /* used for defaults writes */
41 extern NSString* OTDefaultsDomain;
42 extern NSString* OTDefaultsOctagonEnable;
43
44 extern NSString* OTProtocolPairing;
45 extern NSString* OTProtocolPiggybacking;
46
47 extern const char * OTTrustStatusChangeNotification;
48 extern NSString* OTEscrowRecordPrefix;
49
50
51 BOOL OctagonPlatformSupportsSOS(void);
52
53 // Used for testing.
54 void OctagonSetIsEnabled(BOOL value);
55 void OctagonSetPlatformSupportsSOS(BOOL value);
56
57 BOOL OctagonPerformSOSUpgrade(void);
58 void OctagonSetSOSUpgrade(BOOL value);
59
60 BOOL OctagonRecoveryKeyIsEnabled(void);
61 void OctagonRecoveryKeySetIsEnabled(BOOL value);
62
63 BOOL OctagonAuthoritativeTrustIsEnabled(void);
64 void OctagonAuthoritativeTrustSetIsEnabled(BOOL value);
65
66 BOOL OctagonIsSOSFeatureEnabled(void);
67 void OctagonSetSOSFeatureEnabled(BOOL value);
68
69 BOOL OctagonIsOptimizationEnabled(void);
70 void OctagonSetOptimizationEnabled(BOOL value);
71
72 BOOL OctagonIsEscrowRecordFetchEnabled(void);
73 void OctagonSetEscrowRecordFetchEnabled(BOOL value);
74
75 BOOL SecKVSOnCloudKitIsEnabled(void);
76 void SecKVSOnCloudKitSetOverrideIsEnabled(BOOL value);
77
78 void SecErrorSetOverrideNestedErrorCappingIsEnabled(BOOL value);
79
80 typedef NS_ENUM(NSInteger, CuttlefishResetReason) {
81 CuttlefishResetReasonUnknown = 0,
82 CuttlefishResetReasonUserInitiatedReset = 1,
83 CuttlefishResetReasonHealthCheck = 2,
84 CuttlefishResetReasonNoBottleDuringEscrowRecovery = 3,
85 CuttlefishResetReasonLegacyJoinCircle = 4,
86 CuttlefishResetReasonRecoveryKey = 5,
87 CuttlefishResetReasonTestGenerated = 6,
88 };
89
90 extern NSString* const CuttlefishErrorDomain;
91 extern NSString* const CuttlefishErrorRetryAfterKey;
92
93 #endif // __OBJC__
94
95 #endif /* OTConstants_h */