From e90ea9470a88661946d8489c3a31640eab096a9a Mon Sep 17 00:00:00 2001 From: Zhichao Gao Date: Mon, 13 May 2019 10:48:27 +0800 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 Cc: Jiewen Yao Cc: Jian Wang Cc: Star Zeng Cc: Liming Gao Signed-off-by: Zhichao Gao Reviewed-by: Chao Zhang --- SecurityPkg/Library/AuthVariableLib/AuthService.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c index 7493a2ed9c..486df55bed 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthService.c +++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c @@ -18,7 +18,7 @@ They will do basic validation for authentication data structure, then call crypto library to verify the signature. -Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -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.39.2