SecurityPkg: AuthVariableLib: Fix inconsistent CertDB case
[mirror_edk2.git] / SecurityPkg / Library / AuthVariableLib / AuthService.c
index 6e1e284801124cb71c1982aea8ee27becd7d3968..b013d420f62e29097e418143e19b85d866b3af76 100644 (file)
@@ -2100,7 +2100,7 @@ CleanCertsFromDb (
                                        &AuthVariableInfo\r
                                        );\r
 \r
-      if (EFI_ERROR(Status)) {\r
+      if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) == 0) {\r
         Status      = DeleteCertsFromDb(\r
                         VariableName,\r
                         &AuthVarGuid,\r