]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/AuthSeriableLib: Always delete variable in certdb
authorZhichao Gao <zhichao.gao@intel.com>
Mon, 13 May 2019 02:48:27 +0000 (10:48 +0800)
committerJian J Wang <jian.j.wang@intel.com>
Wed, 15 May 2019 05:00:37 +0000 (13:00 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1783

While cleaning the certdb, always delete the variable data in
the certdb regardless of its attribute.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
SecurityPkg/Library/AuthVariableLib/AuthService.c

index 7493a2ed9cf8c44099bad3f7c0f2fa5d91b9ee55..486df55bed64f453805eebbce9e469761da44824 100644 (file)
@@ -18,7 +18,7 @@
   They will do basic validation for authentication data structure, then call crypto library\r
   to verify the signature.\r
 \r
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -1735,10 +1735,13 @@ CleanCertsFromDb (
                                        );\r
 \r
       if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) == 0) {\r
+        //\r
+        // While cleaning certdb, always delete the variable in certdb regardless of it attributes.\r
+        //\r
         Status      = DeleteCertsFromDb(\r
                         VariableName,\r
                         &AuthVarGuid,\r
-                        AuthVariableInfo.Attributes\r
+                        AuthVariableInfo.Attributes | EFI_VARIABLE_NON_VOLATILE\r
                         );\r
         CertCleaned = TRUE;\r
         DEBUG((EFI_D_INFO, "Recovery!! Cert for Auth Variable %s Guid %g is removed for consistency\n", VariableName, &AuthVarGuid));\r