CryptoPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the CryptoPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:54 -08:00
committed by mergify[bot]
parent 2b16a4fb91
commit 7c34237831
101 changed files with 4323 additions and 3711 deletions

View File

@@ -29,22 +29,21 @@ STATIC
BOOLEAN
EFIAPI
RandGetBytes (
IN UINTN Length,
OUT UINT8 *RandBuffer
IN UINTN Length,
OUT UINT8 *RandBuffer
)
{
BOOLEAN Ret;
UINT64 TempRand;
BOOLEAN Ret;
UINT64 TempRand;
Ret = FALSE;
if (RandBuffer == NULL) {
DEBUG((DEBUG_ERROR, "[OPENSSL_RAND_POOL] NULL RandBuffer. No random numbers are generated and your system is not secure\n"));
DEBUG ((DEBUG_ERROR, "[OPENSSL_RAND_POOL] NULL RandBuffer. No random numbers are generated and your system is not secure\n"));
ASSERT (RandBuffer != NULL); // Since we can't generate random numbers, we should assert. Otherwise we will just blow up later.
return Ret;
}
while (Length > 0) {
// Use RngLib to get random number
Ret = GetRandomNumber64 (&TempRand);
@@ -52,12 +51,12 @@ RandGetBytes (
if (!Ret) {
return Ret;
}
if (Length >= sizeof (TempRand)) {
*((UINT64*) RandBuffer) = TempRand;
RandBuffer += sizeof (UINT64);
Length -= sizeof (TempRand);
}
else {
*((UINT64 *)RandBuffer) = TempRand;
RandBuffer += sizeof (UINT64);
Length -= sizeof (TempRand);
} else {
CopyMem (RandBuffer, &TempRand, Length);
Length = 0;
}
@@ -76,12 +75,12 @@ RandGetBytes (
*/
size_t
rand_pool_acquire_entropy (
RAND_POOL *pool
RAND_POOL *pool
)
{
BOOLEAN Ret;
size_t Bytes_needed;
unsigned char *Buffer;
unsigned char *Buffer;
Bytes_needed = rand_pool_bytes_needed (pool, 1 /*entropy_factor*/);
if (Bytes_needed > 0) {
@@ -91,8 +90,7 @@ rand_pool_acquire_entropy (
Ret = RandGetBytes (Bytes_needed, Buffer);
if (FALSE == Ret) {
rand_pool_add_end (pool, 0, 0);
}
else {
} else {
rand_pool_add_end (pool, Bytes_needed, 8 * Bytes_needed);
}
}
@@ -108,13 +106,14 @@ rand_pool_acquire_entropy (
*/
int
rand_pool_add_nonce_data (
RAND_POOL *pool
RAND_POOL *pool
)
{
UINT8 data[16];
RandGetBytes (sizeof(data), data);
UINT8 data[16];
return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);
RandGetBytes (sizeof (data), data);
return rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
}
/*
@@ -124,13 +123,14 @@ rand_pool_add_nonce_data (
*/
int
rand_pool_add_additional_data (
RAND_POOL *pool
RAND_POOL *pool
)
{
UINT8 data[16];
RandGetBytes (sizeof(data), data);
UINT8 data[16];
return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);
RandGetBytes (sizeof (data), data);
return rand_pool_add (pool, (unsigned char *)&data, sizeof (data), 0);
}
/*
@@ -152,7 +152,7 @@ rand_pool_init (
* This is OpenSSL required interface.
*/
VOID
rand_pool_cleanup(
rand_pool_cleanup (
VOID
)
{
@@ -165,7 +165,7 @@ rand_pool_cleanup(
*/
VOID
rand_pool_keep_random_devices_open (
int keep
int keep
)
{
}