mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
CryptoPkg/openssl: adapt rand_pool.c to openssl 3.0 changes
Some functions have been renamed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com> Cc: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Brian J. Johnson <brian.johnson@hpe.com> Tested-by: Kenneth Lautner <klautner@microsoft.com>
This commit is contained in:
parent
eac38f74c4
commit
c638d1f672
@ -74,7 +74,7 @@ RandGetBytes (
|
|||||||
* This is OpenSSL required interface.
|
* This is OpenSSL required interface.
|
||||||
*/
|
*/
|
||||||
size_t
|
size_t
|
||||||
rand_pool_acquire_entropy (
|
ossl_pool_acquire_entropy (
|
||||||
RAND_POOL *pool
|
RAND_POOL *pool
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -82,21 +82,21 @@ rand_pool_acquire_entropy (
|
|||||||
size_t Bytes_needed;
|
size_t Bytes_needed;
|
||||||
unsigned char *Buffer;
|
unsigned char *Buffer;
|
||||||
|
|
||||||
Bytes_needed = rand_pool_bytes_needed (pool, 1 /*entropy_factor*/);
|
Bytes_needed = ossl_rand_pool_bytes_needed (pool, 1 /*entropy_factor*/);
|
||||||
if (Bytes_needed > 0) {
|
if (Bytes_needed > 0) {
|
||||||
Buffer = rand_pool_add_begin (pool, Bytes_needed);
|
Buffer = ossl_rand_pool_add_begin (pool, Bytes_needed);
|
||||||
|
|
||||||
if (Buffer != NULL) {
|
if (Buffer != NULL) {
|
||||||
Ret = RandGetBytes (Bytes_needed, Buffer);
|
Ret = RandGetBytes (Bytes_needed, Buffer);
|
||||||
if (FALSE == Ret) {
|
if (FALSE == Ret) {
|
||||||
rand_pool_add_end (pool, 0, 0);
|
ossl_rand_pool_add_end (pool, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
rand_pool_add_end (pool, Bytes_needed, 8 * Bytes_needed);
|
ossl_rand_pool_add_end (pool, Bytes_needed, 8 * Bytes_needed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rand_pool_entropy_available (pool);
|
return ossl_rand_pool_entropy_available (pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -105,7 +105,7 @@ rand_pool_acquire_entropy (
|
|||||||
* This is OpenSSL required interface.
|
* This is OpenSSL required interface.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
rand_pool_add_nonce_data (
|
ossl_pool_add_nonce_data (
|
||||||
RAND_POOL *pool
|
RAND_POOL *pool
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ rand_pool_add_nonce_data (
|
|||||||
|
|
||||||
RandGetBytes (sizeof (data), data);
|
RandGetBytes (sizeof (data), data);
|
||||||
|
|
||||||
return rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
|
return ossl_rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -130,7 +130,7 @@ rand_pool_add_additional_data (
|
|||||||
|
|
||||||
RandGetBytes (sizeof (data), data);
|
RandGetBytes (sizeof (data), data);
|
||||||
|
|
||||||
return rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
|
return ossl_rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -139,7 +139,7 @@ rand_pool_add_additional_data (
|
|||||||
* This is OpenSSL required interface.
|
* This is OpenSSL required interface.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
rand_pool_init (
|
ossl_rand_pool_init (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -152,7 +152,7 @@ rand_pool_init (
|
|||||||
* This is OpenSSL required interface.
|
* This is OpenSSL required interface.
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
rand_pool_cleanup (
|
ossl_rand_pool_cleanup (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -164,7 +164,7 @@ rand_pool_cleanup (
|
|||||||
* This is OpenSSL required interface.
|
* This is OpenSSL required interface.
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
rand_pool_keep_random_devices_open (
|
ossl_rand_pool_keep_random_devices_open (
|
||||||
int keep
|
int keep
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user