[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    [PATCH 1/3] uefirtauthvar: return error when get mismatch size
From:       Ivan Hu <ivan.hu () canonical ! com>
Date:       2015-03-20 7:08:29
Message-ID: 1426835309-27503-1-git-send-email-ivan.hu () canonical ! com
[Download RAW message or body]

Get the mismatch size of set test data. The test is fail, no need to further
compare the data. Add the return FWTS_ERROR.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirtauthvar/uefirtauthvar.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
index 3f696ec..d5dc53b 100644
--- a/src/uefi/uefirtauthvar/uefirtauthvar.c
+++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
@@ -210,7 +210,9 @@ static int uefirtauthvar_test1(fwts_framework *fw)
 			"UEFICreateAuthVar",
 			"Get authenticated variable data size is not the "
 			"same as it set.");
+		return FWTS_ERROR;
 	}
+
 	for (i = 0; i < sizeof(AuthVarCreateData); i++) {
 		if (data[i] != AuthVarCreateData[i]) {
 			fwts_failed(fw, LOG_LEVEL_HIGH,
@@ -342,6 +344,7 @@ static int uefirtauthvar_test4(fwts_framework *fw)
 			"UEFIAppendAuthVar",
 			"Get total authenticated variable data size is not the "
 			"same as it set and appended.");
+		return FWTS_ERROR;
 	}
 
 	for (i = 0; i < getdatasize; i++) {
@@ -761,7 +764,9 @@ static int uefirtauthvar_test13(fwts_framework *fw)
 			"UEFISetAuthVarDiff",
 			"Get authenticated variable data size is not the "
 			"same as it set.");
+		return FWTS_ERROR;
 	}
+
 	for (i = 0; i < sizeof(AuthVarCreateData); i++) {
 		if (data[i] != AuthVarCreateData[i]) {
 			fwts_failed(fw, LOG_LEVEL_HIGH,
-- 
1.9.1


-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic