diff mbox

[15/15,RESEND] uefirtauthvar: cleanup environment for another authenticated variable

Message ID 1414563339-29826-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Oct. 29, 2014, 6:15 a.m. UTC
Delete the test authenticated variable created by another key before starting
the tests.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Alex Hung <alex.hung@canonical.com>
---
 src/uefi/uefirtauthvar/uefirtauthvar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Colin Ian King Oct. 29, 2014, 10:07 a.m. UTC | #1
On 29/10/14 06:15, Ivan Hu wrote:
> Delete the test authenticated variable created by another key before starting
> the tests.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> Acked-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/uefi/uefirtauthvar/uefirtauthvar.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
> index 240661e..957bb76 100644
> --- a/src/uefi/uefirtauthvar/uefirtauthvar.c
> +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
> @@ -96,8 +96,10 @@ static void uefirtvariable_env_cleanup(void)
>  	uint32_t attributestest;
>  
>  	long ioret = getvar(&gtestguid, &attributestest, &getdatasize, data, &status);
> -	if (ioret != -1 && status == EFI_SUCCESS)
> +	if (ioret != -1 && status == EFI_SUCCESS) {
>  		setvar(&gtestguid, attributes, sizeof(AuthVarDel), AuthVarDel, &status);
> +		setvar(&gtestguid, attributes, sizeof(AuthVarDelDiff), AuthVarDelDiff, &status);
> +	}
>  	return;
>  }
>  
> 
(Re-) Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
index 240661e..957bb76 100644
--- a/src/uefi/uefirtauthvar/uefirtauthvar.c
+++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
@@ -96,8 +96,10 @@  static void uefirtvariable_env_cleanup(void)
 	uint32_t attributestest;
 
 	long ioret = getvar(&gtestguid, &attributestest, &getdatasize, data, &status);
-	if (ioret != -1 && status == EFI_SUCCESS)
+	if (ioret != -1 && status == EFI_SUCCESS) {
 		setvar(&gtestguid, attributes, sizeof(AuthVarDel), AuthVarDel, &status);
+		setvar(&gtestguid, attributes, sizeof(AuthVarDelDiff), AuthVarDelDiff, &status);
+	}
 	return;
 }