DiskRep *diskRep() { return mRep; }
bool isDetached() const { return mRep->base() != mRep; }
std::string mainExecutablePath() { return mRep->mainExecutablePath(); }
- CFURLRef canonicalPath() const { return mRep->canonicalPath(); }
+ CFURLRef copyCanonicalPath() const { return mRep->copyCanonicalPath(); }
std::string identifier() { return codeDirectory()->identifier(); }
const char *teamID() { return codeDirectory()->teamID(); }
std::string format() const { return mRep->format(); }
CFURLRef resourceBase();
CFDataRef resource(std::string path);
CFDataRef resource(std::string path, ValidationContext &ctx);
- void validateResource(CFDictionaryRef files, std::string path, ValidationContext &ctx, SecCSFlags flags, uint32_t version);
+ void validateResource(CFDictionaryRef files, std::string path, bool isSymlink, ValidationContext &ctx, SecCSFlags flags, uint32_t version);
bool flag(uint32_t tested);
void setMonitor(SecCodeCallback monitor) { mMonitor = monitor; }
CFTypeRef reportEvent(CFStringRef stage, CFDictionaryRef info);
+ void setValidationModifiers(CFDictionaryRef modifiers);
+
void resetValidity(); // clear validation caches (if something may have changed)
bool validated() const { return mValidated; }
void validateNonResourceComponents();
void validateResources(SecCSFlags flags);
void validateExecutable();
- void validateNestedCode(CFURLRef path, const ResourceSeal &seal, SecCSFlags flags);
+ void validateNestedCode(CFURLRef path, const ResourceSeal &seal, SecCSFlags flags, bool isFramework);
const Requirements *internalRequirements();
const Requirement *internalRequirement(SecRequirementType type);
CFTypeRef verificationPolicy(SecCSFlags flags);
static void checkOptionalResource(CFTypeRef key, CFTypeRef value, void *context);
+ bool hasWeakResourceRules(CFDictionaryRef rulesDict, CFArrayRef allowedOmissions);
void handleOtherArchitectures(void (^handle)(SecStaticCode* other));
+private:
+ void validateOtherVersions(CFURLRef path, SecCSFlags flags, SecRequirementRef req, SecStaticCode *code);
+
private:
RefPointer<DiskRep> mRep; // on-disk representation
CFRef<CFDataRef> mDetachedSig; // currently applied explicit detached signature
+ // private validation modifiers (only used by Gatekeeper checkfixes)
+ MacOSErrorSet mTolerateErrors; // soft error conditions to ignore
+ CFRef<CFArrayRef> mAllowOmissions; // additionally allowed resource omissions
+
// master validation state
bool mValidated; // core validation was attempted
OSStatus mValidationResult; // outcome of core validation