BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4441 The EFI_RNG_PROTOCOL can rely on the RngLib. The RngLib has multiple implementations, some of them are unsafe (e.g. BaseRngLibTimerLib). To allow the RngDxe to detect when such implementation is used, a GetRngGuid() function is added in a following patch. Prepare GetRngGuid() return values and add a gEdkiiRngAlgorithmUnSafe to describe an unsafe implementation, cf. the BaseRngLibTimerLib. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Kun Qin <kun.qin@microsoft.com>
		
			
				
	
	
		
			24 lines
		
	
	
		
			626 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			626 B
		
	
	
	
		
			C
		
	
	
	
	
	
/** @file
 | 
						|
  Rng Algorithm
 | 
						|
 | 
						|
  Copyright (c) 2023, Arm Limited. All rights reserved.<BR>
 | 
						|
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
						|
**/
 | 
						|
 | 
						|
#ifndef RNG_ALGORITHM_GUID_H_
 | 
						|
#define RNG_ALGORITHM_GUID_H_
 | 
						|
 | 
						|
///
 | 
						|
/// The implementation of a Random Number Generator might be unsafe, when using
 | 
						|
/// a dummy implementation for instance. Allow identifying such implementation
 | 
						|
/// with this GUID.
 | 
						|
///
 | 
						|
#define EDKII_RNG_ALGORITHM_UNSAFE \
 | 
						|
  { \
 | 
						|
    0x869f728c, 0x409d, 0x4ab4, {0xac, 0x03, 0x71, 0xd3, 0x09, 0xc1, 0xb3, 0xf4 } \
 | 
						|
  }
 | 
						|
 | 
						|
extern EFI_GUID  gEdkiiRngAlgorithmUnSafe;
 | 
						|
 | 
						|
#endif // #ifndef RNG_ALGORITHM_GUID_H_
 |