]> git.saurik.com Git - apple/security.git/blob - keychain/ot/tests/OTTestsBase.h
Security-58286.51.6.tar.gz
[apple/security.git] / keychain / ot / tests / OTTestsBase.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 #if OCTAGON
25
26 #ifndef OTTestsBase_h
27 #define OTTestsBase_h
28
29 #import <Foundation/Foundation.h>
30 #import <XCTest/XCTest.h>
31 #import <OCMock/OCMock.h>
32
33 #import "keychain/ot/OTContext.h"
34 #import "keychain/ot/OTEscrowKeys.h"
35 #import "keychain/ot/OTDefines.h"
36 #import "keychain/ot/OTControl.h"
37 #import "keychain/ot/OTManager.h"
38 #import "SFPublicKey+SPKI.h"
39 #import <Security/SecKey.h>
40
41 #import <SecurityFoundation/SFKey.h>
42 #import <SecurityFoundation/SFKey_Private.h>
43
44 #import "keychain/ckks/tests/CloudKitKeychainSyncingTestsBase.h"
45 #import "keychain/ckks/tests/CloudKitMockXCTest.h"
46 #import "keychain/ckks/tests/MockCloudKit.h"
47 #import "keychain/ckks/tests/CKKSTests.h"
48 #import "keychain/ckks/CKKS.h"
49 #import "keychain/ckks/CKKSViewManager.h"
50
51 NS_ASSUME_NONNULL_BEGIN
52
53 @interface OTTestsBase : CloudKitKeychainSyncingTestsBase <OTContextIdentityProvider>
54 @property id otControl;
55 @property OTManager* manager;
56 @property (nonatomic, strong) OTCloudStore* cloudStore;
57 @property (nonatomic, strong) OTLocalStore* localStore;
58 @property (nonatomic, strong) FakeCKZone* otFakeZone;
59 @property (nonatomic, strong) CKRecordZoneID* otZoneID;
60 @property (nonatomic, strong) OTContext* context;
61 @property (nonatomic, strong) _SFECKeyPair* peerSigningKey;
62 @property (nonatomic, strong) _SFECKeyPair* peerEncryptionKey;
63 @property (nonatomic, strong) NSData* secret;
64 @property (nonatomic, strong) NSString* recordName;
65 @property (nonatomic, strong) NSString* egoPeerID;
66 @property (nonatomic, strong) NSString* sosPeerID;
67 @property (nonatomic, strong) OTEscrowKeys* escrowKeys;
68
69 @property (nonatomic, strong) FakeCKZone* rampZone;
70 @property (nonatomic, strong) CKRecord *enrollRampRecord;
71 @property (nonatomic, strong) CKRecord *restoreRampRecord;
72 @property (nonatomic, strong) CKRecord *cfuRampRecord;
73
74 @property (nonatomic, strong) OTRamp *enroll;
75 @property (nonatomic, strong) OTRamp *restore;
76 @property (nonatomic, strong) OTRamp *cfu;
77 @property (nonatomic, strong) CKKSNearFutureScheduler* scheduler;
78 @property (nonatomic, strong) XCTestExpectation *expectation;
79 @property (nonatomic, strong) XCTestExpectation *spiBlockExpectation;
80
81 @property (nonatomic, strong) CKRecordZoneID* rampZoneID;
82
83 -(OTRamp*) fakeRamp:(NSString*)recordName featureName:(NSString*)featureName;
84
85 -(void)expectAddedCKModifyRecords:(NSDictionary<NSString*, NSNumber*>*)records holdFetch:(BOOL)shouldHoldTheFetch;
86 -(void)expectDeletedCKModifyRecords:(NSDictionary<NSString*, NSNumber*>*)records holdFetch:(BOOL)shouldHoldTheFetch;
87 -(void) setUpRampRecordsInCloudKitWithFeatureOn;
88 -(void) setUpRampRecordsInCloudKitWithFeatureOff;
89
90 @end
91 NS_ASSUME_NONNULL_END
92
93 #endif /* OTTestsBase_h */
94 #endif /* OCTAGON */