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