summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/OpensslLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:54 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit7c342378317039e632d9a1a5d4cf7c21aec8cb7a (patch)
tree6b34f630a779ee11db93c02cf54fa65c29716aed /CryptoPkg/Library/OpensslLib
parent2b16a4fb91b9b31c0d152588f5ac51080c6c0763 (diff)
downloadedk2-7c342378317039e632d9a1a5d4cf7c21aec8cb7a.tar.gz
edk2-7c342378317039e632d9a1a5d4cf7c21aec8cb7a.tar.bz2
edk2-7c342378317039e632d9a1a5d4cf7c21aec8cb7a.zip
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>
Diffstat (limited to 'CryptoPkg/Library/OpensslLib')
-rw-r--r--CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c2
-rw-r--r--CryptoPkg/Library/OpensslLib/X64/ApiHooks.c3
-rw-r--r--CryptoPkg/Library/OpensslLib/buildinf.h2
-rw-r--r--CryptoPkg/Library/OpensslLib/ossl_store.c6
-rw-r--r--CryptoPkg/Library/OpensslLib/rand_pool.c50
5 files changed, 31 insertions, 32 deletions
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
index 74ae1ac20c..18d8a56128 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -8,7 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Uefi.h>
-
/**
An internal OpenSSL function which fetches a local copy of the hardware
capability flags.
@@ -41,4 +40,3 @@ OpensslLibConstructor (
return EFI_SUCCESS;
}
-
diff --git a/CryptoPkg/Library/OpensslLib/X64/ApiHooks.c b/CryptoPkg/Library/OpensslLib/X64/ApiHooks.c
index 0c8043aa8e..84f0d884d1 100644
--- a/CryptoPkg/Library/OpensslLib/X64/ApiHooks.c
+++ b/CryptoPkg/Library/OpensslLib/X64/ApiHooks.c
@@ -14,9 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
VOID *
__imp_RtlVirtualUnwind (
- VOID * Args
+ VOID *Args
)
{
return NULL;
}
-
diff --git a/CryptoPkg/Library/OpensslLib/buildinf.h b/CryptoPkg/Library/OpensslLib/buildinf.h
index b840c8656a..9042c7526f 100644
--- a/CryptoPkg/Library/OpensslLib/buildinf.h
+++ b/CryptoPkg/Library/OpensslLib/buildinf.h
@@ -1,4 +1,4 @@
#define PLATFORM "UEFI"
#define DATE "Fri Dec 22 01:23:45 PDT 2017"
-const char * compiler_flags = "compiler: information not available from edk2";
+const char *compiler_flags = "compiler: information not available from edk2";
diff --git a/CryptoPkg/Library/OpensslLib/ossl_store.c b/CryptoPkg/Library/OpensslLib/ossl_store.c
index 29e1506048..b4297395d7 100644
--- a/CryptoPkg/Library/OpensslLib/ossl_store.c
+++ b/CryptoPkg/Library/OpensslLib/ossl_store.c
@@ -11,7 +11,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
*
* Dummy Implement for UEFI
*/
-void ossl_store_cleanup_int(void)
+void
+ossl_store_cleanup_int (
+ void
+ )
{
}
-
diff --git a/CryptoPkg/Library/OpensslLib/rand_pool.c b/CryptoPkg/Library/OpensslLib/rand_pool.c
index 6218ae0c1c..13e860a853 100644
--- a/CryptoPkg/Library/OpensslLib/rand_pool.c
+++ b/CryptoPkg/Library/OpensslLib/rand_pool.c
@@ -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];
+
+ RandGetBytes (sizeof (data), data);
- return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);
+ 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];
+
+ RandGetBytes (sizeof (data), data);
- return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);
+ 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
)
{
}