]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSAccountLog.m
Security-58286.220.15.tar.gz
[apple/security.git] / OSX / sec / SOSCircle / SecureObjectSync / SOSAccountLog.m
1 //
2 // SOSAccountLog.c
3 // sec
4 //
5 #import <Security/SecureObjectSync/SOSAccountPriv.h>
6 #include "SOSAccountLog.h"
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <assert.h>
10 #include <AssertMacros.h>
11 #include "SOSAccountPriv.h"
12 #include "SOSViews.h"
13 #include <utilities/SecCFWrappers.h>
14 #import <utilities/SecNSAdditions.h>
15 #include <utilities/SecCoreCrypto.h>
16 #include <utilities/SecBuffer.h>
17 #include <Security/SecureObjectSync/SOSPeerInfoDER.h>
18
19 #include <Security/SecureObjectSync/SOSTransport.h>
20 #include <Security/SecureObjectSync/SOSPeerInfoCollections.h>
21 #include <os/state_private.h>
22
23 // Keep these for later
24 void SOSAccountLog(SOSAccount* account) {
25 NSString* hex = [[account encodedData: nil] asHexString];
26 if(!hex) return;
27 secdebug("accountLog", "Full contents: %@", hex);
28 }
29
30 SOSAccount* SOSAccountCreateFromStringRef(CFStringRef hexString) {
31 CFDataRef accountDER = CFDataCreateFromHexString(kCFAllocatorDefault, hexString);
32 if(!accountDER) return NULL;
33 SOSAccount* account = [SOSAccount accountFromData:(__bridge NSData*) accountDER
34 factory:NULL
35 error:nil];
36 CFReleaseNull(accountDER);
37 return account;
38 }