1 #ifndef __APPLE_MANIFEST__
2 #define __APPLE_MANIFEST__
7 * Copyright (c) 2004,2011,2014 Apple Inc. All Rights Reserved.
9 * @APPLE_LICENSE_HEADER_START@
11 * This file contains Original Code and/or Modifications of Original Code
12 * as defined in and that are subject to the Apple Public Source License
13 * Version 2.0 (the 'License'). You may not use this file except in
14 * compliance with the License. Please obtain a copy of the License at
15 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_LICENSE_HEADER_END@
31 #include "ManifestSigner.h"
32 #include <Security/SecCmsBase.h>
36 typedef std::vector
<SecIdentityRef
> SignerList
;
38 class AppleManifest
: public ManifestSigner
41 void AddDataBlobToManifest (CFMutableDataRef manifest
, ManifestDataBlobItem
* db
);
42 void AddDirectoryToManifest (CFMutableDataRef manifest
, ManifestDirectoryItem
* directory
);
43 void AddFileToManifest (CFMutableDataRef manifest
, ManifestFileItem
* file
);
44 void AddSymLinkToManifest (CFMutableDataRef manifest
, ManifestSymLinkItem
* file
);
45 void AddOtherToManifest (CFMutableDataRef manifest
, ManifestOtherItem
* other
);
46 void AddManifestItemListToManifest (CFMutableDataRef manifest
, ManifestItemList
&itemList
);
47 void CreateManifest (CFMutableDataRef manifest
, ManifestInternal
& internalManifest
);
49 void AddSignersToCmsMessage (SecCmsMessageRef cmsMessage
, SecCmsSignedDataRef signedData
);
51 void ReconstructDataBlob (uint32
& finger
, const uint8
* data
, ManifestDataBlobItem
*& db
);
52 void ReconstructDirectory (uint32
& finger
, const uint8
* data
, ManifestDirectoryItem
*& directory
);
53 void ReconstructFile (uint32
& finger
, const uint8
* data
, ManifestFileItem
*& file
);
54 void ReconstructSymLink (uint32
& finger
, const uint8
* data
, ManifestSymLinkItem
*& file
);
55 void ReconstructOther (uint32
& finger
, const uint8
* data
, ManifestOtherItem
*& other
);
56 void ReconstructManifestItemList (uint32
&finger
, const uint8
* data
, ManifestItemList
&itemList
);
57 void ReconstructManifest (uint8
* data
, uint32 length
, ManifestInternal
& manifest
);
59 SignerList mSignerList
;
61 SecCmsMessageRef
GetCmsMessageFromData (CFDataRef data
);
65 virtual ~AppleManifest ();
67 virtual CFDataRef
Export (ManifestInternal
& manifest
);
68 void Verify (CFDataRef data
, SecManifestTrustSetupCallback setupCallback
, void* setupContext
,
69 SecManifestTrustEvaluateCallback evaluateCallback
, void* evaluateContext
,
70 SecPolicyRef policyRef
, ManifestInternal
*manifest
);
71 virtual void AddSigner (SecIdentityRef identityRef
);