TianoCore EDK2 master
|
#include "InternalCryptLib.h"
#include <mbedtls/pkcs7.h>
Go to the source code of this file.
Functions | |
BOOLEAN EFIAPI | Pkcs7GetAttachedContent (IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT VOID **Content, OUT UINTN *ContentSize) |
Non-runtime specific implementation of PKCS#7 SignedData Verification Wrapper.
Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CryptPkcs7VerifyBase.c.
BOOLEAN EFIAPI Pkcs7GetAttachedContent | ( | IN CONST UINT8 * | P7Data, |
IN UINTN | P7Length, | ||
OUT VOID ** | Content, | ||
OUT UINTN * | ContentSize | ||
) |
Extracts the attached content from a PKCS#7 signed data if existed. The input signed data could be wrapped in a ContentInfo structure.
If P7Data, Content, or ContentSize is NULL, then return FALSE. If P7Length overflow, then return FALSE. If the P7Data is not correctly formatted, then return FALSE.
Caution: This function may receive untrusted input. So this function will do basic check for PKCS#7 data structure.
[in] | P7Data | Pointer to the PKCS#7 signed data to process. |
[in] | P7Length | Length of the PKCS#7 signed data in bytes. |
[out] | Content | Pointer to the extracted content from the PKCS#7 signedData. It's caller's responsibility to free the buffer with FreePool(). |
[out] | ContentSize | The size of the extracted content in bytes. |
TRUE | The P7Data was correctly formatted for processing. |
FALSE | The P7Data was not correctly formatted for processing. |
Definition at line 34 of file CryptPkcs7VerifyBase.c.