]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_codesigning/lib/sigblob.cpp
Security-58286.220.15.tar.gz
[apple/security.git] / OSX / libsecurity_codesigning / lib / sigblob.cpp
index 619986a139798510bbb08feda3198462bbd36ded..6e7cf0285319e2ef9398677b6979ba8fdd14d11e 100644 (file)
@@ -62,6 +62,21 @@ CFDictionaryRef EntitlementBlob::entitlements() const
                this->length() - sizeof(EntitlementBlob));
 }
 
+EntitlementDERBlob *EntitlementDERBlob::alloc(size_t length) {
+       size_t blobLength = length + sizeof(BlobCore);
+       if (blobLength < length) {
+               // overflow
+               return NULL;
+       }
+
+       EntitlementDERBlob *b = (EntitlementDERBlob *)malloc(blobLength);
+
+       if (b != NULL) {
+               b->BlobCore::initialize(kSecCodeMagicEntitlementDER, blobLength);
+       }
+
+       return b;
+}
 
 } // end namespace CodeSigning
 } // end namespace Security