https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/** @file
 | 
						|
  Basic TPM command functions.
 | 
						|
 | 
						|
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
						|
SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
						|
 | 
						|
**/
 | 
						|
 | 
						|
#include "CommonHeader.h"
 | 
						|
 | 
						|
/**
 | 
						|
  Single function calculates SHA1 digest value for all raw data. It
 | 
						|
  combines Sha1Init(), Sha1Update() and Sha1Final().
 | 
						|
 | 
						|
  @param[in]  Data          Raw data to be digested.
 | 
						|
  @param[in]  DataLen       Size of the raw data.
 | 
						|
  @param[out] Digest        Pointer to a buffer that stores the final digest.
 | 
						|
 | 
						|
  @retval     EFI_SUCCESS   Always successfully calculate the final digest.
 | 
						|
**/
 | 
						|
EFI_STATUS
 | 
						|
EFIAPI
 | 
						|
TpmCommHashAll (
 | 
						|
  IN  CONST UINT8                   *Data,
 | 
						|
  IN        UINTN                   DataLen,
 | 
						|
  OUT       TPM_DIGEST              *Digest
 | 
						|
  )
 | 
						|
{
 | 
						|
  VOID     *Sha1Ctx;
 | 
						|
  UINTN    CtxSize;
 | 
						|
 | 
						|
  CtxSize = Sha1GetContextSize ();
 | 
						|
  Sha1Ctx = AllocatePool (CtxSize);
 | 
						|
  ASSERT (Sha1Ctx != NULL);
 | 
						|
 | 
						|
  Sha1Init (Sha1Ctx);
 | 
						|
  Sha1Update (Sha1Ctx, Data, DataLen);
 | 
						|
  Sha1Final (Sha1Ctx, (UINT8 *)Digest);
 | 
						|
 | 
						|
  FreePool (Sha1Ctx);
 | 
						|
 | 
						|
  return EFI_SUCCESS;
 | 
						|
}
 | 
						|
 |