From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: zhichao.gao@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Sun, 12 May 2019 19:55:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 May 2019 19:55:25 -0700 X-ExtLoop1: 1 Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 12 May 2019 19:55:24 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Chao Zhang , Jiewen Yao , Jian Wang , Star Zeng , Liming Gao Subject: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb Date: Mon, 13 May 2019 10:55:17 +0800 Message-Id: <20190513025517.23236-1-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Jiewen Yao Cc: Jian Wang Cc: Star Zeng Cc: Liming Gao Signed-off-by: Zhichao Gao --- 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