X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/914fc88e61be54aed6b18205ff2775b48793a3b6..866f8763175ff60e4fa455b92b5eb660a12fe6c7:/OSX/sec/SOSCircle/SecureObjectSync/SOSTransportKeyParameter.h diff --git a/OSX/sec/SOSCircle/SecureObjectSync/SOSTransportKeyParameter.h b/OSX/sec/SOSCircle/SecureObjectSync/SOSTransportKeyParameter.h index 0f1c4af8..6df1521e 100644 --- a/OSX/sec/SOSCircle/SecureObjectSync/SOSTransportKeyParameter.h +++ b/OSX/sec/SOSCircle/SecureObjectSync/SOSTransportKeyParameter.h @@ -2,36 +2,28 @@ #ifndef SOSTransportKeyParameter_h #define SOSTransportKeyParameter_h -#include -#include -#include - -typedef struct __OpaqueSOSTransportKeyParameter * SOSTransportKeyParameterRef; - -struct __OpaqueSOSTransportKeyParameter { - CFRuntimeBase _base; - SOSAccountRef account; - /* Connections from CF land to vtable land */ - CFStringRef (*copyDescription)(SOSTransportKeyParameterRef object); - void (*destroy)(SOSTransportKeyParameterRef object); - - - // TODO: Make this take broader parameters and assemble the key parameters blob? - bool (*publishCloudParameters)(SOSTransportKeyParameterRef transport, CFDataRef data, CFErrorRef* error); - bool (*handleKeyParameterChanges)(SOSTransportKeyParameterRef transport, CFDataRef data, CFErrorRef error); - bool (*setToNewAccount)(SOSTransportKeyParameterRef transport, SOSAccountRef account); - CFIndex (*getTransportType)(SOSTransportKeyParameterRef transport, CFErrorRef *error); -}; - -bool SOSTransportKeyParameterPublishCloudParameters(SOSTransportKeyParameterRef transport, CFDataRef data, CFErrorRef* error); - -SOSTransportKeyParameterRef SOSTransportKeyParameterCreateForSubclass(size_t size, SOSAccountRef account, CFErrorRef *error); -bool SOSTransportKeyParameterHandleKeyParameterChanges(SOSTransportKeyParameterRef transport, CFDataRef data, CFErrorRef error); -bool SOSTransportKeyParameterHandleNewAccount(SOSTransportKeyParameterRef transport, SOSAccountRef account); -CFTypeID SOSTransportKeyParameterGetTypeID(void); - -SOSAccountRef SOSTransportKeyParameterGetAccount(SOSTransportKeyParameterRef transport); -CFIndex SOSTransportKeyParameterGetTransportType(SOSTransportKeyParameterRef transport, CFErrorRef *error); -bool SOSTransportKeyParameterPublishLastKeyParameters(SOSTransportKeyParameterRef transport, CFDataRef Parameters, CFErrorRef *error); +#import + +@interface CKKeyParameter : NSObject +{ + SOSAccount* account; +} + +@property (atomic) SOSAccount* account; + +-(id) initWithAccount:(SOSAccount*) account; + +-(bool) SOSTransportKeyParameterPublishCloudParameters:(CKKeyParameter*) transport data:(CFDataRef)newParameters err:(CFErrorRef*) error; + +-(bool) SOSTransportKeyParameterHandleKeyParameterChanges:(CKKeyParameter*) transport data:(CFDataRef) data err:(CFErrorRef) error; +-(void) SOSTransportKeyParameterHandleNewAccount:(CKKeyParameter*) transport acct:(SOSAccount*) account; + +-(SOSAccount*) SOSTransportKeyParameterGetAccount:(CKKeyParameter*) transport; +-(CFIndex) SOSTransportKeyParameterGetTransportType:(CKKeyParameter*) transport err:(CFErrorRef *)error; + +-(bool) SOSTransportKeyParameterKVSAppendKeyInterests:(CKKeyParameter*)transport ak:(CFMutableArrayRef)alwaysKeys firstUnLock:(CFMutableArrayRef)afterFirstUnlockKeys unlocked:(CFMutableArrayRef) unlockedKeys err:(CFErrorRef *)error; + +@end + #endif