2 #import <Foundation/Foundation.h>
3 #import <objc/runtime.h>
5 #import "keychain/escrowrequest/EscrowRequestXPCProtocol.h"
6 #import "utilities/debugging.h"
8 NSXPCInterface* SecEscrowRequestSetupControlProtocol(NSXPCInterface* interface) {
9 static NSMutableSet *errClasses;
11 static dispatch_once_t onceToken;
13 dispatch_once(&onceToken, ^{
14 errClasses = [NSMutableSet set];
29 for (unsigned n = 0; n < sizeof(classes)/sizeof(classes[0]); n++) {
30 Class cls = objc_getClass(classes[n]);
32 [errClasses addObject:cls];
38 [interface setClasses:errClasses forSelector:@selector(triggerEscrowUpdate:reply:) argumentIndex:0 ofReply:YES];
39 [interface setClasses:errClasses forSelector:@selector(cachePrerecord:serializedPrerecord:reply:) argumentIndex:0 ofReply:YES];
40 [interface setClasses:errClasses forSelector:@selector(fetchPrerecord:reply:) argumentIndex:1 ofReply:YES];
41 [interface setClasses:errClasses forSelector:@selector(fetchRequestWaitingOnPasscode:) argumentIndex:1 ofReply:YES];
44 @catch(NSException* e) {
45 secerror("SecEscrowRequestSetupControlProtocol failed, continuing, but you might crash later: %@", e);