2 // SOSAccountRingUpdate.c
9 #include "SOSAccountPriv.h"
10 #include "keychain/SecureObjectSync/SOSTransportCircleKVS.h"
11 #include "keychain/SecureObjectSync/SOSTransport.h"
12 #include <Security/SecureObjectSync/SOSViews.h>
13 #include "keychain/SecureObjectSync/SOSRing.h"
14 #include "keychain/SecureObjectSync/SOSRingUtils.h"
15 #include "keychain/SecureObjectSync/SOSPeerInfoCollections.h"
16 #import "keychain/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);