]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add new SecurityManagementLib, and update SecurityStub driver to use this lib.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 26 Nov 2009 01:31:48 +0000 (01:31 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 26 Nov 2009 01:31:48 +0000 (01:31 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9488 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/SecurityManagementLib.h [new file with mode: 0644]
MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c [new file with mode: 0644]
MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.dsc
MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

diff --git a/MdeModulePkg/Include/Library/SecurityManagementLib.h b/MdeModulePkg/Include/Library/SecurityManagementLib.h
new file mode 100644 (file)
index 0000000..0d24a73
--- /dev/null
@@ -0,0 +1,146 @@
+/** @file\r
+  This library class defines a set of interfaces to abstract the policy of \r
+  security measurement by managing the different security measurement services.\r
+  The library instances can be implemented according to the different security policy.\r
+\r
+  Copyright (c) 2009, Intel Corporation\r
+  All rights reserved. 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
+#ifndef __SECURITY_MANAGEMENT_LIB_H__\r
+#define __SECURITY_MANAGEMENT_LIB_H__\r
+\r
+#define EFI_AUTH_OPERATION_NONE                0x00\r
+#define EFI_AUTH_OPERATION_VERIFY_IMAGE        0x01\r
+#define EFI_AUTH_OPERATION_DEFER_IMAGE_LOAD    0x02\r
+#define EFI_AUTH_OPERATION_MEASURE_IMAGE       0x04\r
+\r
+///\r
+/// Image buffer is required by security handler.\r
+///\r
+#define EFI_AUTH_OPERATION_IMAGE_REQUIRED      0x80000000\r
+\r
+/**\r
+  The security handler is used to abstract platform-specific policy \r
+  from the DXE core response to an attempt to use a file that returns a \r
+  given status for the authentication check from the section extraction protocol.  \r
+\r
+  The possible responses in a given SAP implementation may include locking \r
+  flash upon failure to authenticate, attestation logging for all signed drivers, \r
+  and other exception operations.  The File parameter allows for possible logging \r
+  within the SAP of the driver.\r
+  \r
+  If File is NULL, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is not safe for the DXE Core to use under any circumstances, \r
+  then EFI_ACCESS_DENIED is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is not safe for the DXE Core to use right now, but it \r
+  might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is \r
+  returned.\r
+\r
+  FileBuffer will be NULL and FileSize will be 0 if the handler being called \r
+  has did not set EFI_AUTH_OPERATION_IMAGE_REQUIRED when it was registered.\r
+\r
+  @param[in]    AuthenticationStatus \r
+                           This is the authentication status returned from the security\r
+                           measurement services for the input file.\r
+  @param[in]    File       This is a pointer to the device path of the file that is\r
+                           being dispatched. This will optionally be used for logging.\r
+  @param[in]    FileBuffer File buffer matches the input file device path.\r
+  @param[in]    FileSize   Size of File buffer matches the input file device path.\r
+\r
+  @retval EFI_SUCCESS            The file specified by File did authenticate, and the\r
+                                 platform policy dictates that the DXE Core may use File.\r
+  @retval EFI_INVALID_PARAMETER  File is NULL.\r
+  @retval EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should be placed\r
+                                 in the untrusted state. A file may be promoted from\r
+                                 the untrusted to the trusted state at a future time\r
+                                 with a call to the Trust() DXE Service.\r
+  @retval EFI_ACCESS_DENIED      The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should not be\r
+                                 used for any purpose.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *SECURITY_FILE_AUTHENTICATION_STATE_HANDLER)(\r
+  IN  OUT   UINT32                     AuthenticationStatus,\r
+  IN  CONST EFI_DEVICE_PATH_PROTOCOL   *File,\r
+  IN  VOID                             *FileBuffer,\r
+  IN  UINTN                            FileSize\r
+  );\r
+\r
+/**\r
+  Register security measurement handler with its operation type. The different\r
+  handler with the same operation can all be registered.\r
+\r
+  If SecurityHandler is NULL, then ASSERT().\r
+  If no enough resources available to register new handler, then ASSERT().\r
+  If AuthenticationOperation is not recongnized, then ASSERT().\r
+  If the previous register handler can't be executed before the later register handler, then ASSERT().\r
+\r
+  @param[in]  SecurityHandler           Security measurement service handler to be registered.\r
+  @param[in]  AuthenticationOperation   Operation type is specified for the registered handler.\r
+\r
+  @retval EFI_SUCCESS              The handlers were registered successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterSecurityHandler (\r
+  IN  SECURITY_FILE_AUTHENTICATION_STATE_HANDLER  SecurityHandler,\r
+  IN  UINT32                                      AuthenticationOperation\r
+  );\r
+\r
+/**\r
+  Execute registered handlers until one returns an error and that error is returned.\r
+  If none of the handlers return an error, then EFI_SUCCESS is returned.\r
+\r
+  Before exectue handler, get the image buffer by file device path if a handler \r
+  requires the image file. And return the image buffer to each handler when exectue handler.\r
+\r
+  The handlers are executed in same order to their registered order.\r
+\r
+  @param[in]  AuthenticationStatus \r
+                           This is the authentication type returned from the Section\r
+                           Extraction protocol. See the Section Extraction Protocol\r
+                           Specification for details on this type.\r
+  @param[in]  FilePath     This is a pointer to the device path of the file that is\r
+                           being dispatched. This will optionally be used for logging.\r
+\r
+  @retval EFI_SUCCESS            The file specified by File did authenticate when more\r
+                                 than one security handler services were registered, \r
+                                 or the file did not authenticate when no security \r
+                                 handler service was registered. And the platform policy \r
+                                 dictates that the DXE Core may use File.\r
+  @retval EFI_INVALID_PARAMETER  File is NULL.\r
+  @retval EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should be placed\r
+                                 in the untrusted state. A file may be promoted from\r
+                                 the untrusted to the trusted state at a future time\r
+                                 with a call to the Trust() DXE Service.\r
+  @retval EFI_ACCESS_DENIED      The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should not be\r
+                                 used for any purpose.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ExecuteSecurityHandlers (\r
+  IN  UINT32                            AuthenticationStatus,\r
+  IN  CONST EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
+  );\r
+\r
+#endif\r
diff --git a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
new file mode 100644 (file)
index 0000000..1ff1bf6
--- /dev/null
@@ -0,0 +1,251 @@
+/** @file\r
+  Provides generic security measurement functions for DXE module.\r
+\r
+Copyright (c) 2009 Intel Corporation\r
+All rights reserved. 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 <PiDxe.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/DxeServicesLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/SecurityManagementLib.h>\r
+\r
+#define SECURITY_HANDLER_TABLE_SIZE   0x10\r
+\r
+#define EFI_AUTH_OPERATION_MASK       EFI_AUTH_OPERATION_VERIFY_IMAGE \\r
+                                      | EFI_AUTH_OPERATION_DEFER_IMAGE_LOAD \\r
+                                      | EFI_AUTH_OPERATION_MEASURE_IMAGE\r
+\r
+typedef struct {\r
+  UINT32  SecurityOperation;\r
+  SECURITY_FILE_AUTHENTICATION_STATE_HANDLER  SecurityHandler;\r
+} SECURITY_INFO;\r
+\r
+UINT32  mCurrentAuthOperation       = 0;\r
+UINT32  mNumberOfSecurityHandler    = 0;\r
+UINT32  mMaxNumberOfSecurityHandler = 0;\r
+SECURITY_INFO  *mSecurityTable      = NULL;\r
+\r
+/**\r
+  Reallocates more global memory to store the registered Handler list.\r
+\r
+  @retval  RETURN_SUCCESS            Reallocate memory successfully.\r
+  @retval  RETURN_OUT_OF_RESOURCES   No enough memory to allocated.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+ReallocateSecurityHandlerTable (\r
+  )\r
+{\r
+  //\r
+  // Reallocate memory for security info structure.\r
+  //\r
+  mSecurityTable = ReallocatePool (\r
+                     mMaxNumberOfSecurityHandler * sizeof (SECURITY_INFO), \r
+                     (mMaxNumberOfSecurityHandler + SECURITY_HANDLER_TABLE_SIZE) * sizeof (SECURITY_INFO), \r
+                     mSecurityTable\r
+                     );\r
+\r
+  //\r
+  // No enough resource is allocated.\r
+  //\r
+  if (mSecurityTable == NULL) {\r
+    return RETURN_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Increase max handler number\r
+  //\r
+  mMaxNumberOfSecurityHandler = mMaxNumberOfSecurityHandler + SECURITY_HANDLER_TABLE_SIZE;\r
+  return RETURN_SUCCESS;\r
+}\r
+\r
+/**\r
+ Check whether an operation is valid according to the requirement of current operation, \r
+ which must make sure that the measure image operation is the last one.\r
+\r
+ @param CurrentAuthOperation  Current operation.\r
+ @param CheckAuthOperation    Operation to be checked.\r
+\r
+ @retval  TRUE   Operation is valid for current operation.\r
+ @retval  FALSE  Operation is invalid for current operation.\r
+**/\r
+BOOLEAN\r
+CheckAuthenticationOperation (\r
+  IN  UINT32    CurrentAuthOperation,\r
+  IN  UINT32    CheckAuthOperation\r
+  )\r
+{ \r
+  //\r
+  // Make sure new auth operation can be recognized.\r
+  //\r
+  ASSERT ((CheckAuthOperation & ~(EFI_AUTH_OPERATION_MASK | EFI_AUTH_OPERATION_IMAGE_REQUIRED)) == 0);\r
+  \r
+  //\r
+  // When current operation includes measure image operation, \r
+  // only another measure image operation or none operation will be allowed.\r
+  //\r
+  if ((CurrentAuthOperation & EFI_AUTH_OPERATION_MEASURE_IMAGE) == EFI_AUTH_OPERATION_MEASURE_IMAGE) {\r
+    if (((CheckAuthOperation & EFI_AUTH_OPERATION_MEASURE_IMAGE) == EFI_AUTH_OPERATION_MEASURE_IMAGE) ||\r
+        ((CheckAuthOperation & EFI_AUTH_OPERATION_MASK) == EFI_AUTH_OPERATION_NONE)) {\r
+      return TRUE;\r
+    } else {\r
+      return FALSE;\r
+    }\r
+  }\r
+  \r
+  //\r
+  // When current operation doesn't include measure image operation, \r
+  // any new operation will be allowed.\r
+  //\r
+  return TRUE;\r
+}\r
+\r
+/**\r
+  Register security measurement handler with its operation type. The different\r
+  handler with the same operation can all be registered.\r
+\r
+  If SecurityHandler is NULL, then ASSERT().\r
+  If no enough resources available to register new handler, then ASSERT().\r
+  If AuthenticationOperation is not recongnized, then ASSERT().\r
+  If the previous register handler can't be executed before the later register handler, then ASSERT().\r
+\r
+  @param[in]  SecurityHandler           Security measurement service handler to be registered.\r
+  @param[in]  AuthenticationOperation   Operation type is specified for the registered handler.\r
+\r
+  @retval EFI_SUCCESS              The handlers were registered successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterSecurityHandler (\r
+  IN  SECURITY_FILE_AUTHENTICATION_STATE_HANDLER  SecurityHandler,\r
+  IN  UINT32                                      AuthenticationOperation\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  ASSERT (SecurityHandler != NULL);\r
+\r
+  //\r
+  // Make sure AuthenticationOperation is valid in the register order.\r
+  //\r
+  ASSERT (CheckAuthenticationOperation (mCurrentAuthOperation, AuthenticationOperation));\r
+  mCurrentAuthOperation = mCurrentAuthOperation | AuthenticationOperation;\r
+\r
+  //\r
+  // Check whether the handler lists is enough to store new handler.\r
+  //\r
+  if (mNumberOfSecurityHandler == mMaxNumberOfSecurityHandler) {\r
+    //\r
+    // Allocate more resources for new handler.\r
+    //\r
+    Status = ReallocateSecurityHandlerTable();\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
+  //\r
+  // Register new handler into the handler list.\r
+  //\r
+  mSecurityTable[mNumberOfSecurityHandler].SecurityOperation = AuthenticationOperation;\r
+  mSecurityTable[mNumberOfSecurityHandler].SecurityHandler   = SecurityHandler;\r
+  mNumberOfSecurityHandler ++;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Execute registered handlers until one returns an error and that error is returned.\r
+  If none of the handlers return an error, then EFI_SUCCESS is returned.\r
+\r
+  Before exectue handler, get the image buffer by file device path if a handler \r
+  requires the image file. And return the image buffer to each handler when exectue handler.\r
+\r
+  The handlers are executed in same order to their registered order.\r
+\r
+  @param[in]  AuthenticationStatus \r
+                           This is the authentication type returned from the Section\r
+                           Extraction protocol. See the Section Extraction Protocol\r
+                           Specification for details on this type.\r
+  @param[in]  FilePath     This is a pointer to the device path of the file that is\r
+                           being dispatched. This will optionally be used for logging.\r
+\r
+  @retval EFI_SUCCESS            The file specified by File did authenticate when more\r
+                                 than one security handler services were registered, \r
+                                 or the file did not authenticate when no security \r
+                                 handler service was registered. And the platform policy \r
+                                 dictates that the DXE Core may use File.\r
+  @retval EFI_INVALID_PARAMETER  File is NULL.\r
+  @retval EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should be placed\r
+                                 in the untrusted state. A file may be promoted from\r
+                                 the untrusted to the trusted state at a future time\r
+                                 with a call to the Trust() DXE Service.\r
+  @retval EFI_ACCESS_DENIED      The file specified by File did not authenticate, and\r
+                                 the platform policy dictates that File should not be\r
+                                 used for any purpose.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ExecuteSecurityHandlers (\r
+  IN  UINT32                            AuthenticationStatus,\r
+  IN  CONST EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
+  )\r
+{\r
+  UINT32        Index;\r
+  EFI_STATUS    Status;\r
+  UINT32        HandlerAuthenticationStatus;\r
+  VOID          *FileBuffer;\r
+  UINTN         FileSize;\r
+  \r
+  if (FilePath == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Directly return successfully when no handler is registered.\r
+  //\r
+  if (mNumberOfSecurityHandler == 0) {\r
+    return EFI_SUCCESS;\r
+  }\r
+  \r
+  Status                      = EFI_SUCCESS;\r
+  FileBuffer                  = NULL;\r
+  FileSize                    = 0;\r
+  HandlerAuthenticationStatus = AuthenticationStatus;\r
+  //\r
+  // Run security handler in same order to their registered list\r
+  //\r
+  for (Index = 0; Index < mNumberOfSecurityHandler; Index ++) {\r
+    if ((mSecurityTable[Index].SecurityOperation & EFI_AUTH_OPERATION_IMAGE_REQUIRED) == EFI_AUTH_OPERATION_IMAGE_REQUIRED) {\r
+      //\r
+      // Try get file buffer when the handler requires image buffer.\r
+      //\r
+      if (FileBuffer == NULL) {\r
+        FileBuffer = GetFileBufferByFilePath (FALSE, FilePath, &FileSize, &AuthenticationStatus);\r
+      }\r
+    }\r
+    Status = mSecurityTable[Index].SecurityHandler (\r
+               HandlerAuthenticationStatus,\r
+               FilePath,\r
+               FileBuffer,\r
+               FileSize\r
+               );\r
+    if (EFI_ERROR (Status)) {\r
+      break;\r
+    }\r
+  }\r
+\r
+  if (FileBuffer != NULL) {\r
+    FreePool (FileBuffer);\r
+  }\r
+\r
+  return Status;\r
+}\r
diff --git a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
new file mode 100644 (file)
index 0000000..7b65d4a
--- /dev/null
@@ -0,0 +1,43 @@
+#/** @file\r
+# Instance of SecurityManagementLib Library for DXE phase.\r
+#\r
+# This library provides generic security measurement functions for DXE module.\r
+#\r
+#  Copyright (c) 2009, Intel Corporation.\r
+#\r
+#  All rights reserved. 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
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = DxeSecurityManagementLib\r
+  FILE_GUID                      = 7F61122C-19DF-47c3-BA0D-6C1149E30FA1\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = SecurityManagementLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources]\r
+  DxeSecurityManagementLib.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+  MemoryAllocationLib\r
+  DebugLib\r
+  DxeServicesLib\r
+  \r
index 4cbafb42c40b2a6a105fc1f6e20f443f671b4ef4..3e25d81eff62d971236f4aa4a32f4258d4bfd391 100644 (file)
   #\r
   UefiHiiServicesLib|Include/Library/UefiHiiServicesLib.h\r
 \r
+  ##  @libraryclass    Provides a set of interfaces to abstract the policy of security measurement.\r
+  #\r
+  SecurityManagementLib|MdeModulePkg/Include/Library/SecurityManagementLib.h\r
+\r
 [Guids.common]\r
   ## MdeModule package token space guid\r
   # Include/Guid/MdeModulePkgTokenSpace.h\r
index be9392b8140ec313677e8c21b9ca2a7760228df1..ecc76aadcb124d1cb4c4195f641d201315d472e9 100644 (file)
@@ -72,6 +72,7 @@
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
   ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf\r
   UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
+  SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
 \r
 [LibraryClasses.IA32]\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
   MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
   MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf\r
+  MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
 \r
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
index ac3ab297abd44879212b9eb8f0bcd6ce1c8e3c73..1660828db83362eae4d51accb9a4d05f53c0e838 100644 (file)
@@ -1,8 +1,7 @@
 /** @file\r
-  This driver implements a sample platform security service, which does \r
-  nothing and always return EFI_SUCCESS.\r
-  \r
-  Copyright (c) 2006 - 2008, Intel Corporation                                              \r
+  This driver produces security architectural protocol based on SecurityManagementLib.\r
\r
+  Copyright (c) 2006 - 2009, Intel Corporation                                              \r
   All rights reserved. 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
@@ -19,6 +18,7 @@
 #include <Library/DebugLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/SecurityManagementLib.h>\r
 \r
 //\r
 // Handle for the Security Architectural Protocol instance produced by this driver\r
@@ -68,11 +68,7 @@ SecurityStubAuthenticateState (
   IN CONST EFI_DEVICE_PATH_PROTOCOL    *File\r
   )\r
 {\r
-  if (File == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return ExecuteSecurityHandlers (AuthenticationStatus, File);\r
 }\r
 \r
 //\r
index 2d02248b13a5b16d228c55931d35d16dd7783d6c..4830a82a183ce82e28cfbbdc662e1eb7865c2e2a 100644 (file)
@@ -1,8 +1,7 @@
 #/** @file\r
-#  Sample SecurityStub driver implements the dummy platform security service.\r
-#  It always return success without any authentication check.\r
+#  This driver produces security architectural protocol based on SecurityManagementLib.\r
 #\r
-#  Copyright (c) 2006 - 2008, Intel Corporation\r
+#  Copyright (c) 2006 - 2009, Intel Corporation\r
 #  All rights reserved. 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
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
 \r
 [LibraryClasses]\r
   UefiDriverEntryPoint\r
   UefiBootServicesTableLib\r
   DebugLib\r
+  SecurityManagementLib\r
 \r
 [Protocols]\r
   gEfiSecurityArchProtocolGuid                  ## PRODUCED\r