REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1493 Pkcs7GetAttachedContent() implementation in current CryptPkcs7Verify.c is actually shared by RuntimeCryptLib.inf, SmmCryptLib.inf and BaseCryptLib.inf, which are not correct since there's no use scenario for runtime and AllocatePool() used in this method can only be called in boot time. This patch fix this issue by splitting file CryptPkcs7Verify.c into 3 parts. CryptPkcs7VerifyCommon.c (shared among Base, SMM, Runtime) CryptPkcs7VerifyBase.c (shared between Base, SMM) CryptPkcs7VerifyRuntime.c (for Runtime only) CryptPkcs7VerifyBase.c will have original implementation of Pkcs7GetAttachedContent() as CryptPkcs7Verify.c. CryptPkcs7VerifyRuntime.c provide a NULL version of Pkcs7GetAttachedContent(). No functionality and interface change is involved in this patch. Cc: Ting Ye <ting.ye@intel.com> Cc: Qin Long <qin.long@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ting Ye <ting.ye@intel.com>
46 lines
1.6 KiB
C
46 lines
1.6 KiB
C
/** @file
|
|
Runtime specific implementation of PKCS#7 SignedData Verification Wrapper.
|
|
|
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
|
This program and the accompanying materials
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
**/
|
|
|
|
#include "InternalCryptLib.h"
|
|
|
|
/**
|
|
Extracts the attached content from a PKCS#7 signed data if existed. The input signed
|
|
data could be wrapped in a ContentInfo structure.
|
|
|
|
Return FALSE to indicate this interface is not supported.
|
|
|
|
@param[in] P7Data Pointer to the PKCS#7 signed data to process.
|
|
@param[in] P7Length Length of the PKCS#7 signed data in bytes.
|
|
@param[out] Content Pointer to the extracted content from the PKCS#7 signedData.
|
|
It's caller's responsibility to free the buffer with FreePool().
|
|
@param[out] ContentSize The size of the extracted content in bytes.
|
|
|
|
@retval TRUE The P7Data was correctly formatted for processing.
|
|
@retval FALSE The P7Data was not correctly formatted for processing.
|
|
|
|
**/
|
|
BOOLEAN
|
|
EFIAPI
|
|
Pkcs7GetAttachedContent (
|
|
IN CONST UINT8 *P7Data,
|
|
IN UINTN P7Length,
|
|
OUT VOID **Content,
|
|
OUT UINTN *ContentSize
|
|
)
|
|
{
|
|
ASSERT (FALSE);
|
|
return FALSE;
|
|
}
|
|
|