SecurityPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/** @file
|
||||
|
||||
This library registers RSA 2048 SHA 256 guided section handler
|
||||
This library registers RSA 2048 SHA 256 guided section handler
|
||||
to parse RSA 2048 SHA 256 encapsulation section and extract raw data.
|
||||
It uses the BaseCrypyLib based on OpenSSL to authenticate the signature.
|
||||
|
||||
Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -48,7 +48,7 @@ CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 };
|
||||
/**
|
||||
|
||||
GetInfo gets raw data size and attribute of the input guided section.
|
||||
It first checks whether the input guid section is supported.
|
||||
It first checks whether the input guid section is supported.
|
||||
If not, EFI_INVALID_PARAMETER will return.
|
||||
|
||||
@param InputSection Buffer containing the input GUIDed section to be processed.
|
||||
@@ -56,7 +56,7 @@ CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 };
|
||||
@param ScratchBufferSize The size of ScratchBuffer.
|
||||
@param SectionAttribute The attribute of the input guided section.
|
||||
|
||||
@retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and
|
||||
@retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and
|
||||
the attribute of the input section are successfully retrieved.
|
||||
@retval EFI_INVALID_PARAMETER The GUID in InputSection does not match this instance guid.
|
||||
|
||||
@@ -109,7 +109,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
|
||||
|
||||
Extraction handler tries to extract raw data from the input guided section.
|
||||
It also does authentication check for RSA 2048 SHA 256 signature in the input guided section.
|
||||
It first checks whether the input guid section is supported.
|
||||
It first checks whether the input guid section is supported.
|
||||
If not, EFI_INVALID_PARAMETER will return.
|
||||
|
||||
@param InputSection Buffer containing the input GUIDed section to be processed.
|
||||
@@ -140,10 +140,10 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
UINTN PublicKeyBufferSize;
|
||||
VOID *HashContext;
|
||||
VOID *Rsa;
|
||||
|
||||
|
||||
HashContext = NULL;
|
||||
Rsa = NULL;
|
||||
|
||||
|
||||
if (IS_SECTION2 (InputSection)) {
|
||||
//
|
||||
// Check whether the input guid section is recognized.
|
||||
@@ -153,7 +153,7 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
&(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Get the RSA 2048 SHA 256 information.
|
||||
//
|
||||
@@ -181,7 +181,7 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
&(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Get the RSA 2048 SHA 256 information.
|
||||
//
|
||||
@@ -206,7 +206,7 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
// All paths from here return EFI_SUCESS and result is returned in AuthenticationStatus
|
||||
//
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
|
||||
//
|
||||
// Fail if the HashType is not SHA 256
|
||||
//
|
||||
@@ -248,7 +248,7 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
*AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Fail if the PublicKey is not one of the public keys in PcdRsa2048Sha256PublicKeyBuffer
|
||||
//
|
||||
@@ -283,8 +283,8 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
*AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// Set RSA Key Components.
|
||||
// NOTE: Only N and E are needed to be set as RSA public key for signature verification.
|
||||
//
|
||||
@@ -331,10 +331,10 @@ Rsa2048Sha256GuidedSectionHandler (
|
||||
//
|
||||
PERF_INMODULE_BEGIN ("PeiRsaVerify");
|
||||
CryptoStatus = RsaPkcs1Verify (
|
||||
Rsa,
|
||||
Digest,
|
||||
SHA256_DIGEST_SIZE,
|
||||
CertBlockRsa2048Sha256->Signature,
|
||||
Rsa,
|
||||
Digest,
|
||||
SHA256_DIGEST_SIZE,
|
||||
CertBlockRsa2048Sha256->Signature,
|
||||
sizeof (CertBlockRsa2048Sha256->Signature)
|
||||
);
|
||||
PERF_INMODULE_END ("PeiRsaVerify");
|
||||
|
@@ -1,11 +1,11 @@
|
||||
## @file
|
||||
# This library doesn't produce any library class. The constructor function uses
|
||||
# This library doesn't produce any library class. The constructor function uses
|
||||
# ExtractGuidedSectionLib service to register an RSA 2048 SHA 256 guided section handler
|
||||
# that parses RSA 2048 SHA 256 encapsulation section and extracts raw data.
|
||||
#
|
||||
# It uses the BaseCrypyLib based on OpenSSL to authenticate the signature.
|
||||
#
|
||||
# Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -49,10 +49,10 @@
|
||||
PcdLib
|
||||
PerformanceLib
|
||||
|
||||
[Pcd]
|
||||
[Pcd]
|
||||
gEfiSecurityPkgTokenSpaceGuid.PcdRsa2048Sha256PublicKeyBuffer ## SOMETIMES_CONSUMES
|
||||
|
||||
|
||||
[Guids]
|
||||
gEfiCertTypeRsa2048Sha256Guid ## PRODUCES ## UNDEFINED # Specifies RSA 2048 SHA 256 authentication algorithm.
|
||||
gEfiHashAlgorithmSha256Guid ## SOMETIMES_CONSUMES ## UNDEFINED
|
||||
|
||||
|
||||
|
@@ -3,10 +3,10 @@
|
||||
//
|
||||
// ExtractGuidedSectionLib service to register an RSA 2048 SHA 256 guided section handler
|
||||
// that parses RSA 2048 SHA 256 encapsulation section and extracts raw data.
|
||||
//
|
||||
//
|
||||
// It uses the BaseCrypyLib based on OpenSSL to authenticate the signature.
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
|
Reference in New Issue
Block a user