public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb
@ 2019-05-13  2:55 Gao, Zhichao
  2019-05-13 14:09 ` Zhang, Chao B
  0 siblings, 1 reply; 2+ messages in thread
From: Gao, Zhichao @ 2019-05-13  2:55 UTC (permalink / raw)
  To: devel; +Cc: Chao Zhang, Jiewen Yao, Jian Wang, Star Zeng, Liming Gao

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>
---
 SecurityPkg/Library/AuthVariableLib/AuthService.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c
index 7493a2ed9c..2340d47e77 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthService.c
+++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c
@@ -1735,10 +1735,13 @@ CleanCertsFromDb (
                                        );
 
       if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) == 0) {
+        //
+        // While cleaning certdb, always delete the variable in certdb regardless of it attributes.
+        //
         Status      = DeleteCertsFromDb(
                         VariableName,
                         &AuthVarGuid,
-                        AuthVariableInfo.Attributes
+                        AuthVariableInfo.Attributes | EFI_VARIABLE_NON_VOLATILE
                         );
         CertCleaned = TRUE;
         DEBUG((EFI_D_INFO, "Recovery!! Cert for Auth Variable %s Guid %g is removed for consistency\n", VariableName, &AuthVarGuid));
-- 
2.21.0.windows.1


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

* Re: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb
  2019-05-13  2:55 [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb Gao, Zhichao
@ 2019-05-13 14:09 ` Zhang, Chao B
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Chao B @ 2019-05-13 14:09 UTC (permalink / raw)
  To: Gao, Zhichao, devel@edk2.groups.io
  Cc: Yao, Jiewen, Wang, Jian J, Zeng, Star, Gao, Liming

Reviewed-by : Chao Zhang <chao.b.zhang@intel.com>

-----Original Message-----
From: Gao, Zhichao 
Sent: Monday, May 13, 2019 10:55 AM
To: devel@edk2.groups.io
Cc: Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb

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>
---
 SecurityPkg/Library/AuthVariableLib/AuthService.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c
index 7493a2ed9c..2340d47e77 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthService.c
+++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c
@@ -1735,10 +1735,13 @@ CleanCertsFromDb (
                                        );
 
       if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) == 0) {
+        //
+        // While cleaning certdb, always delete the variable in certdb regardless of it attributes.
+        //
         Status      = DeleteCertsFromDb(
                         VariableName,
                         &AuthVarGuid,
-                        AuthVariableInfo.Attributes
+                        AuthVariableInfo.Attributes | 
+ EFI_VARIABLE_NON_VOLATILE
                         );
         CertCleaned = TRUE;
         DEBUG((EFI_D_INFO, "Recovery!! Cert for Auth Variable %s Guid %g is removed for consistency\n", VariableName, &AuthVarGuid));
--
2.21.0.windows.1


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

end of thread, other threads:[~2019-05-13 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-13  2:55 [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb Gao, Zhichao
2019-05-13 14:09 ` Zhang, Chao B

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