diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:53:54 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 7c342378317039e632d9a1a5d4cf7c21aec8cb7a (patch) | |
tree | 6b34f630a779ee11db93c02cf54fa65c29716aed /CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c | |
parent | 2b16a4fb91b9b31c0d152588f5ac51080c6c0763 (diff) | |
download | edk2-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/CryptAuthenticode.c')
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c index 3c2d14a88b..aa4a33364d 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c @@ -23,9 +23,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent //
// OID ASN.1 Value for SPC_INDIRECT_DATA_OBJID
//
-UINT8 mSpcIndirectOidValue[] = {
+UINT8 mSpcIndirectOidValue[] = {
0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x04
- };
+};
/**
Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows
@@ -109,20 +109,20 @@ AuthenticodeVerify ( // some authenticode-specific structure. Use opaque ASN.1 string to retrieve
// PKCS#7 ContentInfo here.
//
- SpcIndirectDataOid = OBJ_get0_data(Pkcs7->d.sign->contents->type);
- if (OBJ_length(Pkcs7->d.sign->contents->type) != sizeof(mSpcIndirectOidValue) ||
- CompareMem (
- SpcIndirectDataOid,
- mSpcIndirectOidValue,
- sizeof (mSpcIndirectOidValue)
- ) != 0) {
+ SpcIndirectDataOid = OBJ_get0_data (Pkcs7->d.sign->contents->type);
+ if ((OBJ_length (Pkcs7->d.sign->contents->type) != sizeof (mSpcIndirectOidValue)) ||
+ (CompareMem (
+ SpcIndirectDataOid,
+ mSpcIndirectOidValue,
+ sizeof (mSpcIndirectOidValue)
+ ) != 0))
+ {
//
// Un-matched SPC_INDIRECT_DATA_OBJID.
//
goto _Exit;
}
-
SpcIndirectDataContent = (UINT8 *)(Pkcs7->d.sign->contents->d.other->value.asn1_string->data);
//
@@ -134,33 +134,30 @@ AuthenticodeVerify ( //
// Short Form of Length Encoding (Length < 128)
//
- ContentSize = (UINTN) (Asn1Byte & 0x7F);
+ ContentSize = (UINTN)(Asn1Byte & 0x7F);
//
// Skip the SEQUENCE Tag;
//
SpcIndirectDataContent += 2;
-
} else if ((Asn1Byte & 0x81) == 0x81) {
//
// Long Form of Length Encoding (128 <= Length < 255, Single Octet)
//
- ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
+ ContentSize = (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 2));
//
// Skip the SEQUENCE Tag;
//
SpcIndirectDataContent += 3;
-
} else if ((Asn1Byte & 0x82) == 0x82) {
//
// Long Form of Length Encoding (Length > 255, Two Octet)
//
- ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
+ ContentSize = (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 2));
ContentSize = (ContentSize << 8) + (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 3));
//
// Skip the SEQUENCE Tag;
//
SpcIndirectDataContent += 4;
-
} else {
goto _Exit;
}
@@ -180,7 +177,7 @@ AuthenticodeVerify ( //
// Verifies the PKCS#7 Signed Data in PE/COFF Authenticode Signature
//
- Status = (BOOLEAN) Pkcs7Verify (OrigAuthData, DataSize, TrustedCert, CertSize, SpcIndirectDataContent, ContentSize);
+ Status = (BOOLEAN)Pkcs7Verify (OrigAuthData, DataSize, TrustedCert, CertSize, SpcIndirectDataContent, ContentSize);
_Exit:
//
|