void ItemImpl::encodeAttributes(CssmOwnedData &attributeBlob) {
// Sometimes we don't have our attributes. Find them.
- auto_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
+ unique_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
encodeAttributesFromDictionary(attributeBlob, dbAttributes.get());
}
}
void ItemImpl::computeDigest(CssmOwnedData &sha2) {
- auto_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
+ unique_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
ItemImpl::computeDigestFromDictionary(sha2, dbAttributes.get());
}
return true;
}
- auto_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
+ unique_ptr<DbAttributes> dbAttributes(getCurrentAttributes());
return checkIntegrityFromDictionary(aclBearer, dbAttributes.get());
}
// them.
AclEntryInfo &info = aclInfos.at(0);
- auto_ptr<ACL> acl(new ACL(info, Allocator::standard()));
+ unique_ptr<ACL> acl(new ACL(info, Allocator::standard()));
for(int i = 1; i < aclInfos.count(); i++) {
secnotice("integrity", "*** DUPLICATE INTEGRITY ACL, something has gone wrong");
} catch (CssmError cssme) {
// If there's a "duplicate" of this item, it might be an item with corrupt/invalid attributes
// Try to extract the item and check its attributes, then try again if necessary
- auto_ptr<CssmClient::DbAttributes> primaryKeyAttrs;
+ unique_ptr<CssmClient::DbAttributes> primaryKeyAttrs;
if(cssme.error == CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA) {
secnotice("integrity", "possible duplicate, trying to delete invalid items");
// The item on-disk might have more or different attributes than we do, since we're
// only searching via primary key. Fetch all of its attributes.
- auto_ptr<DbAttributes>dbDupAttributes (new DbAttributes(kc->database(), 1));
+ unique_ptr<DbAttributes>dbDupAttributes (new DbAttributes(kc->database(), 1));
fillDbAttributesFromSchema(*dbDupAttributes, recordType, kc);
// Occasionally this cursor won't return the item attributes (for an unknown reason).
theList->count = 0;
theList->attr = NULL;
} else {
- SecKeychainAttribute *attr=reinterpret_cast<SecKeychainAttribute *>(malloc(sizeof(SecKeychainAttribute)*attrCount));
+ SecKeychainAttribute *attr=reinterpret_cast<SecKeychainAttribute *>(calloc(attrCount, sizeof(SecKeychainAttribute)));
theList->count=attrCount;
theList->attr=attr;