summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.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/Pem/CryptPem.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/Pem/CryptPem.c')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c b/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
index 6f7e1971f8..7733d772f4 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
@@ -30,14 +30,14 @@ PasswordCallback (
{
INTN KeyLength;
- ZeroMem ((VOID *) Buf, (UINTN) Size);
+ ZeroMem ((VOID *)Buf, (UINTN)Size);
if (Key != NULL) {
//
// Duplicate key phrase directly.
//
- KeyLength = (INTN) AsciiStrLen ((CHAR8 *)Key);
- KeyLength = (KeyLength > Size ) ? Size : KeyLength;
- CopyMem (Buf, Key, (UINTN) KeyLength);
+ KeyLength = (INTN)AsciiStrLen ((CHAR8 *)Key);
+ KeyLength = (KeyLength > Size) ? Size : KeyLength;
+ CopyMem (Buf, Key, (UINTN)KeyLength);
return KeyLength;
} else {
return 0;
@@ -76,7 +76,7 @@ RsaGetPrivateKeyFromPem (
//
// Check input parameters.
//
- if (PemData == NULL || RsaContext == NULL || PemSize > INT_MAX) {
+ if ((PemData == NULL) || (RsaContext == NULL) || (PemSize > INT_MAX)) {
return FALSE;
}
@@ -87,9 +87,11 @@ RsaGetPrivateKeyFromPem (
if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {
return FALSE;
}
+
if (EVP_add_cipher (EVP_aes_192_cbc ()) == 0) {
return FALSE;
}
+
if (EVP_add_cipher (EVP_aes_256_cbc ()) == 0) {
return FALSE;
}
@@ -104,14 +106,14 @@ RsaGetPrivateKeyFromPem (
goto _Exit;
}
- if (BIO_write (PemBio, PemData, (int) PemSize) <= 0) {
+ if (BIO_write (PemBio, PemData, (int)PemSize) <= 0) {
goto _Exit;
}
//
// Retrieve RSA Private Key from encrypted PEM data.
//
- *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *) &PasswordCallback, (void *) Password);
+ *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *)&PasswordCallback, (void *)Password);
if (*RsaContext != NULL) {
Status = TRUE;
}