- mRootStoreDL = new DL(gGuidAppleFileDL),
- mRootStoreDb = new Db(*mRootStoreDL, SYSTEM_ROOT_STORE_PATH),
+ mRootStoreDL = new DL(gGuidAppleFileDL);
+ mRootStoreDb = new Db(*mRootStoreDL, SYSTEM_ROOT_STORE_PATH);
#if !defined(NDEBUG)
CFArrayApplyFunction(mAllowedAnchors, CFRangeMake(0, CFArrayGetCount(mAllowedAnchors)), showCertSKID, NULL);
#endif
#if !defined(NDEBUG)
CFArrayApplyFunction(mAllowedAnchors, CFRangeMake(0, CFArrayGetCount(mAllowedAnchors)), showCertSKID, NULL);
#endif
allPolicies = convertRevocationPolicy(numRevocationAdded, context.allocator);
if (allPolicies) {
// caller has explicitly set the revocation policy they want to use
allPolicies = convertRevocationPolicy(numRevocationAdded, context.allocator);
if (allPolicies) {
// caller has explicitly set the revocation policy they want to use
// caller explicitly provided empty anchors and no keychain list,
// and did not explicitly specify the revocation policy;
// override global revocation check setting for this evaluation
// caller explicitly provided empty anchors and no keychain list,
// and did not explicitly specify the revocation policy;
// override global revocation check setting for this evaluation
allPolicies = NULL; // use only mPolicies
isEVCandidate = false;
}
else if (isEVCandidate || requirePerCert) {
// force revocation checking for this evaluation
allPolicies = NULL; // use only mPolicies
isEVCandidate = false;
}
else if (isEVCandidate || requirePerCert) {
// force revocation checking for this evaluation
allPolicies = forceRevocationPolicies(true, requirePerCert,
numRevocationAdded, context.allocator, requirePerCert);
}
allPolicies = forceRevocationPolicies(true, requirePerCert,
numRevocationAdded, context.allocator, requirePerCert);
}
CFIndex numPolicies = CFArrayGetCount(mPolicies);
CFAllocatorRef allocator = CFGetAllocator(mPolicies);
allPolicies = CFArrayCreateMutableCopy(allocator, numPolicies, mPolicies);
CFIndex numPolicies = CFArrayGetCount(mPolicies);
CFAllocatorRef allocator = CFGetAllocator(mPolicies);
allPolicies = CFArrayCreateMutableCopy(allocator, numPolicies, mPolicies);
// no anchor certificates were provided;
// built-in anchors will be trusted unless explicitly disabled.
mUsingTrustSettings = (mAnchorPolicy < useAnchorsOnly);
// no anchor certificates were provided;
// built-in anchors will be trusted unless explicitly disabled.
mUsingTrustSettings = (mAnchorPolicy < useAnchorsOnly);
(mUsingTrustSettings) ? "using UserTrust" : "has no trusted anchors!");
}
else {
// anchor certificates were provided;
// built-in anchors will NOT also be trusted unless explicitly enabled.
mUsingTrustSettings = (mAnchorPolicy == useAnchorsAndBuiltIns);
(mUsingTrustSettings) ? "using UserTrust" : "has no trusted anchors!");
}
else {
// anchor certificates were provided;
// built-in anchors will NOT also be trusted unless explicitly enabled.
mUsingTrustSettings = (mAnchorPolicy == useAnchorsAndBuiltIns);
(mUsingTrustSettings) ? "UserTrust AND" : "only",
(isEVCandidate) ? "EV" : "caller");
context.anchors(roots, roots);
(mUsingTrustSettings) ? "UserTrust AND" : "only",
(isEVCandidate) ? "EV" : "caller");
context.anchors(roots, roots);
mTpReturn = errSecSuccess;
} catch (CommonError &err) {
mTpReturn = err.osStatus();
mTpReturn = errSecSuccess;
} catch (CommonError &err) {
mTpReturn = err.osStatus();
mTpResult[2].as<CSSM_TP_APPLE_EVIDENCE_INFO>(), anchors);
} else {
// unexpected evidence information. Can't use it
mTpResult[2].as<CSSM_TP_APPLE_EVIDENCE_INFO>(), anchors);
} else {
// unexpected evidence information. Can't use it
if (info.recordId()) {
Keychain keychain = keychainByDLDb(info.DlDbHandle);
DbUniqueRecord uniqueId(keychain->database()->newDbUniqueRecord());
if (info.recordId()) {
Keychain keychain = keychainByDLDb(info.DlDbHandle);
DbUniqueRecord uniqueId(keychain->database()->newDbUniqueRecord());
- secdebug("trusteval", "evidence %lu from keychain \"%s\"", (unsigned long)n, keychain->name());
+ secinfo("trusteval", "evidence %lu from keychain \"%s\"", (unsigned long)n, keychain->name());
*static_cast<CSSM_DB_UNIQUE_RECORD_PTR *>(uniqueId) = info.UniqueRecord;
uniqueId->activate(); // transfers ownership
Item ii = keychain->item(CSSM_DL_DB_RECORD_X509_CERTIFICATE, uniqueId);
*static_cast<CSSM_DB_UNIQUE_RECORD_PTR *>(uniqueId) = info.UniqueRecord;
uniqueId->activate(); // transfers ownership
Item ii = keychain->item(CSSM_DL_DB_RECORD_X509_CERTIFICATE, uniqueId);
- secdebug("trusteval", "evidence %lu from input cert %lu", (unsigned long)n, (unsigned long)info.index());
+ secinfo("trusteval", "evidence %lu from input cert %lu", (unsigned long)n, (unsigned long)info.index());
assert(info.index() < uint32(CFArrayGetCount(mCerts)));
SecCertificateRef cert = SecCertificateRef(CFArrayGetValueAtIndex(mCerts,
info.index()));
mCertChain[n] = Certificate::required(cert);
} else if (info.status(CSSM_CERT_STATUS_IS_IN_ANCHORS)) {
assert(info.index() < uint32(CFArrayGetCount(mCerts)));
SecCertificateRef cert = SecCertificateRef(CFArrayGetValueAtIndex(mCerts,
info.index()));
mCertChain[n] = Certificate::required(cert);
} else if (info.status(CSSM_CERT_STATUS_IS_IN_ANCHORS)) {
- secdebug("trusteval", "evidence %lu from anchor cert %lu", (unsigned long)n, (unsigned long)info.index());
+ secinfo("trusteval", "evidence %lu from anchor cert %lu", (unsigned long)n, (unsigned long)info.index());
assert(info.index() < uint32(CFArrayGetCount(anchors)));
SecCertificateRef cert = SecCertificateRef(CFArrayGetValueAtIndex(anchors,
info.index()));
mCertChain[n] = Certificate::required(cert);
} else {
// unknown source; make a new Certificate for it
assert(info.index() < uint32(CFArrayGetCount(anchors)));
SecCertificateRef cert = SecCertificateRef(CFArrayGetValueAtIndex(anchors,
info.index()));
mCertChain[n] = Certificate::required(cert);
} else {
// unknown source; make a new Certificate for it
mCertChain[n] =
new Certificate(chain.blobCerts()[n],
CSSM_CERT_X_509v3, CSSM_CERT_ENCODING_BER);
mCertChain[n] =
new Certificate(chain.blobCerts()[n],
CSSM_CERT_X_509v3, CSSM_CERT_ENCODING_BER);
- secdebug("trusteval", "trustResult=%d from cert %d", (int)mResult, (int)mResultIndex);
+ secinfo("trusteval", "trustResult=%d from cert %d", (int)mResult, (int)mResultIndex);
allocator.free(evidence[n].StatusCodes);
allocator.free(result[2].data()); // array of (flat) info structs
} else {
allocator.free(evidence[n].StatusCodes);
allocator.free(result[2].data()); // array of (flat) info structs
} else {
if (mResult != kSecTrustResultInvalid) {
releaseTPEvidence(mTpResult, mTP.allocator());
mResult = kSecTrustResultInvalid;
if (mResult != kSecTrustResultInvalid) {
releaseTPEvidence(mTpResult, mTP.allocator());
mResult = kSecTrustResultInvalid;