1 // Copyright (c) 2018 Apple Inc. All rights reserved.
3 #import "OctagonTestHarnessXPCService.h"
5 #import <objc/runtime.h>
6 #import <Security/CKKSControlProtocol.h>
7 #import <Security/SecAccessControlPriv.h>
8 #import "SecDbKeychainItem.h"
9 #import "SecRemoteDevice.h"
12 @interface OctagonTestHarnessXPCService ()
13 @property (strong) SecRemoteDevice *remoteDevice;
16 #pragma clang diagnostic push
17 #pragma clang diagnostic ignored "-Wprotocol"
19 @implementation OctagonTestHarnessXPCService
21 - (instancetype)init {
22 if ((self = [super init]) != NULL) {
23 self.remoteDevice = [SecRemoteDevice new];
24 if (self.remoteDevice == nil) {
31 - (void)octagonReset:(NSString *)altDSID complete:(void (^)(NSNumber *, NSError *))complete {
33 [self.remoteDevice otReset:altDSID complete:^(bool success, NSError * _Nullable error) {
34 complete([NSNumber numberWithBool:success], error);
38 - (void)octagonPeerID:(NSString *)altDSID complete:(void (^)(NSString *, NSError *))complete {
40 [self.remoteDevice otPeerID:altDSID complete:^(NSString *peerID, NSError * _Nullable error) {
41 complete(peerID, error);
45 - (void)octagonInCircle:(NSString *)altDSID complete:(void (^)(NSNumber *, NSError *_Nullable error))complete
47 [self.remoteDevice otInCircle:altDSID complete:^(bool inCircle, NSError * _Nullable error) {
48 complete(@(inCircle), error);
57 #pragma clang diagnostic pop