X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..dd5fb164cf5b32c462296bc65e289e100f74b59a:/OSX/libsecurity_codesigning/lib/CodeSigner.cpp?ds=inline diff --git a/OSX/libsecurity_codesigning/lib/CodeSigner.cpp b/OSX/libsecurity_codesigning/lib/CodeSigner.cpp index 3d80482c..ee8045f9 100644 --- a/OSX/libsecurity_codesigning/lib/CodeSigner.cpp +++ b/OSX/libsecurity_codesigning/lib/CodeSigner.cpp @@ -65,7 +65,7 @@ public: // Construct a SecCodeSigner // SecCodeSigner::SecCodeSigner(SecCSFlags flags) - : mOpFlags(flags), mDigestAlgorithm(kSecCodeSignatureDefaultDigestAlgorithm), mLimitedAsync(NULL) + : mOpFlags(flags), mLimitedAsync(NULL) { } @@ -138,12 +138,12 @@ void SecCodeSigner::sign(SecStaticCode *code, SecCSFlags flags) return; Signer operation(*this, code); if ((flags | mOpFlags) & kSecCSRemoveSignature) { - secdebug("signer", "%p will remove signature from %p", this, code); + secinfo("signer", "%p will remove signature from %p", this, code); operation.remove(flags); } else { if (!valid()) MacOSError::throwMe(errSecCSInvalidObjectRef); - secdebug("signer", "%p will sign %p (flags 0x%x)", this, code, flags); + secinfo("signer", "%p will sign %p (flags 0x%x)", this, code, flags); operation.sign(flags); } code->resetValidity(); @@ -172,30 +172,6 @@ void SecCodeSigner::returnDetachedSignature(BlobCore *blob, Signer &signer) } -// -// Our DiskRep::signingContext methods communicate with the signing subsystem -// in terms those callers can easily understand. -// -string SecCodeSigner::sdkPath(const std::string &path) const -{ - assert(path[0] == '/'); // need absolute path here - if (mSDKRoot) - return cfString(mSDKRoot) + path; - else - return path; -} - -bool SecCodeSigner::isAdhoc() const -{ - return mSigner == SecIdentityRef(kCFNull); -} - -SecCSFlags SecCodeSigner::signingFlags() const -{ - return mOpFlags; -} - - // // The actual parsing operation is done in the Parser class. // @@ -219,8 +195,11 @@ SecCodeSigner::Parser::Parser(SecCodeSigner &state, CFDictionaryRef parameters) state.mCdFlagsGiven = false; // digest algorithms are specified as a numeric code - if (CFNumberRef digestAlgorithm = get(kSecCodeSignerDigestAlgorithm)) - state.mDigestAlgorithm = cfNumber(digestAlgorithm); + if (CFCopyRef digestAlgorithms = get(kSecCodeSignerDigestAlgorithm)) { + CFRef array = cfArrayize(digestAlgorithms); + CFToVector > digests(array); + std::copy(digests.begin(), digests.end(), std::inserter(state.mDigestAlgorithms, state.mDigestAlgorithms.begin())); + } if (CFNumberRef cmsSize = get(CFSTR("cmssize"))) state.mCMSSize = cfNumber(cmsSize);