]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Remove RngTest Application from SecurityPkg
authorLong Qin <qin.long@intel.com>
Fri, 22 Dec 2017 06:52:04 +0000 (14:52 +0800)
committerLong Qin <qin.long@intel.com>
Tue, 26 Dec 2017 18:29:00 +0000 (02:29 +0800)
BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=820
Remove the RngTest application from SecurityPkg, which was only for
unit test.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
SecurityPkg/Application/RngTest/RngTest.c [deleted file]
SecurityPkg/Application/RngTest/RngTest.inf [deleted file]
SecurityPkg/Application/RngTest/RngTest.uni [deleted file]
SecurityPkg/Application/RngTest/RngTestExtra.uni [deleted file]
SecurityPkg/SecurityPkg.dsc

diff --git a/SecurityPkg/Application/RngTest/RngTest.c b/SecurityPkg/Application/RngTest/RngTest.c
deleted file mode 100644 (file)
index f501f80..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/** @file\r
-  UEFI RNG (Random Number Generator) Protocol test application.\r
-\r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution.  The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/        \r
-\r
-#include <Uefi.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiApplicationEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Protocol/Rng.h>\r
-\r
-/**\r
-  The user Entry Point for Application. The user code starts with this function\r
-  as the real entry point for the application.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UefiMain (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS         Status;\r
-  EFI_RNG_PROTOCOL   *Rng;\r
-  UINTN              RngAlgListSize;\r
-  EFI_RNG_ALGORITHM  RngAlgList[10];\r
-  EFI_RNG_ALGORITHM  *PtrRngAlg;\r
-  UINTN              RngAlgCount;\r
-  UINT8              *Rand;\r
-  UINTN              RandSize;\r
-  UINTN              Index;\r
-  UINTN              Index2;\r
-\r
-  Status    = EFI_SUCCESS;\r
-  PtrRngAlg = NULL;\r
-  Rand      = NULL;\r
-    \r
-  Print (L"UEFI RNG Protocol Testing :\n");\r
-  Print (L"----------------------------\n");\r
-\r
-  //-----------------------------------------\r
-  // Basic UEFI RNG Protocol Test\r
-  //-----------------------------------------\r
-  Print (L" -- Locate UEFI RNG Protocol : ");\r
-  Status = gBS->LocateProtocol (&gEfiRngProtocolGuid, NULL, (VOID **)&Rng);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]\n", Status);\r
-    goto Exit;\r
-  } else {\r
-    Print (L"[Pass]\n");\r
-  }\r
-\r
-  //-----------------------------------------\r
-  // Rng->GetInfo() interface test.\r
-  //-----------------------------------------\r
-  \r
-  Print (L" -- Call RNG->GetInfo() interface : ");\r
-  RngAlgListSize = 0;\r
-  Status = Rng->GetInfo (Rng, &RngAlgListSize, NULL);\r
-  if (Status != EFI_BUFFER_TOO_SMALL) {\r
-    Print (L"[Fail - Status = %r]\n", Status);\r
-  }\r
-  //\r
-  // Print out the supported RNG algorithm GUIDs\r
-  //\r
-  RngAlgCount = RngAlgListSize / sizeof (EFI_RNG_ALGORITHM);\r
-  Print (L"\n     >> Supported RNG Algorithm (Count = %d) : ", RngAlgCount);\r
-  Status = Rng->GetInfo (Rng, &RngAlgListSize, RngAlgList);\r
-  for (Index = 0; Index < RngAlgCount; Index++) {\r
-    PtrRngAlg = (EFI_RNG_ALGORITHM *)(&RngAlgList[Index]);\r
-    Print (L"\n          %d) ", Index);\r
-    Print (L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", PtrRngAlg->Data1,\r
-             PtrRngAlg->Data2, PtrRngAlg->Data3, PtrRngAlg->Data4[0], PtrRngAlg->Data4[1],\r
-             PtrRngAlg->Data4[2], PtrRngAlg->Data4[3], PtrRngAlg->Data4[4],\r
-             PtrRngAlg->Data4[5], PtrRngAlg->Data4[6], PtrRngAlg->Data4[7]);    \r
-  }\r
-\r
-  //-----------------------------------------\r
-  // Rng->GetRNG() interface test.\r
-  //-----------------------------------------\r
-  Print (L"\n -- Call RNG->GetRNG() interface : ");\r
-\r
-  //\r
-  // Allocate one buffer to store random data.\r
-  //\r
-  RandSize = 32;\r
-  Rand     = AllocatePool (RandSize);\r
-  if (Rand == NULL) {\r
-    goto Exit;\r
-  }\r
-  \r
-  //\r
-  // RNG with default algorithm\r
-  //\r
-  Print (L"\n     >> RNG with default algorithm : ");\r
-  Status = Rng->GetRNG (Rng, NULL, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-  \r
-  //\r
-  // RNG with SP800-90-HMAC-256\r
-  //\r
-  Print (L"\n     >> RNG with SP800-90-HMAC-256 : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmSp80090Hmac256Guid, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //\r
-  // RNG with SP800-90-HASH-256\r
-  //\r
-  Print (L"\n     >> RNG with SP800-90-Hash-256 : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmSp80090Hash256Guid, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //\r
-  // RNG with SP800-90-CTR-256\r
-  //\r
-  Print (L"\n     >> RNG with SP800-90-CTR-256 : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmSp80090Ctr256Guid, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //\r
-  // RNG with X9.31-3DES\r
-  //\r
-  Print (L"\n     >> RNG with X9.31-3DES : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmX9313DesGuid, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //\r
-  // RNG with X9.31-AES\r
-  //\r
-  Print (L"\n     >> RNG with X9.31-AES : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmX931AesGuid, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //\r
-  // RNG with RAW Entropy\r
-  //\r
-  Print (L"\n     >> RNG with RAW Entropy : ");\r
-  Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmRaw, RandSize, Rand);\r
-  if (EFI_ERROR (Status)) {\r
-    Print (L"[Fail - Status = %r]", Status);\r
-  } else {\r
-    Print (L"[Pass]");\r
-  }\r
-\r
-  //-----------------------------------------\r
-  // Random Number Generator test.\r
-  //-----------------------------------------\r
-  Print (L"\n -- Random Number Generation Test with default RNG Algorithm (20 Rounds): ");\r
-\r
-  RandSize = 1;\r
-  for (Index = 0; Index < 20; Index++) {\r
-    Status = Rng->GetRNG (Rng, NULL, RandSize, Rand);\r
-    if (EFI_ERROR (Status)) {\r
-      Print (L"[Fail - Status = %r]", Status);\r
-      break;\r
-    } else {\r
-      Print (L"\n          %02d) - ", Index + 1);\r
-      for (Index2 = 0; Index2 < RandSize; Index2++) {\r
-        Print (L"%02x", Rand[Index2]);\r
-      }\r
-    }\r
-\r
-    RandSize +=1;\r
-  }\r
-\r
-  //-----------------------------------------\r
-  // Random Number Generator test.\r
-  //-----------------------------------------\r
-  Print (L"\n -- RAW Entropy Generation Test (20 Rounds) : ");\r
-\r
-  RandSize = 32;\r
-  for (Index = 0; Index < 20; Index++) {\r
-    Status = Rng->GetRNG (Rng, &gEfiRngAlgorithmRaw, RandSize, Rand);\r
-    if (EFI_ERROR (Status)) {\r
-      Print (L"[Fail - Status = %r]", Status);\r
-      break;\r
-    } else {\r
-      Print (L"\n          %02d) - ", Index + 1);\r
-      for (Index2 = 0; Index2 < RandSize; Index2++) {\r
-        Print (L"%02x", Rand[Index2]);\r
-      }\r
-    }\r
-  }\r
-\r
-  Print (L"\n -- Exit UEFI RNG Protocol Test (Status = %r).\n", Status);\r
-  \r
-Exit:\r
-  if (Rand != NULL) {\r
-    FreePool (Rand);\r
-  }\r
-  return Status;\r
-}\r
diff --git a/SecurityPkg/Application/RngTest/RngTest.inf b/SecurityPkg/Application/RngTest/RngTest.inf
deleted file mode 100644 (file)
index 55510f7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-## @file\r
-#  UEFI RNG (Random Number Generator) Protocol test application.\r
-#  \r
-#  This application can print out the supported RNG algorithm in UEFI RNG Protocol. \r
-#  And then it will do a generation test on the supported RNG algorithm.  \r
-#\r
-#  Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = RngTest\r
-  FILE_GUID                      = B8AC7FB2-4211-4c2b-B62F-504421666C87\r
-  MODULE_TYPE                    = UEFI_APPLICATION\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = UefiMain\r
-  MODULE_UNI_FILE                = RngTest.uni\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64\r
-#\r
-\r
-[Sources]\r
-  RngTest.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  SecurityPkg/SecurityPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiApplicationEntryPoint\r
-  UefiLib\r
-\r
-[Protocols]\r
-  gEfiRngProtocolGuid            ## CONSUMES\r
-\r
-[Guids]\r
-  gEfiRngAlgorithmSp80090Hash256Guid    ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  gEfiRngAlgorithmSp80090Hmac256Guid    ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  gEfiRngAlgorithmSp80090Ctr256Guid     ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  gEfiRngAlgorithmX9313DesGuid          ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  gEfiRngAlgorithmX931AesGuid           ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  gEfiRngAlgorithmRaw                   ## SOMETIMES_CONSUMES    ## GUID        # Unique ID of the algorithm for RNG\r
-  \r
-  [UserExtensions.TianoCore."ExtraFiles"]\r
-  RngTestExtra.uni
\ No newline at end of file
diff --git a/SecurityPkg/Application/RngTest/RngTest.uni b/SecurityPkg/Application/RngTest/RngTest.uni
deleted file mode 100644 (file)
index 2cf82f9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// /** @file\r
-// UEFI RNG (Random Number Generator) Protocol test application.\r
-//\r
-// This application can print out the supported RNG algorithm in UEFI RNG Protocol.\r
-// And then it will do a generation test on the supported RNG algorithm.\r
-//\r
-// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
-//\r
-// This program and the accompanying materials\r
-// are licensed and made available under the terms and conditions of the BSD License\r
-// which accompanies this distribution. The full text of the license may be found at\r
-// http://opensource.org/licenses/bsd-license.php\r
-// \r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-//\r
-// **/\r
-\r
-\r
-#string STR_MODULE_ABSTRACT             #language en-US "A shell application that used UEFI RNG (Random Number Generator) Protocol test"\r
-\r
-#string STR_MODULE_DESCRIPTION          #language en-US "This application can print out the supported RNG algorithm in UEFI RNG Protocol. And then it will do a generation test on the supported RNG algorithm."\r
-\r
diff --git a/SecurityPkg/Application/RngTest/RngTestExtra.uni b/SecurityPkg/Application/RngTest/RngTestExtra.uni
deleted file mode 100644 (file)
index 9f2a92d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// /** @file\r
-// RngTest Localized Strings and Content\r
-//\r
-// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
-//\r
-// This program and the accompanying materials\r
-// are licensed and made available under the terms and conditions of the BSD License\r
-// which accompanies this distribution. The full text of the license may be found at\r
-// http://opensource.org/licenses/bsd-license.php\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-//\r
-// **/\r
-\r
-#string STR_PROPERTIES_MODULE_NAME \r
-#language en-US \r
-"UEFI RNG (Random Number Generator) Protocol Test Application"\r
-\r
index bb7147ec750e663110dcbc707b84b171f15b0410..9ce2953034e7261f5d22e9e48a225d7cabc6e76a 100644 (file)
   #SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerDxe.inf\r
   #SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf\r
 \r
-  #\r
-  # Application\r
-  #\r
-  SecurityPkg/Application/RngTest/RngTest.inf\r
-\r
   #\r
   # TPM\r
   #\r