X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/e3d460c9de4426da6c630c3ae3f46173a99f82d8..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_codesigning/lib/reqinterp.h diff --git a/OSX/libsecurity_codesigning/lib/reqinterp.h b/OSX/libsecurity_codesigning/lib/reqinterp.h index fd0188d3..83b2fb02 100644 --- a/OSX/libsecurity_codesigning/lib/reqinterp.h +++ b/OSX/libsecurity_codesigning/lib/reqinterp.h @@ -27,9 +27,12 @@ #ifndef _H_REQINTERP #define _H_REQINTERP -#include +#include "reqreader.h" #include + +#if TARGET_OS_OSX #include // CssmOid +#endif namespace Security { namespace CodeSigning { @@ -59,8 +62,13 @@ protected: bool inequality(CFTypeRef candidate, CFStringCompareFlags flags, CFComparisonResult outcome, bool negate) const; private: - CFCopyRef mValue; // match value + CFCopyRef mValue; // match value MatchOperation mOp; // type of match + + bool isStringValue() const { return CFGetTypeID(mValue) == CFStringGetTypeID(); } + bool isDateValue() const { return CFGetTypeID(mValue) == CFDateGetTypeID(); } + CFStringRef cfStringValue() const { return isStringValue() ? (CFStringRef)mValue.get() : NULL; } + CFDateRef cfDateValue() const { return isDateValue() ? (CFDateRef)mValue.get() : NULL; } }; protected: @@ -69,10 +77,14 @@ protected: bool infoKeyValue(const std::string &key, const Match &match); bool entitlementValue(const std::string &key, const Match &match); bool certFieldValue(const string &key, const Match &match, SecCertificateRef cert); +#if TARGET_OS_OSX bool certFieldGeneric(const string &key, const Match &match, SecCertificateRef cert); bool certFieldGeneric(const CssmOid &oid, const Match &match, SecCertificateRef cert); bool certFieldPolicy(const string &key, const Match &match, SecCertificateRef cert); bool certFieldPolicy(const CssmOid &oid, const Match &match, SecCertificateRef cert); + bool certFieldDate(const string &key, const Match &match, SecCertificateRef cert); + bool certFieldDate(const CssmOid &oid, const Match &match, SecCertificateRef cert); +#endif bool verifyAnchor(SecCertificateRef cert, const unsigned char *digest); bool appleSigned(); bool appleAnchored();