VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h@ 108832

Last change on this file since 108832 was 101291, checked in by vboxsync, 19 months ago

EFI/FirmwareNew: Make edk2-stable202308 build on all supported platforms (using gcc at least, msvc not tested yet), bugref:4643

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/** @file
2 Internal include file for BaseCryptLib.
3
4Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __INTERNAL_CRYPT_LIB_H__
10#define __INTERNAL_CRYPT_LIB_H__
11
12#undef _WIN32
13#undef _WIN64
14
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>
20
21#include "CrtLibSupport.h"
22
23#define OPENSSL_NO_DEPRECATED 0
24
25#include <openssl/opensslv.h>
26
27#if OPENSSL_VERSION_NUMBER < 0x10100000L
28#define OBJ_get0_data(o) ((o)->data)
29#define OBJ_length(o) ((o)->length)
30#endif
31
32/**
33 Check input P7Data is a wrapped ContentInfo structure or not. If not construct
34 a new structure to wrap P7Data.
35
36 Caution: This function may receive untrusted input.
37 UEFI Authenticated Variable is external input, so this function will do basic
38 check for PKCS#7 data structure.
39
40 @param[in] P7Data Pointer to the PKCS#7 message to verify.
41 @param[in] P7Length Length of the PKCS#7 message in bytes.
42 @param[out] WrapFlag If TRUE P7Data is a ContentInfo structure, otherwise
43 return FALSE.
44 @param[out] WrapData If return status of this function is TRUE:
45 1) when WrapFlag is TRUE, pointer to P7Data.
46 2) when WrapFlag is FALSE, pointer to a new ContentInfo
47 structure. It's caller's responsibility to free this
48 buffer.
49 @param[out] WrapDataSize Length of ContentInfo structure in bytes.
50
51 @retval TRUE The operation is finished successfully.
52 @retval FALSE The operation is failed due to lack of resources.
53
54**/
55BOOLEAN
56WrapPkcs7Data (
57 IN CONST UINT8 *P7Data,
58 IN UINTN P7Length,
59 OUT BOOLEAN *WrapFlag,
60 OUT UINT8 **WrapData,
61 OUT UINTN *WrapDataSize
62 );
63
64#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette