]>
Commit | Line | Data |
---|---|---|
22ac5cc9 SA |
1 | /** @file\r |
2 | RSA-PSS Asymmetric Cipher Wrapper Implementation over OpenSSL.\r | |
3 | \r | |
4 | This file does not provide real capabilities for following APIs in RSA handling:\r | |
5 | 1) RsaPssSign\r | |
6 | \r | |
7 | Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #include "InternalCryptLib.h"\r | |
13 | \r | |
14 | /**\r | |
15 | Carries out the RSA-SSA signature generation with EMSA-PSS encoding scheme.\r | |
16 | \r | |
17 | This function carries out the RSA-SSA signature generation with EMSA-PSS encoding scheme defined in\r | |
18 | RFC 8017.\r | |
19 | Mask generation function is the same as the message digest algorithm.\r | |
20 | If the Signature buffer is too small to hold the contents of signature, FALSE\r | |
21 | is returned and SigSize is set to the required buffer size to obtain the signature.\r | |
22 | \r | |
23 | If RsaContext is NULL, then return FALSE.\r | |
24 | If Message is NULL, then return FALSE.\r | |
25 | If MsgSize is zero or > INT_MAX, then return FALSE.\r | |
26 | If DigestLen is NOT 32, 48 or 64, return FALSE.\r | |
27 | If SaltLen is < DigestLen, then return FALSE.\r | |
28 | If SigSize is large enough but Signature is NULL, then return FALSE.\r | |
29 | If this interface is not supported, then return FALSE.\r | |
30 | \r | |
31 | @param[in] RsaContext Pointer to RSA context for signature generation.\r | |
32 | @param[in] Message Pointer to octet message to be signed.\r | |
33 | @param[in] MsgSize Size of the message in bytes.\r | |
34 | @param[in] DigestLen Length of the digest in bytes to be used for RSA signature operation.\r | |
35 | @param[in] SaltLen Length of the salt in bytes to be used for PSS encoding.\r | |
36 | @param[out] Signature Pointer to buffer to receive RSA PSS signature.\r | |
37 | @param[in, out] SigSize On input, the size of Signature buffer in bytes.\r | |
38 | On output, the size of data returned in Signature buffer in bytes.\r | |
39 | \r | |
40 | @retval TRUE Signature successfully generated in RSASSA-PSS.\r | |
41 | @retval FALSE Signature generation failed.\r | |
42 | @retval FALSE SigSize is too small.\r | |
43 | @retval FALSE This interface is not supported.\r | |
44 | \r | |
45 | **/\r | |
46 | BOOLEAN\r | |
47 | EFIAPI\r | |
48 | RsaPssSign (\r | |
49 | IN VOID *RsaContext,\r | |
50 | IN CONST UINT8 *Message,\r | |
51 | IN UINTN MsgSize,\r | |
52 | IN UINT16 DigestLen,\r | |
53 | IN UINT16 SaltLen,\r | |
54 | OUT UINT8 *Signature,\r | |
55 | IN OUT UINTN *SigSize\r | |
56 | )\r | |
57 | {\r | |
58 | ASSERT (FALSE);\r | |
59 | return FALSE;\r | |
60 | }\r |