]>
Commit | Line | Data |
---|---|---|
933f1990 BB |
1 | /** @file\r |
2 | This file contains UEFI wrapper functions for RSA PKCS1v2 OAEP encryption routines.\r | |
3 | \r | |
4 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
5 | \r | |
6 | Copyright (C) 2016 Microsoft Corporation. All Rights Reserved.\r | |
7 | Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r | |
8 | \r | |
9 | **/\r | |
10 | \r | |
11 | #include "InternalCryptLib.h"\r | |
12 | \r | |
13 | /**\r | |
14 | Encrypts a blob using PKCS1v2 (RSAES-OAEP) schema. On success, will return the\r | |
15 | encrypted message in a newly allocated buffer.\r | |
16 | \r | |
17 | Return FALSE to indicate this interface is not supported.\r | |
18 | \r | |
19 | @param[in] PublicKey A pointer to the DER-encoded X509 certificate that\r | |
20 | will be used to encrypt the data.\r | |
21 | @param[in] PublicKeySize Size of the X509 cert buffer.\r | |
22 | @param[in] InData Data to be encrypted.\r | |
23 | @param[in] InDataSize Size of the data buffer.\r | |
24 | @param[in] PrngSeed [Optional] If provided, a pointer to a random seed buffer\r | |
25 | to be used when initializing the PRNG. NULL otherwise.\r | |
26 | @param[in] PrngSeedSize [Optional] If provided, size of the random seed buffer.\r | |
27 | 0 otherwise.\r | |
28 | @param[out] EncryptedData Pointer to an allocated buffer containing the encrypted\r | |
29 | message.\r | |
30 | @param[out] EncryptedDataSize Size of the encrypted message buffer.\r | |
31 | \r | |
32 | @retval FALSE This interface is not supported.\r | |
33 | \r | |
34 | **/\r | |
35 | BOOLEAN\r | |
36 | EFIAPI\r | |
37 | Pkcs1v2Encrypt (\r | |
38 | IN CONST UINT8 *PublicKey,\r | |
39 | IN UINTN PublicKeySize,\r | |
40 | IN UINT8 *InData,\r | |
41 | IN UINTN InDataSize,\r | |
42 | IN CONST UINT8 *PrngSeed, OPTIONAL\r | |
43 | IN UINTN PrngSeedSize, OPTIONAL\r | |
44 | OUT UINT8 **EncryptedData,\r | |
45 | OUT UINTN *EncryptedDataSize\r | |
46 | )\r | |
47 | {\r | |
48 | ASSERT (FALSE);\r | |
49 | return FALSE;\r | |
50 | }\r | |
51 | \r |