summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c
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/BaseCryptLib/Pk/CryptPkcs1Oaep.c
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/BaseCryptLib/Pk/CryptPkcs1Oaep.c')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c
index 970fa2a36e..ea43c1381c 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c
@@ -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);
}