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

@@ -9,7 +9,6 @@
#include "TestBaseCryptLib.h"
//
// Password-protected PEM Key data for RSA Private Key Retrieving (encryption key is "client").
// (Generated by OpenSSL utility).
@@ -17,8 +16,8 @@
// password should match PemPass in this file
// $ xxd --include TestKeyPem
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestKeyPem[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestKeyPem[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x50, 0x72, 0x6f, 0x63,
0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x34, 0x2c, 0x45, 0x4e, 0x43,
@@ -99,12 +98,12 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestKeyPem[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41,
0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59,
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
};
};
//
// Password for private key retrieving from encrypted PEM ("TestKeyPem").
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *PemPass = "client";
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *PemPass = "client";
//
// Test CA X509 Certificate for X509 Verification Routine (Generated by OpenSSL utility).
@@ -112,7 +111,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *PemPass = "client";
// use password from PemPass variable in this file
// $ xxd --include TestCACert
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCACert[] = {
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCACert[] = {
0x30, 0x82, 0x02, 0x98, 0x30, 0x82, 0x02, 0x01, 0xa0, 0x03, 0x02, 0x01,
0x02, 0x02, 0x14, 0x39, 0xde, 0x9e, 0xce, 0x3a, 0x36, 0x11, 0x38, 0x6f,
0x64, 0xb4, 0x69, 0xa7, 0x93, 0xdd, 0xff, 0xbd, 0x3e, 0x75, 0x6a, 0x30,
@@ -177,7 +176,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCACert[] = {
// $ openssl x509 -days 10000 -CA TestCACert.pem -CAkey TestKeyPem -req -out TestCert -set_serial 3432 --outform DER -in TestCertCsr
// password should be in the PemPass variable
// $ xxd --include TestCert
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCert[] = {
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCert[] = {
0x30, 0x82, 0x02, 0x31, 0x30, 0x82, 0x01, 0x9a, 0x02, 0x02, 0x0d, 0x68,
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
0x0b, 0x05, 0x00, 0x30, 0x5e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
@@ -231,21 +230,20 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TestCert[] = {
//
// Message Hash for Signing & Verification Validation.
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 MsgHash[] = {
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 MsgHash[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09
};
};
//
// Payload for PKCS#7 Signing & Verification Validation.
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *Payload = "Payload Data for PKCS#7 Signing";
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *Payload = "Payload Data for PKCS#7 Signing";
UNIT_TEST_STATUS
EFIAPI
TestVerifyRsaCertPkcs1SignVerify (
IN UNIT_TEST_CONTEXT Context
IN UNIT_TEST_CONTEXT Context
)
{
BOOLEAN Status;
@@ -296,9 +294,9 @@ TestVerifyRsaCertPkcs1SignVerify (
// X509 Certificate Subject Retrieving.
//
SubjectSize = 0;
Status = X509GetSubjectName (TestCert, sizeof (TestCert), NULL, &SubjectSize);
Subject = (UINT8 *)AllocatePool (SubjectSize);
Status = X509GetSubjectName (TestCert, sizeof (TestCert), Subject, &SubjectSize);
Status = X509GetSubjectName (TestCert, sizeof (TestCert), NULL, &SubjectSize);
Subject = (UINT8 *)AllocatePool (SubjectSize);
Status = X509GetSubjectName (TestCert, sizeof (TestCert), Subject, &SubjectSize);
UT_ASSERT_TRUE (Status);
//
@@ -329,8 +327,8 @@ TestVerifyRsaCertPkcs1SignVerify (
//
// Release Resources.
//
RsaFree (RsaPubKey);
RsaFree (RsaPrivKey);
RsaFree (RsaPubKey);
RsaFree (RsaPrivKey);
FreePool (Signature);
FreePool (Subject);
@@ -340,7 +338,7 @@ TestVerifyRsaCertPkcs1SignVerify (
UNIT_TEST_STATUS
EFIAPI
TestVerifyPkcs7SignVerify (
IN UNIT_TEST_CONTEXT Context
IN UNIT_TEST_CONTEXT Context
)
{
BOOLEAN Status;
@@ -354,7 +352,7 @@ TestVerifyPkcs7SignVerify (
//
// Construct Signer Certificate from RAW data.
//
Status = X509ConstructCertificate (TestCert, sizeof (TestCert), (UINT8 **) &SignCert);
Status = X509ConstructCertificate (TestCert, sizeof (TestCert), (UINT8 **)&SignCert);
UT_ASSERT_TRUE (Status);
UT_ASSERT_NOT_NULL (SignCert);
@@ -365,8 +363,8 @@ TestVerifyPkcs7SignVerify (
Status = Pkcs7Sign (
TestKeyPem,
sizeof (TestKeyPem),
(CONST UINT8 *) PemPass,
(UINT8 *) Payload,
(CONST UINT8 *)PemPass,
(UINT8 *)Payload,
AsciiStrLen (Payload),
SignCert,
NULL,
@@ -381,7 +379,7 @@ TestVerifyPkcs7SignVerify (
P7SignedDataSize,
TestCACert,
sizeof (TestCACert),
(UINT8 *) Payload,
(UINT8 *)Payload,
AsciiStrLen (Payload)
);
UT_ASSERT_TRUE (Status);
@@ -389,6 +387,7 @@ TestVerifyPkcs7SignVerify (
if (P7SignedData != NULL) {
FreePool (P7SignedData);
}
if (SignCert != NULL) {
X509Free (SignCert);
}
@@ -396,20 +395,20 @@ TestVerifyPkcs7SignVerify (
return UNIT_TEST_PASSED;
}
TEST_DESC mRsaCertTest[] = {
//
// -----Description--------------------------------------Class----------------------Function-----------------Pre---Post--Context
//
{"TestVerifyRsaCertPkcs1SignVerify()", "CryptoPkg.BaseCryptLib.RsaCert", TestVerifyRsaCertPkcs1SignVerify, NULL, NULL, NULL},
TEST_DESC mRsaCertTest[] = {
//
// -----Description--------------------------------------Class----------------------Function-----------------Pre---Post--Context
//
{ "TestVerifyRsaCertPkcs1SignVerify()", "CryptoPkg.BaseCryptLib.RsaCert", TestVerifyRsaCertPkcs1SignVerify, NULL, NULL, NULL },
};
UINTN mRsaCertTestNum = ARRAY_SIZE(mRsaCertTest);
UINTN mRsaCertTestNum = ARRAY_SIZE (mRsaCertTest);
TEST_DESC mPkcs7Test[] = {
//
// -----Description--------------------------------------Class----------------------Function-----------------Pre---Post--Context
//
{"TestVerifyPkcs7SignVerify()", "CryptoPkg.BaseCryptLib.Pkcs7", TestVerifyPkcs7SignVerify, NULL, NULL, NULL},
TEST_DESC mPkcs7Test[] = {
//
// -----Description--------------------------------------Class----------------------Function-----------------Pre---Post--Context
//
{ "TestVerifyPkcs7SignVerify()", "CryptoPkg.BaseCryptLib.Pkcs7", TestVerifyPkcs7SignVerify, NULL, NULL, NULL },
};
UINTN mPkcs7TestNum = ARRAY_SIZE(mPkcs7Test);
UINTN mPkcs7TestNum = ARRAY_SIZE (mPkcs7Test);