]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
2 Internal include file for BaseCryptLib.
4 Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __INTERNAL_CRYPT_LIB_H__
10 #define __INTERNAL_CRYPT_LIB_H__
15 #include <Library/BaseLib.h>
16 #include <Library/BaseMemoryLib.h>
17 #include <Library/MemoryAllocationLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/BaseCryptLib.h>
21 #include "CrtLibSupport.h"
23 #include <openssl/opensslv.h>
25 #if OPENSSL_VERSION_NUMBER < 0x10100000L
26 #define OBJ_get0_data(o) ((o)->data)
27 #define OBJ_length(o) ((o)->length)
31 Check input P7Data is a wrapped ContentInfo structure or not. If not construct
32 a new structure to wrap P7Data.
34 Caution: This function may receive untrusted input.
35 UEFI Authenticated Variable is external input, so this function will do basic
36 check for PKCS#7 data structure.
38 @param[in] P7Data Pointer to the PKCS#7 message to verify.
39 @param[in] P7Length Length of the PKCS#7 message in bytes.
40 @param[out] WrapFlag If TRUE P7Data is a ContentInfo structure, otherwise
42 @param[out] WrapData If return status of this function is TRUE:
43 1) when WrapFlag is TRUE, pointer to P7Data.
44 2) when WrapFlag is FALSE, pointer to a new ContentInfo
45 structure. It's caller's responsibility to free this
47 @param[out] WrapDataSize Length of ContentInfo structure in bytes.
49 @retval TRUE The operation is finished successfully.
50 @retval FALSE The operation is failed due to lack of resources.
55 IN CONST UINT8
*P7Data
,
57 OUT BOOLEAN
*WrapFlag
,
59 OUT UINTN
*WrapDataSize