2 // SOSAccountRingUpdate.c
9 #include "SOSAccountPriv.h"
10 #include <Security/SecureObjectSync/SOSTransportCircleKVS.h>
11 #include <Security/SecureObjectSync/SOSTransport.h>
12 #include <Security/SecureObjectSync/SOSViews.h>
13 #include <Security/SecureObjectSync/SOSRing.h>
14 #include <Security/SecureObjectSync/SOSRingUtils.h>
15 #include <Security/SecureObjectSync/SOSPeerInfoCollections.h>
16 #import <Security/SecureObjectSync/SOSAccountTrust.h>
18 static const char * __unused concordstring[] = {
19 "kSOSConcordanceTrusted",
20 "kSOSConcordanceGenOld", // kSOSErrorReplay
21 "kSOSConcordanceNoUserSig", // kSOSErrorBadSignature
22 "kSOSConcordanceNoUserKey", // kSOSErrorNoKey
23 "kSOSConcordanceNoPeer", // kSOSErrorPeerNotFound
24 "kSOSConcordanceBadUserSig", // kSOSErrorBadSignature
25 "kSOSConcordanceBadPeerSig", // kSOSErrorBadSignature
26 "kSOSConcordanceNoPeerSig",
27 "kSOSConcordanceWeSigned",
28 "kSOSConcordanceInvalidMembership",
29 "kSOSConcordanceMissingMe",
30 "kSOSConcordanceImNotWorthy",
34 bool SOSAccountIsPeerRetired(SOSAccount* account, CFSetRef peers){
35 CFMutableArrayRef peerInfos = CFArrayCreateMutableForCFTypes(kCFAllocatorDefault);
38 CFSetForEach(peers, ^(const void *value) {
39 SOSPeerInfoRef peer = (SOSPeerInfoRef)value;
40 if(SOSPeerInfoIsRetirementTicket(peer))
41 CFArrayAppendValue(peerInfos, peer);
43 if(CFArrayGetCount(peerInfos) > 0){
44 if(!SOSAccountRemoveBackupPeers(account, peerInfos, NULL))
45 secerror("Could not remove peers: %@, from the backup", peerInfos);
52 CFReleaseNull(peerInfos);