]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_codesigning/lib/reqinterp.h
Security-59306.61.1.tar.gz
[apple/security.git] / OSX / libsecurity_codesigning / lib / reqinterp.h
index fd0188d356fc4a997f9428068b20da2148201cbe..83b2fb02b40b431d0e438af7a0798f1377849c06 100644 (file)
 #ifndef _H_REQINTERP
 #define _H_REQINTERP
 
-#include <security_codesigning/reqreader.h>
+#include "reqreader.h"
 #include <Security/SecTrustSettings.h>
+
+#if TARGET_OS_OSX
 #include <security_cdsa_utilities/cssmdata.h>  // CssmOid
+#endif
 
 namespace Security {
 namespace CodeSigning {
@@ -59,8 +62,13 @@ protected:
                bool inequality(CFTypeRef candidate, CFStringCompareFlags flags, CFComparisonResult outcome, bool negate) const;
                
        private:
-               CFCopyRef<CFStringRef> mValue;  // match value
+               CFCopyRef<CFTypeRef> 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();