X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/e3d460c9de4426da6c630c3ae3f46173a99f82d8..dd5fb164cf5b32c462296bc65e289e100f74b59a:/OSX/libsecurity_codesigning/lib/StaticCode.h diff --git a/OSX/libsecurity_codesigning/lib/StaticCode.h b/OSX/libsecurity_codesigning/lib/StaticCode.h index bb73341a..46dfbd2e 100644 --- a/OSX/libsecurity_codesigning/lib/StaticCode.h +++ b/OSX/libsecurity_codesigning/lib/StaticCode.h @@ -136,13 +136,13 @@ public: std::string signatureSource(); virtual CFDataRef component(CodeDirectory::SpecialSlot slot, OSStatus fail = errSecCSSignatureFailed); virtual CFDictionaryRef infoDictionary(); + CFDictionaryRef diskRepInformation(); CFDictionaryRef entitlements(); + CFDataRef copyComponent(CodeDirectory::SpecialSlot slot, CFDataRef hash); CFDictionaryRef resourceDictionary(bool check = true); CFURLRef resourceBase(); - CFDataRef resource(std::string path); - CFDataRef resource(std::string path, ValidationContext &ctx); void validateResource(CFDictionaryRef files, std::string path, bool isSymlink, ValidationContext &ctx, SecCSFlags flags, uint32_t version); void validateSymlinkResource(std::string fullpath, std::string seal, ValidationContext &ctx, SecCSFlags flags); @@ -177,6 +177,8 @@ public: void validateExecutable(); void validateNestedCode(CFURLRef path, const ResourceSeal &seal, SecCSFlags flags, bool isFramework); + void validatePlainMemoryResource(string path, CFDataRef fileData, SecCSFlags flags); + const Requirements *internalRequirements(); const Requirement *internalRequirement(SecRequirementType type); const Requirement *designatedRequirement(); @@ -193,7 +195,10 @@ public: CFDictionaryRef signingInformation(SecCSFlags flags); // omnibus information-gathering API (creates new dictionary) - static bool isAppleDeveloperCert(CFArrayRef certs); // determines if this is an apple developer certificate for libraray validation + static bool isAppleDeveloperCert(CFArrayRef certs); // determines if this is an apple developer certificate for library validation +#if !TARGET_OS_OSX + bool trustedSigningCertChain() { return mTrustedSigningCertChain; } +#endif public: void staticValidate(SecCSFlags flags, const SecRequirement *req); @@ -206,7 +211,11 @@ protected: protected: CFDictionaryRef getDictionary(CodeDirectory::SpecialSlot slot, bool check = true); // component value as a dictionary bool verifySignature(); - CFArrayRef verificationPolicies(); + CFArrayRef createVerificationPolicies(); + CFArrayRef createTimeStampingAndRevocationPolicies(); + + // load preferred rules/files dictionaries (cached therein) + bool loadResources(CFDictionaryRef& rules, CFDictionaryRef& files, uint32_t& version); static void checkOptionalResource(CFTypeRef key, CFTypeRef value, void *context); bool hasWeakResourceRules(CFDictionaryRef rulesDict, uint32_t version, CFArrayRef allowedOmissions); @@ -215,7 +224,11 @@ protected: private: void validateOtherVersions(CFURLRef path, SecCSFlags flags, SecRequirementRef req, SecStaticCode *code); + bool checkfix30814861(string path, bool addition); + ResourceBuilder *mCheckfix30814861builder1; + dispatch_once_t mCheckfix30814861builder1_once; + private: RefPointer mRep; // on-disk representation mutable CodeDirectoryMap mCodeDirectories; // available CodeDirectory blobs by digest type @@ -279,7 +292,12 @@ private: // signature verification outcome (mTrust == NULL => not done yet) CFRef mTrust; // outcome of crypto validation (valid or not) CFRef mCertChain; - CSSM_TP_APPLE_EVIDENCE_INFO *mEvalDetails; +#if TARGET_OS_OSX + CSSM_TP_APPLE_EVIDENCE_INFO *mEvalDetails; +#else + bool mTrustedSigningCertChain; +#endif + };