1 #include "AppleManifest.h"
2 #include <CoreFoundation/CoreFoundation.h>
3 #include <Security/SecCmsContentInfo.h>
4 #include <Security/SecCmsDecoder.h>
5 #include <Security/SecCmsEncoder.h>
6 #include <Security/SecCmsMessage.h>
7 #include <Security/SecCmsSignedData.h>
8 #include <Security/SecCmsSignerInfo.h>
12 * Copyright (c) 2003-2004,2011-2014 Apple Inc. All Rights Reserved.
14 * @APPLE_LICENSE_HEADER_START@
16 * This file contains Original Code and/or Modifications of Original Code
17 * as defined in and that are subject to the Apple Public Source License
18 * Version 2.0 (the 'License'). You may not use this file except in
19 * compliance with the License. Please obtain a copy of the License at
20 * http://www.opensource.apple.com/apsl/ and read it before using this
23 * The Original Code and all software distributed under the License are
24 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
25 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
26 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
28 * Please see the License for the specific language governing rights and
29 * limitations under the License.
31 * @APPLE_LICENSE_HEADER_END@
36 const int kLengthLength
= 8;
40 static void ConvertUInt64ToBytes (UInt64 length
, UInt8
* bytes
)
43 for (i
= kLengthLength
- 1; i
>= 0; i
--)
45 bytes
[i
] = length
& 0xFF;
52 static void WriteLengthAndUpdate (CFMutableDataRef data
, UInt64 length
, CFIndex location
)
54 // back patch the length of the list
55 secdebug ("manifest", "Length was %lld, patched at location %lld", length
, (UInt64
) location
);
57 UInt8 lengthBytes
[kLengthLength
];
58 ConvertUInt64ToBytes (length
, lengthBytes
);
60 CFRange range
= {location
, kLengthLength
};
61 CFDataReplaceBytes (data
, range
, lengthBytes
, kLengthLength
);
66 static CFIndex
GetCurrentLengthAndExtend (CFMutableDataRef data
)
68 CFIndex currentIndex
= CFDataGetLength (data
);
69 CFDataIncreaseLength (data
, kLengthLength
);
75 static void AppendUInt16 (CFMutableDataRef data
, UInt16 num
)
80 CFDataAppendBytes (data
, n
, sizeof (n
));
85 static void AppendUInt32 (CFMutableDataRef data
, UInt32 num
)
88 n
[0] = (num
>> 24) & 0xFF;
89 n
[1] = (num
>> 16) & 0xFF;
90 n
[2] = (num
>> 8) & 0xFF;
92 CFDataAppendBytes (data
, n
, sizeof (n
));
97 static void AppendUInt64 (CFMutableDataRef data
, UInt64 num
)
100 n
[0] = (num
>> 56) & 0xFF;
101 n
[1] = (num
>> 48) & 0xFF;
102 n
[2] = (num
>> 40) & 0xFF;
103 n
[3] = (num
>> 32) & 0xFF;
104 n
[4] = (num
>> 24) & 0xFF;
105 n
[5] = (num
>> 16) & 0xFF;
106 n
[6] = (num
>> 8) & 0xFF;
109 CFDataAppendBytes (data
, n
, sizeof (n
));
114 static void WriteFileSystemItemHeader (CFMutableDataRef data
, const FileSystemEntryItem
*fsi
)
117 const char* name
= fsi
->GetName ();
118 secdebug ("manifest", "\tAdding header for %s", name
);
119 uint16_t len
= (uint16_t)strlen (name
);
120 AppendUInt16 (data
, len
);
121 CFDataAppendBytes (data
, (UInt8
*) name
, len
);
122 AppendUInt32 (data
, fsi
->GetUID ());
123 AppendUInt32 (data
, fsi
->GetGID ());
124 AppendUInt32 (data
, fsi
->GetMode ());
129 AppleManifest::AppleManifest ()
135 AppleManifest::~AppleManifest ()
137 // release our interest in the signers
138 int signerCount
= (int)mSignerList
.size ();
141 for (i
= 0; i
< signerCount
; ++i
)
143 CFRelease (mSignerList
[i
]);
149 void AppleManifest::AddDirectoryToManifest (CFMutableDataRef manifest
, ManifestDirectoryItem
* directory
)
151 secdebug ("manifest", "Adding directory %s to manifest", directory
->GetName ());
153 CFIndex currentIndex
= GetCurrentLengthAndExtend (manifest
);
154 AppendUInt16 (manifest
, (UInt16
) kManifestDirectoryItemType
);
156 WriteFileSystemItemHeader (manifest
, directory
);
158 AddManifestItemListToManifest (manifest
, directory
->GetItemList ());
160 WriteLengthAndUpdate (manifest
, CFDataGetLength (manifest
) - currentIndex
, currentIndex
);
165 void AppleManifest::AddFileToManifest (CFMutableDataRef manifest
, ManifestFileItem
* file
)
167 CFIndex currentIndex
= GetCurrentLengthAndExtend (manifest
);
168 AppendUInt16 (manifest
, (UInt16
) kManifestFileItemType
);
170 WriteFileSystemItemHeader (manifest
, file
);
172 int numForks
= file
->GetNumberOfForks ();
173 AppendUInt16 (manifest
, (UInt16
) numForks
);
176 // write the file lengths
177 for (i
= 0; i
< numForks
; ++i
)
180 length
= file
->GetForkLength (i
);
181 AppendUInt64 (manifest
, length
);
185 for (i
= 0; i
< numForks
; ++i
)
189 file
->GetItemRepresentation (i
, sha1Digest
, size
);
190 CFDataAppendBytes (manifest
, (UInt8
*) sha1Digest
, size
);
193 WriteLengthAndUpdate (manifest
, CFDataGetLength (manifest
) - currentIndex
, currentIndex
);
198 void AppleManifest::AddSymLinkToManifest (CFMutableDataRef manifest
, ManifestSymLinkItem
* file
)
200 CFIndex currentIndex
= GetCurrentLengthAndExtend (manifest
);
201 AppendUInt16 (manifest
, (UInt16
) kManifestSymLinkItemType
);
203 WriteFileSystemItemHeader (manifest
, file
);
205 const SHA1Digest
* digest
= file
->GetDigest ();
206 CFDataAppendBytes (manifest
, (const UInt8
*) digest
, kSHA1DigestSize
);
208 WriteLengthAndUpdate (manifest
, CFDataGetLength (manifest
) - currentIndex
, currentIndex
);
213 void AppleManifest::AddOtherToManifest (CFMutableDataRef manifest
, ManifestOtherItem
* other
)
215 CFIndex currentIndex
= GetCurrentLengthAndExtend (manifest
);
216 AppendUInt16 (manifest
, (UInt16
) kManifestSymLinkItemType
);
218 WriteFileSystemItemHeader (manifest
, other
);
220 WriteLengthAndUpdate (manifest
, CFDataGetLength (manifest
) - currentIndex
, currentIndex
);
225 void AppleManifest::AddDataBlobToManifest (CFMutableDataRef manifest
, ManifestDataBlobItem
* item
)
227 CFIndex currentIndex
= GetCurrentLengthAndExtend (manifest
);
228 AppendUInt16 (manifest
, (UInt16
) kManifestDataBlobItemType
);
230 AppendUInt64 (manifest
, (UInt64
) item
->GetLength ());
231 const SHA1Digest
* sha1Digest
= item
->GetDigest ();
232 CFDataAppendBytes (manifest
, (UInt8
*) sha1Digest
, sizeof (SHA1Digest
));
234 WriteLengthAndUpdate (manifest
, CFDataGetLength (manifest
) - currentIndex
, currentIndex
);
239 void AppleManifest::AddManifestItemListToManifest (CFMutableDataRef data
, ManifestItemList
&itemList
)
241 // save the current position
242 CFIndex currentIndex
= GetCurrentLengthAndExtend (data
);
245 for (i
= 0; i
< itemList
.size (); ++i
)
247 ManifestItem
* item
= itemList
[i
];
249 switch (item
->GetItemType ())
251 case kManifestDataBlobItemType
:
253 AddDataBlobToManifest (data
, static_cast<ManifestDataBlobItem
*>(item
));
257 case kManifestFileItemType
:
259 AddFileToManifest (data
, static_cast<ManifestFileItem
*>(item
));
263 case kManifestDirectoryItemType
:
265 AddDirectoryToManifest (data
, static_cast<ManifestDirectoryItem
*>(item
));
269 case kManifestSymLinkItemType
:
271 AddSymLinkToManifest (data
, static_cast<ManifestSymLinkItem
*>(item
));
275 case kManifestOtherType
:
277 AddOtherToManifest (data
, static_cast<ManifestOtherItem
*>(item
));
283 WriteLengthAndUpdate (data
, CFDataGetLength (data
) - currentIndex
, currentIndex
);
288 static const char gManifestHeader
[] = {0x2F, 0xAA, 0x05, 0xB3, 0x64, 0x0E, 0x9D, 0x27}; // why these numbers? These were picked at random
289 static const char gManifestVersion
[] = {0x01, 0x00, 0x00, 0x00};
293 void AppleManifest::CreateManifest (CFMutableDataRef manifest
, ManifestInternal
& internalManifest
)
295 // create the manifest header
296 CFDataAppendBytes (manifest
, (UInt8
*) gManifestHeader
, sizeof (gManifestHeader
));
297 CFDataAppendBytes (manifest
, (UInt8
*) gManifestVersion
, sizeof (gManifestVersion
));
298 AddManifestItemListToManifest (manifest
, internalManifest
.GetItemList ());
303 void AppleManifest::AddSignersToCmsMessage (SecCmsMessageRef cmsMessage
, SecCmsSignedDataRef signedData
)
305 // add signers for each of our signers
306 int numSigners
= (int)mSignerList
.size ();
309 for (i
= 0; i
< numSigners
; ++i
)
311 SecIdentityRef id
= mSignerList
[i
];
312 SecCmsSignerInfoRef signerInfo
= SecCmsSignerInfoCreate (cmsMessage
, id
, SEC_OID_SHA1
);
313 if (signerInfo
== NULL
)
315 SecCmsMessageDestroy (cmsMessage
);
316 MacOSError::throwMe (errSecManifestCMSFailure
);
319 int result
= SecCmsSignerInfoIncludeCerts (signerInfo
, SecCmsCMCertChain
, certUsageObjectSigner
);
322 SecCmsMessageDestroy (cmsMessage
);
323 MacOSError::throwMe (errSecManifestCMSFailure
);
326 SecCmsSignedDataAddSignerInfo (signedData
, signerInfo
);
332 CFDataRef
AppleManifest::Export (ManifestInternal
& manifest
)
334 // there had better be at least one signer
335 if (mSignerList
.size () == 0)
337 secdebug ("manifest", "No signers found");
338 MacOSError::throwMe (errSecManifestNoSigners
);
341 // create a CFMutableDataRef to hold the manifest object
342 CFMutableDataRef data
= CFDataCreateMutable (kCFAllocatorDefault
, 0);
345 CreateManifest (data
, manifest
);
347 // make the PKCS #7 wrapper
348 SecCmsMessageRef cmsMessage
;
349 cmsMessage
= SecCmsMessageCreate (NULL
);
350 if (cmsMessage
== NULL
) // did something go wrong?
352 MacOSError::throwMe (errSecManifestCMSFailure
);
355 // create a signed data holder
356 SecCmsSignedDataRef signedData
;
357 signedData
= SecCmsSignedDataCreate (cmsMessage
);
358 if (signedData
== NULL
)
360 SecCmsMessageDestroy (cmsMessage
);
361 MacOSError::throwMe (errSecManifestCMSFailure
);
364 // link the signed data and the CMS message
365 SecCmsContentInfoRef contentInfo
= SecCmsMessageGetContentInfo (cmsMessage
);
367 int result
= SecCmsContentInfoSetContentSignedData (cmsMessage
, contentInfo
, signedData
);
370 SecCmsMessageDestroy (cmsMessage
);
371 MacOSError::throwMe (errSecManifestCMSFailure
);
374 // attach the content information from the signature to the data
375 contentInfo
= SecCmsSignedDataGetContentInfo (signedData
);
376 result
= SecCmsContentInfoSetContentData (cmsMessage
, contentInfo
, NULL
, false);
379 SecCmsMessageDestroy (cmsMessage
);
380 MacOSError::throwMe (errSecManifestCMSFailure
);
383 AddSignersToCmsMessage (cmsMessage
, signedData
);
385 // make an encoder context
386 SecArenaPoolRef arena
;
387 result
= SecArenaPoolCreate(1024, &arena
);
390 MacOSError::throwMe (errSecManifestCMSFailure
);
393 CSSM_DATA finalMessage
= {0, NULL
};
394 SecCmsEncoderRef encoderContext
;
395 result
= SecCmsEncoderCreate (cmsMessage
, NULL
, NULL
, &finalMessage
, arena
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, &encoderContext
);
398 MacOSError::throwMe (errSecManifestCMSFailure
);
401 result
= SecCmsEncoderUpdate (encoderContext
, CFDataGetBytePtr (data
), CFDataGetLength (data
));
404 SecCmsMessageDestroy (cmsMessage
);
405 MacOSError::throwMe (errSecManifestCMSFailure
);
408 result
= SecCmsEncoderFinish (encoderContext
);
411 MacOSError::throwMe (errSecManifestCMSFailure
);
414 // create a CFData from the results
415 CFDataRef retData
= CFDataCreate (kCFAllocatorDefault
, (UInt8
*) finalMessage
.Data
, finalMessage
.Length
);
417 SecArenaPoolFree(arena
, false);
418 SecCmsMessageDestroy (cmsMessage
);
427 static u_int64_t
ReconstructUInt64 (uint32
& finger
, const uint8
* data
)
432 for (i
= 0; i
< sizeof (u_int64_t
); ++i
)
434 r
= (r
<< 8) | data
[finger
++];
442 static u_int32_t
ReconstructUInt32 (uint32
& finger
, const uint8
* data
)
447 for (i
= 0; i
< sizeof (u_int32_t
); ++i
)
449 r
= (r
<< 8) | data
[finger
++];
457 static u_int16_t
ReconstructUInt16 (uint32
& finger
, const uint8
* data
)
462 for (i
= 0; i
< sizeof (u_int16_t
); ++i
)
464 r
= (r
<< 8) | data
[finger
++];
472 static void ReconstructFileSystemHeader (uint32
& finger
, const uint8
* data
, FileSystemEntryItem
* item
)
474 // get the number of bytes for the name
475 u_int16_t length
= ReconstructUInt16 (finger
, data
);
476 char name
[length
+ 1];
478 // make a c-string for the name
479 memcpy (name
, data
+ finger
, length
);
481 item
->SetName (name
);
483 secdebug ("manifest", " File item name is %s", name
);
487 uid_t uid
= (uid_t
) ReconstructUInt32 (finger
, data
);
488 gid_t gid
= (gid_t
) ReconstructUInt32 (finger
, data
);
489 mode_t mode
= (mode_t
) ReconstructUInt32 (finger
, data
);
491 secdebug ("manifest", " File item uid is %d", uid
);
492 secdebug ("manifest", " File item gid is %d", gid
);
493 secdebug ("manifest", " File item mode is %d", mode
);
497 item
->SetMode (mode
);
502 static void ParseItemHeader (uint32
&finger
, const uint8
* data
, ManifestItemType
&itemType
, u_int64_t
&end
)
504 u_int64_t start
= finger
;
505 u_int64_t length
= ReconstructUInt64 (finger
, data
);
506 itemType
= (ManifestItemType
) ReconstructUInt16 (finger
, data
);
507 end
= start
+ length
;
512 void AppleManifest::ReconstructDataBlob (uint32
&finger
, const uint8
* data
, ManifestDataBlobItem
*& item
)
514 secdebug ("manifest", "Reconstructing data blob.");
515 item
= new ManifestDataBlobItem ();
516 u_int64_t length
= ReconstructUInt64 (finger
, data
);
517 item
->SetLength ((size_t)length
);
518 item
->SetDigest ((SHA1Digest
*) (data
+ finger
));
519 finger
+= kSHA1DigestSize
;
524 void AppleManifest::ReconstructDirectory (uint32
&finger
, const uint8
* data
, ManifestDirectoryItem
*& directory
)
526 // make the directory
527 secdebug ("manifest", "Reconstructing directory.");
528 directory
= new ManifestDirectoryItem ();
529 ReconstructFileSystemHeader (finger
, data
, directory
);
531 ReconstructManifestItemList (finger
, data
, directory
->GetItemList ());
536 void AppleManifest::ReconstructFile (uint32
& finger
, const uint8
* data
, ManifestFileItem
*& file
)
538 secdebug ("manifest", "Reconstructing file.");
540 file
= new ManifestFileItem ();
541 ReconstructFileSystemHeader (finger
, data
, file
);
543 u_int16_t numForks
= ReconstructUInt16 (finger
, data
);
544 file
->SetNumberOfForks (numForks
);
546 // reconstruct the lengths
548 for (n
= 0; n
< numForks
; ++n
)
550 u_int64_t length
= ReconstructUInt64 (finger
, data
);
551 file
->SetForkLength (n
, (size_t) length
);
554 // reconstruct the digests
555 for (n
= 0; n
< numForks
; ++n
)
557 file
->SetItemRepresentation (n
, data
+ finger
, kSHA1DigestSize
);
558 finger
+= kSHA1DigestSize
;
564 void AppleManifest::ReconstructSymLink (uint32
& finger
, const uint8
* data
, ManifestSymLinkItem
*& file
)
566 secdebug ("manifest", "Reconstructing symlink.");
567 file
= new ManifestSymLinkItem ();
568 ReconstructFileSystemHeader (finger
, data
, file
);
570 file
->SetDigest ((const SHA1Digest
*) (data
+ finger
));
571 finger
+= kSHA1DigestSize
;
576 void AppleManifest::ReconstructOther (uint32
& finger
, const uint8
* data
, ManifestOtherItem
*& other
)
578 secdebug ("manifest", "Reconstructing other.");
579 other
= new ManifestOtherItem ();
580 ReconstructFileSystemHeader (finger
, data
, other
);
585 void AppleManifest::ReconstructManifestItemList (uint32
&finger
, const uint8
* data
, ManifestItemList
&itemList
)
587 uint32 start
= finger
;
588 u_int64_t length
= ReconstructUInt64 (finger
, data
);
589 #warning Casting from uint64 to uint32, this is ripe for overflow.
590 uint32 end
= (uint32
)(start
+ length
);
595 ManifestItemType itemType
;
596 ParseItemHeader (finger
, data
, itemType
, itemEnd
);
600 case kManifestFileItemType
:
602 ManifestFileItem
* file
;
603 ReconstructFile (finger
, data
, file
);
604 itemList
.push_back (file
);
608 case kManifestDirectoryItemType
:
610 ManifestDirectoryItem
* directory
;
611 ReconstructDirectory (finger
, data
, directory
);
612 itemList
.push_back (directory
);
616 case kManifestSymLinkItemType
:
618 ManifestSymLinkItem
* symLink
;
619 ReconstructSymLink (finger
, data
, symLink
);
620 itemList
.push_back (symLink
);
624 case kManifestOtherType
:
626 ManifestOtherItem
* other
;
627 ReconstructOther (finger
, data
, other
);
628 itemList
.push_back (other
);
632 case kManifestDataBlobItemType
:
634 ManifestDataBlobItem
* item
;
635 ReconstructDataBlob (finger
, data
, item
);
636 itemList
.push_back (item
);
641 if (finger
!= itemEnd
)
643 MacOSError::throwMe (errSecManifestDamaged
);
650 void AppleManifest::ReconstructManifest (uint8
* data
, uint32 length
, ManifestInternal
& manifest
)
654 // make sure the passed-in header starts with our magic number
655 if (memcmp (data
, gManifestHeader
, sizeof (gManifestHeader
)) != 0)
657 MacOSError::throwMe (errSecManifestDamaged
);
660 finger
+= sizeof (gManifestHeader
);
662 // for now, the version had better be 0x01000000
663 if (memcmp (data
+ finger
, gManifestVersion
, sizeof (gManifestVersion
)) != 0)
665 MacOSError::throwMe (errSecManifestDamaged
);
668 finger
+= sizeof (gManifestVersion
);
670 ReconstructManifestItemList (finger
, data
, manifest
.GetItemList ());
675 SecCmsMessageRef
AppleManifest::GetCmsMessageFromData (CFDataRef data
)
678 SecCmsDecoderRef decoderContext
;
679 int result
= SecCmsDecoderCreate (NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, NULL
, &decoderContext
);
682 MacOSError::throwMe (errSecManifestCMSFailure
);
685 result
= SecCmsDecoderUpdate (decoderContext
, CFDataGetBytePtr (data
), CFDataGetLength (data
));
688 SecCmsDecoderDestroy(decoderContext
);
689 MacOSError::throwMe (errSecManifestCMSFailure
);
692 SecCmsMessageRef message
;
693 result
= SecCmsDecoderFinish (decoderContext
, &message
);
696 MacOSError::throwMe (errSecManifestCMSFailure
);
704 void AppleManifest::Verify (CFDataRef data
, SecManifestTrustSetupCallback setupCallback
, void* setupContext
,
705 SecManifestTrustEvaluateCallback evaluateCallback
, void* evaluateContext
,
706 SecPolicyRef policy
, ManifestInternal
*manifest
)
708 SecCmsMessageRef cmsMessage
= NULL
;
712 cmsMessage
= GetCmsMessageFromData (data
);
714 SecPolicySearchRef search
;
717 SecPolicyRef originalPolicy
= policy
;
721 // get a basic SecPolicy
722 result
= SecPolicySearchCreate (CSSM_CERT_X_509v3
, &CSSMOID_APPLE_X509_BASIC
, NULL
, &search
);
723 MacOSError::check (result
);
725 result
= SecPolicySearchCopyNext (search
, &policy
);
726 if (result
!= errSecSuccess
)
728 MacOSError::throwMe (errSecManifestNoPolicy
);
734 // process the results
735 int contentLevelCount
= SecCmsMessageContentLevelCount (cmsMessage
);
736 SecCmsSignedDataRef signedData
;
739 while (i
< contentLevelCount
)
741 SecCmsContentInfoRef contentInfo
= SecCmsMessageContentLevel (cmsMessage
, i
++);
742 SECOidTag contentTypeTag
= SecCmsContentInfoGetContentTypeTag (contentInfo
);
744 if (contentTypeTag
!= SEC_OID_PKCS7_SIGNED_DATA
)
749 signedData
= (SecCmsSignedDataRef
) SecCmsContentInfoGetContent (contentInfo
);
750 if (signedData
== NULL
)
752 MacOSError::throwMe (errSecManifestDidNotVerify
);
755 // import the certificates found in the cms message
756 result
= SecCmsSignedDataImportCerts (signedData
, NULL
, certUsageObjectSigner
, true);
759 MacOSError::throwMe (result
);
762 int numberOfSigners
= SecCmsSignedDataSignerInfoCount (signedData
);
765 if (numberOfSigners
== 0) // no signers? This is a possible attack
767 MacOSError::throwMe (errSecManifestNoSignersFound
);
770 for (j
= 0; j
< numberOfSigners
; ++j
)
772 SecTrustResultType resultType
;
773 SecTrustRef trustRef
= NULL
;
777 result
= SecCmsSignedDataVerifySignerInfo (signedData
, j
, NULL
, policy
, &trustRef
);
781 MacOSError::throwMe (result
);
784 SecManifestTrustCallbackResult tcResult
= setupCallback (trustRef
, setupContext
);
787 case kSecManifestDoNotVerify
:
790 case kSecManifestSignerVerified
:
793 case kSecManifestFailed
:
794 MacOSError::throwMe (errSecManifestDidNotVerify
);
796 case kSecManifestContinue
:
800 result
= SecTrustEvaluate (trustRef
, &resultType
);
801 if (result
!= errSecSuccess
)
803 MacOSError::throwMe (result
);
806 if (resultType
!= kSecTrustResultProceed
)
808 if (evaluateCallback (trustRef
, resultType
, evaluateContext
) != kSecManifestSignerVerified
)
810 MacOSError::throwMe (errSecManifestDidNotVerify
);
814 CFRelease (trustRef
);
818 if (trustRef
!= NULL
)
820 CFRelease (trustRef
);
828 if (manifest
!= NULL
)
830 CSSM_DATA_PTR message
= SecCmsMessageGetContent (cmsMessage
);
831 ReconstructManifest (message
->Data
, (uint32
)message
->Length
, *manifest
);
834 SecCmsMessageDestroy (cmsMessage
);
835 if (originalPolicy
== NULL
)
842 if (cmsMessage
!= NULL
)
844 SecCmsMessageDestroy (cmsMessage
);
853 void AppleManifest::AddSigner (SecIdentityRef identityRef
)
855 CFRetain (identityRef
);
856 mSignerList
.push_back (identityRef
);