Reviewed-by : Chao Zhang <chao.b.zh...@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.zh...@intel.com>; Yao, Jiewen <jiewen....@intel.com>; Wang, Jian J <jian.j.w...@intel.com>; Zeng, Star <star.z...@intel.com>; Gao, Liming <liming....@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.zh...@intel.com> Cc: Jiewen Yao <jiewen....@intel.com> Cc: Jian Wang <jian.j.w...@intel.com> Cc: Star Zeng <star.z...@intel.com> Cc: Liming Gao <liming....@intel.com> Signed-off-by: Zhichao Gao <zhichao....@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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#40510): https://edk2.groups.io/g/devel/message/40510 Mute This Topic: https://groups.io/mt/31603232/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-