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

@@ -67,8 +67,9 @@ Pkcs1v2Encrypt (
//
// Check input parameters.
//
if (PublicKey == NULL || InData == NULL ||
EncryptedData == NULL || EncryptedDataSize == NULL) {
if ((PublicKey == NULL) || (InData == NULL) ||
(EncryptedData == NULL) || (EncryptedDataSize == NULL))
{
return FALSE;
}
@@ -82,15 +83,15 @@ Pkcs1v2Encrypt (
return FALSE;
}
*EncryptedData = NULL;
*EncryptedDataSize = 0;
Result = FALSE;
TempPointer = NULL;
CertData = NULL;
InternalPublicKey = NULL;
PkeyCtx = NULL;
OutData = NULL;
OutDataSize = 0;
*EncryptedData = NULL;
*EncryptedDataSize = 0;
Result = FALSE;
TempPointer = NULL;
CertData = NULL;
InternalPublicKey = NULL;
PkeyCtx = NULL;
OutData = NULL;
OutDataSize = 0;
//
// If it provides a seed then use it.
@@ -107,7 +108,7 @@ Pkcs1v2Encrypt (
// Parse the X509 cert and extract the public key.
//
TempPointer = PublicKey;
CertData = d2i_X509 (&CertData, &TempPointer, (UINT32)PublicKeySize);
CertData = d2i_X509 (&CertData, &TempPointer, (UINT32)PublicKeySize);
if (CertData == NULL) {
//
// Fail to parse X509 cert.
@@ -137,11 +138,13 @@ Pkcs1v2Encrypt (
//
goto _Exit;
}
//
// Initialize the context and set the desired padding.
//
if (EVP_PKEY_encrypt_init (PkeyCtx) <= 0 ||
EVP_PKEY_CTX_set_rsa_padding (PkeyCtx, RSA_PKCS1_OAEP_PADDING) <= 0) {
if ((EVP_PKEY_encrypt_init (PkeyCtx) <= 0) ||
(EVP_PKEY_CTX_set_rsa_padding (PkeyCtx, RSA_PKCS1_OAEP_PADDING) <= 0))
{
//
// Fail to initialize the context.
//
@@ -177,7 +180,7 @@ Pkcs1v2Encrypt (
// Fail to encrypt data, need to free the output buffer.
//
FreePool (OutData);
OutData = NULL;
OutData = NULL;
OutDataSize = 0;
goto _Exit;
}
@@ -185,20 +188,22 @@ Pkcs1v2Encrypt (
//
// Encrypt done.
//
*EncryptedData = OutData;
*EncryptedData = OutData;
*EncryptedDataSize = OutDataSize;
Result = TRUE;
Result = TRUE;
_Exit:
//
// Release Resources
//
if (CertData != NULL) {
X509_free (CertData );
X509_free (CertData);
}
if (InternalPublicKey != NULL) {
EVP_PKEY_free (InternalPublicKey);
}
if (PkeyCtx != NULL) {
EVP_PKEY_CTX_free (PkeyCtx);
}