]> git.saurik.com Git - apple/libsecurity_codesigning.git/blobdiff - lib/sigblob.cpp
libsecurity_codesigning-55005.tar.gz
[apple/libsecurity_codesigning.git] / lib / sigblob.cpp
index bdf6a0bf9dc4e5672b7c56a790402fcc7cc2b662..95ad32dccd6f24d7a2167189f2553fbf015c09e0 100644 (file)
@@ -25,6 +25,7 @@
 // sigblob - signature (Super)Blob types
 //
 #include "sigblob.h"
+#include "CSCommon.h"
 
 
 namespace Security {
@@ -36,8 +37,10 @@ CFDataRef EmbeddedSignatureBlob::component(CodeDirectory::SpecialSlot slot) cons
        if (const BlobCore *blob = this->find(slot))
                if (CodeDirectory::slotAttributes(slot) & cdComponentIsBlob)
                        return makeCFData(*blob);       // is a native Blob
+               else if (const BlobWrapper *wrap = BlobWrapper::specific(blob))
+                       return makeCFData(*wrap);
                else
-                       return makeCFData(*BlobWrapper::specific(blob)); // unwrap payload
+                       MacOSError::throwMe(errSecCSSignatureInvalid);
        return NULL;
 }
 
@@ -51,5 +54,12 @@ void EmbeddedSignatureBlob::Maker::component(CodeDirectory::SpecialSlot slot, CF
 }
 
 
+CFDictionaryRef EntitlementBlob::entitlements() const
+{
+       return makeCFDictionaryFrom(this->at<const UInt8 *>(sizeof(EntitlementBlob)),
+               this->length() - sizeof(EntitlementBlob));
+}
+
+
 } // end namespace CodeSigning
 } // end namespace Security