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