]>
Commit | Line | Data |
---|---|---|
ec7ad9e1 | 1 | /** @file\r |
a8c44645 | 2 | Internal include file for BaseCryptLib.\r |
3 | \r | |
fc9fa685 | 4 | Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r |
a8c44645 | 5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __INTERNAL_CRYPT_LIB_H__\r | |
16 | #define __INTERNAL_CRYPT_LIB_H__\r | |
17 | \r | |
ec7ad9e1 QL |
18 | #undef _WIN32\r |
19 | #undef _WIN64\r | |
20 | \r | |
a8c44645 | 21 | #include <Library/BaseLib.h>\r |
22 | #include <Library/BaseMemoryLib.h>\r | |
23 | #include <Library/MemoryAllocationLib.h>\r | |
24 | #include <Library/DebugLib.h>\r | |
25 | #include <Library/BaseCryptLib.h>\r | |
26 | \r | |
fc9fa685 | 27 | #include "CrtLibSupport.h"\r |
dda39f3a | 28 | \r |
338bfd97 DW |
29 | #include <openssl/opensslv.h>\r |
30 | \r | |
31 | #if OPENSSL_VERSION_NUMBER < 0x10100000L\r | |
32 | #define OBJ_get0_data(o) ((o)->data)\r | |
33 | #define OBJ_length(o) ((o)->length)\r | |
34 | #endif\r | |
35 | \r | |
cc01b26e JW |
36 | /**\r |
37 | Check input P7Data is a wrapped ContentInfo structure or not. If not construct\r | |
38 | a new structure to wrap P7Data.\r | |
39 | \r | |
40 | Caution: This function may receive untrusted input.\r | |
41 | UEFI Authenticated Variable is external input, so this function will do basic\r | |
42 | check for PKCS#7 data structure.\r | |
43 | \r | |
44 | @param[in] P7Data Pointer to the PKCS#7 message to verify.\r | |
45 | @param[in] P7Length Length of the PKCS#7 message in bytes.\r | |
46 | @param[out] WrapFlag If TRUE P7Data is a ContentInfo structure, otherwise\r | |
47 | return FALSE.\r | |
48 | @param[out] WrapData If return status of this function is TRUE:\r | |
49 | 1) when WrapFlag is TRUE, pointer to P7Data.\r | |
50 | 2) when WrapFlag is FALSE, pointer to a new ContentInfo\r | |
51 | structure. It's caller's responsibility to free this\r | |
52 | buffer.\r | |
53 | @param[out] WrapDataSize Length of ContentInfo structure in bytes.\r | |
54 | \r | |
55 | @retval TRUE The operation is finished successfully.\r | |
56 | @retval FALSE The operation is failed due to lack of resources.\r | |
57 | \r | |
58 | **/\r | |
59 | BOOLEAN\r | |
60 | WrapPkcs7Data (\r | |
61 | IN CONST UINT8 *P7Data,\r | |
62 | IN UINTN P7Length,\r | |
63 | OUT BOOLEAN *WrapFlag,\r | |
64 | OUT UINT8 **WrapData,\r | |
65 | OUT UINTN *WrapDataSize\r | |
66 | );\r | |
67 | \r | |
a8c44645 | 68 | #endif\r |