5 // Created by Richard Murphy on 1/26/15.
9 #ifndef _sec_SOSPeerInfoV2_
10 #define _sec_SOSPeerInfoV2_
12 #include <CoreFoundation/CFRuntime.h>
13 #include <CoreFoundation/CoreFoundation.h>
14 #include <Security/SecureObjectSync/SOSPeerInfo.h>
15 #include <Security/SecureObjectSync/SOSViews.h>
17 // Description Dictionary Entries Added for V2
18 extern CFStringRef sV2DictionaryKey
; // CFData wrapper for V2 extensions
19 extern CFStringRef sViewsKey
; // Set of Views
20 extern CFStringRef sSerialNumberKey
; // Device Serial Number
21 extern CFStringRef sMachineIDKey
; // Account MID
22 extern CFStringRef kSOSHsaCrKeyDictionary
; // HSA Challenge-Response area
23 extern CFStringRef sPreferIDS
; // Whether or not a peer requires to speak over IDS or KVS
24 extern CFStringRef sPreferIDSFragmentation
; // Whether or not a peer requires to speak over fragmented IDS or not
25 extern CFStringRef sPreferIDSACKModel
; //If a peer prefers to use the ACK model and not ping
27 extern CFStringRef sTransportType
; // Dictates the transport type
28 extern CFStringRef sDeviceID
; // The IDS device id
29 extern CFStringRef sRingState
; // Dictionary of Ring Membership States
30 extern CFStringRef sBackupKeyKey
;
31 extern CFStringRef sEscrowRecord
;
33 extern CFStringRef sCKKSForAll
;
35 bool SOSPeerInfoUpdateToV2(SOSPeerInfoRef pi
, CFErrorRef
*error
);
36 void SOSPeerInfoPackV2Data(SOSPeerInfoRef peer
);
37 bool SOSPeerInfoExpandV2Data(SOSPeerInfoRef pi
, CFErrorRef
*error
);
38 void SOSPeerInfoV2DictionarySetValue(SOSPeerInfoRef peer
, const void *key
, const void *value
);
39 void SOSPeerInfoV2DictionaryRemoveValue(SOSPeerInfoRef peer
, const void *key
);
41 CFMutableDataRef
SOSPeerInfoV2DictionaryCopyData(SOSPeerInfoRef pi
, const void *key
);
42 CFMutableSetRef
SOSPeerInfoV2DictionaryCopySet(SOSPeerInfoRef pi
, const void *key
);
43 CFMutableStringRef
SOSPeerInfoV2DictionaryCopyString(SOSPeerInfoRef pi
, const void *key
);
44 CFBooleanRef
SOSPeerInfoV2DictionaryCopyBoolean(SOSPeerInfoRef pi
, const void *key
);
45 CFMutableDictionaryRef
SOSPeerInfoV2DictionaryCopyDictionary(SOSPeerInfoRef pi
, const void *key
);
46 SOSPeerInfoRef
SOSPeerInfoCopyWithV2DictionaryUpdate(CFAllocatorRef allocator
, SOSPeerInfoRef toCopy
, CFDictionaryRef newv2dict
, SecKeyRef signingKey
, CFErrorRef
* error
);
48 bool SOSPeerInfoV2DictionaryHasSet(SOSPeerInfoRef pi
, const void *key
);
49 bool SOSPeerInfoV2DictionaryHasData(SOSPeerInfoRef pi
, const void *key
);
50 bool SOSPeerInfoV2DictionaryHasString(SOSPeerInfoRef pi
, const void *key
);
51 bool SOSPeerInfoV2DictionaryHasBoolean(SOSPeerInfoRef pi
, const void *key
);
53 bool SOSPeerInfoV2DictionaryHasStringValue(SOSPeerInfoRef pi
, const void *key
, CFStringRef value
);
55 bool SOSPeerInfoV2DictionaryHasSetContaining(SOSPeerInfoRef pi
, const void *key
, const void* value
);
56 void SOSPeerInfoV2DictionaryForEachSetValue(SOSPeerInfoRef pi
, const void *key
, void (^action
)(const void* value
));
57 void SOSPeerInfoV2DictionaryWithSet(SOSPeerInfoRef pi
, const void *key
, void(^operation
)(CFSetRef set
));
60 bool SOSPeerInfoSerialNumberIsSet(SOSPeerInfoRef pi
);
61 void SOSPeerInfoSetSerialNumber(SOSPeerInfoRef pi
);
62 void SOSPeerInfoSetTestSerialNumber(SOSPeerInfoRef pi
, CFStringRef serialNumber
);
64 #endif /* defined(_sec_SOSPeerInfoV2_) */