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 bool SOSAccountIsPeerRetired(SOSAccount* account, CFSetRef peers){
19 CFMutableArrayRef peerInfos = CFArrayCreateMutableForCFTypes(kCFAllocatorDefault);
22 CFSetForEach(peers, ^(const void *value) {
23 SOSPeerInfoRef peer = (SOSPeerInfoRef)value;
24 if(SOSPeerInfoIsRetirementTicket(peer))
25 CFArrayAppendValue(peerInfos, peer);
27 if(CFArrayGetCount(peerInfos) > 0){
28 if(!SOSAccountRemoveBackupPeers(account, peerInfos, NULL))
29 secerror("Could not remove peers: %@, from the backup", peerInfos);
36 CFReleaseNull(peerInfos);