CloudKitKeychainSyncingMockXCTest.h [plain text]
#if OCTAGON
#import "CloudKitMockXCTest.h"
#import "keychain/ckks/CKKS.h"
#import "keychain/ckks/CKKSControl.h"
#import "keychain/ckks/CKKSCurrentKeyPointer.h"
#import "keychain/ckks/CKKSItem.h"
NS_ASSUME_NONNULL_BEGIN
@class CKKSKey;
@class CKKSCurrentKeyPointer;
@interface ZoneKeys : CKKSCurrentKeySet
@property CKKSKey* rolledTLK;
- (instancetype)initLoadingRecordsFromZone:(FakeCKZone*)zone;
@end
@interface CloudKitKeychainSyncingMockXCTest : CloudKitMockXCTest
@property CKKSControl* ckksControl;
@property (nullable) id mockCKKSKey;
@property (nullable) CKKSSOSSelfPeer* currentSelfPeer;
@property (nullable) NSError* currentSelfPeerError;
@property (nullable) NSMutableSet<id<CKKSPeer>>* currentPeers;
@property (nullable) NSError* currentPeersError;
@property (nullable) NSError* keychainFetchError;
@property CKKSSOSPeer* remoteSOSOnlyPeer;
@property NSMutableSet<CKRecordZoneID*>* ckksZones;
@property (nullable) NSMutableDictionary<CKRecordZoneID*, ZoneKeys*>* keys;
- (ZoneKeys*)createFakeKeyHierarchy:(CKRecordZoneID*)zoneID oldTLK:(CKKSKey* _Nullable)oldTLK;
- (void)saveFakeKeyHierarchyToLocalDatabase:(CKRecordZoneID*)zoneID;
- (void)putFakeKeyHierarchyInCloudKit:(CKRecordZoneID*)zoneID;
- (void)saveTLKMaterialToKeychain:(CKRecordZoneID*)zoneID;
- (void)deleteTLKMaterialFromKeychain:(CKRecordZoneID*)zoneID;
- (void)saveTLKMaterialToKeychainSimulatingSOS:(CKRecordZoneID*)zoneID;
- (void)putFakeDeviceStatusInCloudKit:(CKRecordZoneID*)zoneID;
- (void)putFakeDeviceStatusInCloudKit:(CKRecordZoneID*)zoneID
zonekeys:(ZoneKeys*)zonekeys;
- (void)SOSPiggyBackAddToKeychain:(NSDictionary*)piggydata;
- (NSMutableDictionary*)SOSPiggyBackCopyFromKeychain;
- (NSMutableArray<NSData*>*)SOSPiggyICloudIdentities;
- (void)putTLKShareInCloudKit:(CKKSKey*)key
from:(CKKSSOSSelfPeer*)sharingPeer
to:(id<CKKSPeer>)receivingPeer
zoneID:(CKRecordZoneID*)zoneID;
- (void)putTLKSharesInCloudKit:(CKKSKey*)key from:(CKKSSOSSelfPeer*)sharingPeer zoneID:(CKRecordZoneID*)zoneID;
- (void)putSelfTLKSharesInCloudKit:(CKRecordZoneID*)zoneID;
- (void)saveTLKSharesInLocalDatabase:(CKRecordZoneID*)zoneID;
- (void)saveClassKeyMaterialToKeychain:(CKRecordZoneID*)zoneID;
- (void)createAndSaveFakeKeyHierarchy:(CKRecordZoneID*)zoneID;
- (void)rollFakeKeyHierarchyInCloudKit:(CKRecordZoneID*)zoneID;
- (NSDictionary*)fakeRecordDictionary:(NSString* _Nullable)account zoneID:(CKRecordZoneID*)zoneID;
- (CKRecord*)createFakeRecord:(CKRecordZoneID*)zoneID recordName:(NSString*)recordName;
- (CKRecord*)createFakeRecord:(CKRecordZoneID*)zoneID recordName:(NSString*)recordName withAccount:(NSString* _Nullable)account;
- (CKRecord*)createFakeRecord:(CKRecordZoneID*)zoneID
recordName:(NSString*)recordName
withAccount:(NSString* _Nullable)account
key:(CKKSKey* _Nullable)key;
- (CKKSItem*)newItem:(CKRecordID*)recordID withNewItemData:(NSDictionary*) dictionary key:(CKKSKey*)key;
- (CKRecord*)newRecord:(CKRecordID*)recordID withNewItemData:(NSDictionary*)dictionary;
- (CKRecord*)newRecord:(CKRecordID*)recordID withNewItemData:(NSDictionary*)dictionary key:(CKKSKey*)key;
- (NSDictionary*)decryptRecord:(CKRecord*)record;
- (void)addGenericPassword:(NSString*)password account:(NSString*)account;
- (void)addGenericPassword:(NSString*)password account:(NSString*)account viewHint:(NSString* _Nullable)viewHint;
- (void)addGenericPassword:(NSString*)password
account:(NSString*)account
viewHint:(NSString* _Nullable)viewHint
access:(NSString*)access
expecting:(OSStatus)status
message:(NSString*)message;
- (void)addGenericPassword:(NSString*)password account:(NSString*)account expecting:(OSStatus)status message:(NSString*)message;
- (void)updateGenericPassword:(NSString*)newPassword account:(NSString*)account;
- (void)updateAccountOfGenericPassword:(NSString*)newAccount account:(NSString*)account;
- (void)checkNoCKKSData:(CKKSKeychainView*)view;
- (void)deleteGenericPassword:(NSString*)account;
- (void)findGenericPassword:(NSString*)account expecting:(OSStatus)status;
- (void)checkGenericPassword:(NSString*)password account:(NSString*)account;
- (void)createClassCItemAndWaitForUpload:(CKRecordZoneID*)zoneID account:(NSString*)account;
- (void)createClassAItemAndWaitForUpload:(CKRecordZoneID*)zoneID account:(NSString*)account;
- (BOOL (^)(CKRecord*))checkClassABlock:(CKRecordZoneID*)zoneID message:(NSString*)message;
- (BOOL (^)(CKRecord*))checkClassCBlock:(CKRecordZoneID*)zoneID message:(NSString*)message;
- (BOOL (^)(CKRecord*))checkPasswordBlock:(CKRecordZoneID*)zoneID account:(NSString*)account password:(NSString*)password;
- (void)checkNSyncableTLKsInKeychain:(size_t)n;
- (XCTestExpectation*)expectChangeForView:(NSString*)view;
- (void)expectCKReceiveSyncKeyHierarchyError:(CKRecordZoneID*)zoneID;
- (void)expectCKKSTLKSelfShareUpload:(CKRecordZoneID*)zoneID;
@end
NS_ASSUME_NONNULL_END
#endif