CryptoPkg: Add Null instance of the BaseCryptLib class
https://bugzilla.tianocore.org/show_bug.cgi?id=2257 Add a Null instance of the BaseCryptLib class. This lib instance can be used as a template for new implementations of the BaseCryptLib class and can also be used to reduce CI build times for build checks that depend on the BaseCryptLib class. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
committed by
Michael D Kinney
parent
20c082e8d7
commit
d95de082da
51
CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs1OaepNull.c
Normal file
51
CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs1OaepNull.c
Normal file
@@ -0,0 +1,51 @@
|
||||
/** @file
|
||||
This file contains UEFI wrapper functions for RSA PKCS1v2 OAEP encryption routines.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
Copyright (C) 2016 Microsoft Corporation. All Rights Reserved.
|
||||
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
**/
|
||||
|
||||
#include "InternalCryptLib.h"
|
||||
|
||||
/**
|
||||
Encrypts a blob using PKCS1v2 (RSAES-OAEP) schema. On success, will return the
|
||||
encrypted message in a newly allocated buffer.
|
||||
|
||||
Return FALSE to indicate this interface is not supported.
|
||||
|
||||
@param[in] PublicKey A pointer to the DER-encoded X509 certificate that
|
||||
will be used to encrypt the data.
|
||||
@param[in] PublicKeySize Size of the X509 cert buffer.
|
||||
@param[in] InData Data to be encrypted.
|
||||
@param[in] InDataSize Size of the data buffer.
|
||||
@param[in] PrngSeed [Optional] If provided, a pointer to a random seed buffer
|
||||
to be used when initializing the PRNG. NULL otherwise.
|
||||
@param[in] PrngSeedSize [Optional] If provided, size of the random seed buffer.
|
||||
0 otherwise.
|
||||
@param[out] EncryptedData Pointer to an allocated buffer containing the encrypted
|
||||
message.
|
||||
@param[out] EncryptedDataSize Size of the encrypted message buffer.
|
||||
|
||||
@retval FALSE This interface is not supported.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
Pkcs1v2Encrypt (
|
||||
IN CONST UINT8 *PublicKey,
|
||||
IN UINTN PublicKeySize,
|
||||
IN UINT8 *InData,
|
||||
IN UINTN InDataSize,
|
||||
IN CONST UINT8 *PrngSeed, OPTIONAL
|
||||
IN UINTN PrngSeedSize, OPTIONAL
|
||||
OUT UINT8 **EncryptedData,
|
||||
OUT UINTN *EncryptedDataSize
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user