]> git.saurik.com Git - apple/libsecurity_codesigning.git/blobdiff - lib/Code.h
libsecurity_codesigning-55037.15.tar.gz
[apple/libsecurity_codesigning.git] / lib / Code.h
index fca2dfdef193e64788da54ac9f0d7e54ee6b6e0d..715378c21d2ec8c9f4cc254785fcc42b9b731eac 100644 (file)
@@ -44,23 +44,32 @@ class SecStaticCode;
 //
 class SecCode : public SecCFObject {
        NOCOPY(SecCode)
+       friend class KernelCode;        // overrides identify() to set mStaticCode/mCDHash
 public:
        SECCFFUNCTIONS(SecCode, SecCodeRef, errSecCSInvalidObjectRef, gCFObjects().Code)
 
        SecCode(SecCode *host);
     virtual ~SecCode() throw();
        
+    bool equal(SecCFObject &other);
+    CFHashCode hash();
+       
        SecCode *host() const;
        bool isRoot() const { return host() == NULL; }
        SecStaticCode *staticCode();    // cached. Result lives as long as this SecCode
+       CFDataRef cdHash();
+       
+       SecCodeStatus status();                         // dynamic status
+       void status(SecCodeStatusOperation operation, CFDictionaryRef arguments);
 
        // primary virtual drivers. Caller owns the result
-       virtual SecStaticCode *getStaticCode();
+       virtual void identify();
        virtual SecCode *locateGuest(CFDictionaryRef attributes);
-       virtual SecStaticCode *mapGuestToStatic(SecCode *guest);
+       virtual SecStaticCode *identifyGuest(SecCode *guest, CFDataRef *cdhash);
        
        void checkValidity(SecCSFlags flags);
-       virtual uint32_t getGuestStatus(SecCode *guest);
+       virtual SecCodeStatus getGuestStatus(SecCode *guest);
+       virtual void changeGuestStatus(SecCode *guest, SecCodeStatusOperation operation, CFDictionaryRef arguments);
        
 public:
        // perform "autolocation" (root-based heuristic). Caller owns the result
@@ -68,7 +77,9 @@ public:
 
 private:
        SecPointer<SecCode> mHost;
-       SecPointer<SecStaticCode> mStaticCode;
+       bool mIdentified;                                                       // called identify(), mStaticCode & mCDHash are valid
+       SecPointer<SecStaticCode> mStaticCode;          // (static) code origin
+       CFRef<CFDataRef> mCDHash;                                       // (dynamic) CodeDirectory hash as per host
 };