diff mbox

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

Message ID 1413970840-27212-8-git-send-email-ivan.hu@canonical.com
State Not Applicable
Headers show

Commit Message

Ivan Hu Oct. 22, 2014, 9:40 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>
---
 src/uefi/uefirtauthvar/uefirtauthvar.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Colin Ian King Oct. 22, 2014, 4:10 p.m. UTC | #1
On 22/10/14 10:40, 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>
> ---
>  src/uefi/uefirtauthvar/uefirtauthvar.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
> index 1afa1de..7d2fa05 100644
> --- a/src/uefi/uefirtauthvar/uefirtauthvar.c
> +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
> @@ -96,9 +96,10 @@ static void uefirtvariable_env_cleanup(void)
>  	uint32_t attributestest;
>  
>  	getvar(&gtestguid, &attributestest, &getdatasize, data, &status);
> -	if (status == EFI_SUCCESS)
> +	if (status == EFI_SUCCESS) {
>  		setvar(&gtestguid, attributes, sizeof(AuthVarDel), AuthVarDel, &status);
> -
> +		setvar(&gtestguid, attributes, sizeof(AuthVarDelDiff), AuthVarDelDiff, &status);
> +	}
>  }
>  
>  static int uefirtauthvar_init(fwts_framework *fw)
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung Oct. 29, 2014, 3:17 a.m. UTC | #2
On 14-10-22 05:40 PM, 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>
> ---
>   src/uefi/uefirtauthvar/uefirtauthvar.c |    5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
> index 1afa1de..7d2fa05 100644
> --- a/src/uefi/uefirtauthvar/uefirtauthvar.c
> +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
> @@ -96,9 +96,10 @@ static void uefirtvariable_env_cleanup(void)
>   	uint32_t attributestest;
>   
>   	getvar(&gtestguid, &attributestest, &getdatasize, data, &status);
> -	if (status == EFI_SUCCESS)
> +	if (status == EFI_SUCCESS) {
>   		setvar(&gtestguid, attributes, sizeof(AuthVarDel), AuthVarDel, &status);
> -
> +		setvar(&gtestguid, attributes, sizeof(AuthVarDelDiff), AuthVarDelDiff, &status);
> +	}
>   }
>   
>   static int uefirtauthvar_init(fwts_framework *fw)

Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
index 1afa1de..7d2fa05 100644
--- a/src/uefi/uefirtauthvar/uefirtauthvar.c
+++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
@@ -96,9 +96,10 @@  static void uefirtvariable_env_cleanup(void)
 	uint32_t attributestest;
 
 	getvar(&gtestguid, &attributestest, &getdatasize, data, &status);
-	if (status == EFI_SUCCESS)
+	if (status == EFI_SUCCESS) {
 		setvar(&gtestguid, attributes, sizeof(AuthVarDel), AuthVarDel, &status);
-
+		setvar(&gtestguid, attributes, sizeof(AuthVarDelDiff), AuthVarDelDiff, &status);
+	}
 }
 
 static int uefirtauthvar_init(fwts_framework *fw)