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

@@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <openssl/md5.h>
#ifdef ENABLE_MD5_DEPRECATED_INTERFACES
/**
Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
@@ -25,10 +26,9 @@ Md5GetContextSize (
//
// Retrieves the OpenSSL MD5 Context Size
//
return (UINTN) (sizeof (MD5_CTX));
return (UINTN)(sizeof (MD5_CTX));
}
/**
Initializes user-supplied memory pointed by Md5Context as MD5 hash context for
subsequent use.
@@ -57,7 +57,7 @@ Md5Init (
//
// OpenSSL MD5 Context Initialization
//
return (BOOLEAN) (MD5_Init ((MD5_CTX *) Md5Context));
return (BOOLEAN)(MD5_Init ((MD5_CTX *)Md5Context));
}
/**
@@ -83,7 +83,7 @@ Md5Duplicate (
//
// Check input parameters.
//
if (Md5Context == NULL || NewMd5Context == NULL) {
if ((Md5Context == NULL) || (NewMd5Context == NULL)) {
return FALSE;
}
@@ -128,14 +128,14 @@ Md5Update (
//
// Check invalid parameters, in case that only DataLength was checked in OpenSSL
//
if (Data == NULL && (DataSize != 0)) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// OpenSSL MD5 Hash Update
//
return (BOOLEAN) (MD5_Update ((MD5_CTX *) Md5Context, Data, DataSize));
return (BOOLEAN)(MD5_Update ((MD5_CTX *)Md5Context, Data, DataSize));
}
/**
@@ -168,14 +168,14 @@ Md5Final (
//
// Check input parameters.
//
if (Md5Context == NULL || HashValue == NULL) {
if ((Md5Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// OpenSSL MD5 Hash Finalization
//
return (BOOLEAN) (MD5_Final (HashValue, (MD5_CTX *) Md5Context));
return (BOOLEAN)(MD5_Final (HashValue, (MD5_CTX *)Md5Context));
}
/**
@@ -210,7 +210,8 @@ Md5HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && (DataSize != 0)) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
@@ -223,4 +224,5 @@ Md5HashAll (
return TRUE;
}
}
#endif

View File

@@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <openssl/sha.h>
#ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
/**
Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
@@ -25,7 +26,7 @@ Sha1GetContextSize (
//
// Retrieves OpenSSL SHA Context Size
//
return (UINTN) (sizeof (SHA_CTX));
return (UINTN)(sizeof (SHA_CTX));
}
/**
@@ -56,7 +57,7 @@ Sha1Init (
//
// OpenSSL SHA-1 Context Initialization
//
return (BOOLEAN) (SHA1_Init ((SHA_CTX *) Sha1Context));
return (BOOLEAN)(SHA1_Init ((SHA_CTX *)Sha1Context));
}
/**
@@ -82,7 +83,7 @@ Sha1Duplicate (
//
// Check input parameters.
//
if (Sha1Context == NULL || NewSha1Context == NULL) {
if ((Sha1Context == NULL) || (NewSha1Context == NULL)) {
return FALSE;
}
@@ -127,14 +128,14 @@ Sha1Update (
//
// Check invalid parameters, in case that only DataLength was checked in OpenSSL
//
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// OpenSSL SHA-1 Hash Update
//
return (BOOLEAN) (SHA1_Update ((SHA_CTX *) Sha1Context, Data, DataSize));
return (BOOLEAN)(SHA1_Update ((SHA_CTX *)Sha1Context, Data, DataSize));
}
/**
@@ -167,14 +168,14 @@ Sha1Final (
//
// Check input parameters.
//
if (Sha1Context == NULL || HashValue == NULL) {
if ((Sha1Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// OpenSSL SHA-1 Hash Finalization
//
return (BOOLEAN) (SHA1_Final (HashValue, (SHA_CTX *) Sha1Context));
return (BOOLEAN)(SHA1_Final (HashValue, (SHA_CTX *)Sha1Context));
}
/**
@@ -209,7 +210,8 @@ Sha1HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
@@ -222,4 +224,5 @@ Sha1HashAll (
return TRUE;
}
}
#endif

View File

@@ -24,7 +24,7 @@ Sha256GetContextSize (
//
// Retrieves OpenSSL SHA-256 Context Size
//
return (UINTN) (sizeof (SHA256_CTX));
return (UINTN)(sizeof (SHA256_CTX));
}
/**
@@ -55,7 +55,7 @@ Sha256Init (
//
// OpenSSL SHA-256 Context Initialization
//
return (BOOLEAN) (SHA256_Init ((SHA256_CTX *) Sha256Context));
return (BOOLEAN)(SHA256_Init ((SHA256_CTX *)Sha256Context));
}
/**
@@ -81,7 +81,7 @@ Sha256Duplicate (
//
// Check input parameters.
//
if (Sha256Context == NULL || NewSha256Context == NULL) {
if ((Sha256Context == NULL) || (NewSha256Context == NULL)) {
return FALSE;
}
@@ -126,14 +126,14 @@ Sha256Update (
//
// Check invalid parameters, in case that only DataLength was checked in OpenSSL
//
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// OpenSSL SHA-256 Hash Update
//
return (BOOLEAN) (SHA256_Update ((SHA256_CTX *) Sha256Context, Data, DataSize));
return (BOOLEAN)(SHA256_Update ((SHA256_CTX *)Sha256Context, Data, DataSize));
}
/**
@@ -166,14 +166,14 @@ Sha256Final (
//
// Check input parameters.
//
if (Sha256Context == NULL || HashValue == NULL) {
if ((Sha256Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// OpenSSL SHA-256 Hash Finalization
//
return (BOOLEAN) (SHA256_Final (HashValue, (SHA256_CTX *) Sha256Context));
return (BOOLEAN)(SHA256_Final (HashValue, (SHA256_CTX *)Sha256Context));
}
/**
@@ -208,7 +208,8 @@ Sha256HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}

View File

@@ -24,7 +24,7 @@ Sha384GetContextSize (
//
// Retrieves OpenSSL SHA-384 Context Size
//
return (UINTN) (sizeof (SHA512_CTX));
return (UINTN)(sizeof (SHA512_CTX));
}
/**
@@ -55,7 +55,7 @@ Sha384Init (
//
// OpenSSL SHA-384 Context Initialization
//
return (BOOLEAN) (SHA384_Init ((SHA512_CTX *) Sha384Context));
return (BOOLEAN)(SHA384_Init ((SHA512_CTX *)Sha384Context));
}
/**
@@ -83,7 +83,7 @@ Sha384Duplicate (
//
// Check input parameters.
//
if (Sha384Context == NULL || NewSha384Context == NULL) {
if ((Sha384Context == NULL) || (NewSha384Context == NULL)) {
return FALSE;
}
@@ -128,14 +128,14 @@ Sha384Update (
//
// Check invalid parameters, in case that only DataLength was checked in OpenSSL
//
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// OpenSSL SHA-384 Hash Update
//
return (BOOLEAN) (SHA384_Update ((SHA512_CTX *) Sha384Context, Data, DataSize));
return (BOOLEAN)(SHA384_Update ((SHA512_CTX *)Sha384Context, Data, DataSize));
}
/**
@@ -168,14 +168,14 @@ Sha384Final (
//
// Check input parameters.
//
if (Sha384Context == NULL || HashValue == NULL) {
if ((Sha384Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// OpenSSL SHA-384 Hash Finalization
//
return (BOOLEAN) (SHA384_Final (HashValue, (SHA512_CTX *) Sha384Context));
return (BOOLEAN)(SHA384_Final (HashValue, (SHA512_CTX *)Sha384Context));
}
/**
@@ -210,7 +210,8 @@ Sha384HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
@@ -239,7 +240,7 @@ Sha512GetContextSize (
//
// Retrieves OpenSSL SHA-512 Context Size
//
return (UINTN) (sizeof (SHA512_CTX));
return (UINTN)(sizeof (SHA512_CTX));
}
/**
@@ -270,7 +271,7 @@ Sha512Init (
//
// OpenSSL SHA-512 Context Initialization
//
return (BOOLEAN) (SHA512_Init ((SHA512_CTX *) Sha512Context));
return (BOOLEAN)(SHA512_Init ((SHA512_CTX *)Sha512Context));
}
/**
@@ -298,7 +299,7 @@ Sha512Duplicate (
//
// Check input parameters.
//
if (Sha512Context == NULL || NewSha512Context == NULL) {
if ((Sha512Context == NULL) || (NewSha512Context == NULL)) {
return FALSE;
}
@@ -343,14 +344,14 @@ Sha512Update (
//
// Check invalid parameters, in case that only DataLength was checked in OpenSSL
//
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// OpenSSL SHA-512 Hash Update
//
return (BOOLEAN) (SHA512_Update ((SHA512_CTX *) Sha512Context, Data, DataSize));
return (BOOLEAN)(SHA512_Update ((SHA512_CTX *)Sha512Context, Data, DataSize));
}
/**
@@ -383,14 +384,14 @@ Sha512Final (
//
// Check input parameters.
//
if (Sha512Context == NULL || HashValue == NULL) {
if ((Sha512Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// OpenSSL SHA-512 Hash Finalization
//
return (BOOLEAN) (SHA384_Final (HashValue, (SHA512_CTX *) Sha512Context));
return (BOOLEAN)(SHA384_Final (HashValue, (SHA512_CTX *)Sha512Context));
}
/**
@@ -425,7 +426,8 @@ Sha512HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}

View File

@@ -24,7 +24,7 @@ Sm3GetContextSize (
//
// Retrieves Openssl SM3 Context Size
//
return (UINTN) (sizeof (SM3_CTX));
return (UINTN)(sizeof (SM3_CTX));
}
/**
@@ -55,7 +55,7 @@ Sm3Init (
//
// Openssl SM3 Context Initialization
//
sm3_init ((SM3_CTX *) Sm3Context);
sm3_init ((SM3_CTX *)Sm3Context);
return TRUE;
}
@@ -84,7 +84,7 @@ Sm3Duplicate (
//
// Check input parameters.
//
if (Sm3Context == NULL || NewSm3Context == NULL) {
if ((Sm3Context == NULL) || (NewSm3Context == NULL)) {
return FALSE;
}
@@ -129,14 +129,14 @@ Sm3Update (
//
// Check invalid parameters, in case that only DataLength was checked in Openssl
//
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// Openssl SM3 Hash Update
//
sm3_update ((SM3_CTX *) Sm3Context, Data, DataSize);
sm3_update ((SM3_CTX *)Sm3Context, Data, DataSize);
return TRUE;
}
@@ -171,14 +171,14 @@ Sm3Final (
//
// Check input parameters.
//
if (Sm3Context == NULL || HashValue == NULL) {
if ((Sm3Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
//
// Openssl SM3 Hash Finalization
//
sm3_final (HashValue, (SM3_CTX *) Sm3Context);
sm3_final (HashValue, (SM3_CTX *)Sm3Context);
return TRUE;
}
@@ -209,7 +209,7 @@ Sm3HashAll (
OUT UINT8 *HashValue
)
{
SM3_CTX Ctx;
SM3_CTX Ctx;
//
// Check input parameters.
@@ -217,18 +217,19 @@ Sm3HashAll (
if (HashValue == NULL) {
return FALSE;
}
if (Data == NULL && DataSize != 0) {
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
//
// SM3 Hash Computation.
//
sm3_init(&Ctx);
sm3_init (&Ctx);
sm3_update(&Ctx, Data, DataSize);
sm3_update (&Ctx, Data, DataSize);
sm3_final(HashValue, &Ctx);
sm3_final (HashValue, &Ctx);
return TRUE;
}