+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;
+}