X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/866f8763175ff60e4fa455b92b5eb660a12fe6c7..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_codesigning/lib/reqinterp.h diff --git a/OSX/libsecurity_codesigning/lib/reqinterp.h b/OSX/libsecurity_codesigning/lib/reqinterp.h index 45270409..83b2fb02 100644 --- a/OSX/libsecurity_codesigning/lib/reqinterp.h +++ b/OSX/libsecurity_codesigning/lib/reqinterp.h @@ -62,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: @@ -77,6 +82,8 @@ protected: 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();