public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: EFI_RNG_PROTOCOL.GetInfo check size != 0
@ 2019-12-28 15:37 Heinrich Schuchardt
  2020-07-30  5:28 ` Heinrich Schuchardt
  2020-08-04 11:08 ` [edk2-devel] " Samer El-Haj-Mahmoud
  0 siblings, 2 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2019-12-28 15:37 UTC (permalink / raw)
  To: EDK II Development; +Cc: Eric Jin, Supreeth Venkatesh, Heinrich Schuchardt

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2438

The EFI_RNG_PROTOCOL conformance test checks that the size returned by
GetInfo() is a multiple of 16. This would be fulfilled by size == 0.

The UEFI specification requires that at least one algorithm is implemented.
So we should check that size is non-zero too.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 .../RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c
index f0a7c030..cd419d68 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c
@@ -169,7 +169,8 @@ BBTestGetInfoConformanceTestCheckpoint1 (
     return Status;
   }
 
-  if (EFI_BUFFER_TOO_SMALL == Status && RNGAlgorithmListSize % sizeof(EFI_RNG_ALGORITHM) == 0) {
+  if (EFI_BUFFER_TOO_SMALL == Status && RNGAlgorithmListSize &&
+      RNGAlgorithmListSize % sizeof(EFI_RNG_ALGORITHM) == 0) {
     AssertionType = EFI_TEST_ASSERTION_PASSED;
   } else {
     AssertionType = EFI_TEST_ASSERTION_FAILED;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-16 21:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-28 15:37 [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: EFI_RNG_PROTOCOL.GetInfo check size != 0 Heinrich Schuchardt
2020-07-30  5:28 ` Heinrich Schuchardt
2020-08-04 11:08 ` [edk2-devel] " Samer El-Haj-Mahmoud
2020-08-16 21:40   ` G Edhaya Chandran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox