]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_codesigning/lib/cdbuilder.h
Security-59306.11.20.tar.gz
[apple/security.git] / OSX / libsecurity_codesigning / lib / cdbuilder.h
index 761dcf631dbbf0e0752ebeb249bdeac0186a60e2..7137444ce9a3e7798f315a1d6eb8d97f79d6aa4b 100644 (file)
@@ -49,6 +49,7 @@ public:
        
        void executable(string path, size_t pagesize, size_t offset, size_t length);
        void reopen(string path, size_t offset, size_t length);
+       bool opened();
 
        void specialSlot(SpecialSlot slot, CFDataRef data);
        void identifier(const std::string &code) { mIdentifier = code; }
@@ -64,6 +65,18 @@ public:
                mExecSegOffset = base; mExecSegLimit = limit; mExecSegFlags = flags; }
        void addExecSegFlags(uint64_t flags) { mExecSegFlags |= flags; }
 
+       typedef std::map<CodeDirectory::HashAlgorithm, CFCopyRef<CFDataRef> >
+               PreEncryptHashMap;
+
+       void generatePreEncryptHashes(bool pre) { mGeneratePreEncryptHashes = pre; }
+       void preservePreEncryptHashMap(PreEncryptHashMap preEncryptHashMap) {
+               mPreservedPreEncryptHashMap = preEncryptHashMap;
+       }
+
+       void runTimeVersion(uint32_t runtime) {
+               mRuntimeVersion = runtime;
+       }
+
        size_t size(const uint32_t version);            // calculate size
        CodeDirectory *build();                                         // build CodeDirectory and return it
     size_t fixedSize(const uint32_t version);  // calculate fixed size of the CodeDirectory
@@ -102,6 +115,11 @@ private:
        uint64_t mExecSegLimit;                                         // limit of executable segment
        uint64_t mExecSegFlags;                                         // executable segment flags
 
+       bool mGeneratePreEncryptHashes;                         // whether to also generate new pre-encrypt hashes
+       PreEncryptHashMap mPreservedPreEncryptHashMap; // existing pre-encrypt hashes to be set
+
+       uint32_t mRuntimeVersion;                                       // Hardened Runtime Version
+
        CodeDirectory *mDir;                                            // what we're building
 };