]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
CryptoPkg: Apply uncrustify changes
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Pem / CryptPem.c
index 6f7e1971f8e196ab3e99d387dfced2454cad3842..7733d772f40ab023119257511f940993192a4a8a 100644 (file)
@@ -30,14 +30,14 @@ PasswordCallback (
 {\r
   INTN  KeyLength;\r
 \r
-  ZeroMem ((VOID *) Buf, (UINTN) Size);\r
+  ZeroMem ((VOID *)Buf, (UINTN)Size);\r
   if (Key != NULL) {\r
     //\r
     // Duplicate key phrase directly.\r
     //\r
-    KeyLength = (INTN) AsciiStrLen ((CHAR8 *)Key);\r
-    KeyLength = (KeyLength > Size ) ? Size : KeyLength;\r
-    CopyMem (Buf, Key, (UINTN) KeyLength);\r
+    KeyLength = (INTN)AsciiStrLen ((CHAR8 *)Key);\r
+    KeyLength = (KeyLength > Size) ? Size : KeyLength;\r
+    CopyMem (Buf, Key, (UINTN)KeyLength);\r
     return KeyLength;\r
   } else {\r
     return 0;\r
@@ -76,7 +76,7 @@ RsaGetPrivateKeyFromPem (
   //\r
   // Check input parameters.\r
   //\r
-  if (PemData == NULL || RsaContext == NULL || PemSize > INT_MAX) {\r
+  if ((PemData == NULL) || (RsaContext == NULL) || (PemSize > INT_MAX)) {\r
     return FALSE;\r
   }\r
 \r
@@ -87,9 +87,11 @@ RsaGetPrivateKeyFromPem (
   if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {\r
     return FALSE;\r
   }\r
+\r
   if (EVP_add_cipher (EVP_aes_192_cbc ()) == 0) {\r
     return FALSE;\r
   }\r
+\r
   if (EVP_add_cipher (EVP_aes_256_cbc ()) == 0) {\r
     return FALSE;\r
   }\r
@@ -104,14 +106,14 @@ RsaGetPrivateKeyFromPem (
     goto _Exit;\r
   }\r
 \r
-  if (BIO_write (PemBio, PemData, (int) PemSize) <= 0) {\r
+  if (BIO_write (PemBio, PemData, (int)PemSize) <= 0) {\r
     goto _Exit;\r
   }\r
 \r
   //\r
   // Retrieve RSA Private Key from encrypted PEM data.\r
   //\r
-  *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *) &PasswordCallback, (void *) Password);\r
+  *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *)&PasswordCallback, (void *)Password);\r
   if (*RsaContext != NULL) {\r
     Status = TRUE;\r
   }\r