[v2,13/14] libstb/stb.c: fix trustedboot abort

Message ID 1504164285-15095-14-git-send-email-cclaudio@linux.vnet.ibm.com
State Superseded
Headers show
Series
  • libstb: simplify the initialization of cvc drivers
Related show

Commit Message

Claudio Carvalho Aug. 31, 2017, 7:24 a.m.
Trustedboot doesn't halt the boot, secureboot does.

This replaces the abort calls in the trustedboot code by simple return
calls.

Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
---
 libstb/stb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/libstb/stb.c b/libstb/stb.c
index f0eb108..cf40b2c 100644
--- a/libstb/stb.c
+++ b/libstb/stb.c
@@ -363,7 +363,7 @@  int tb_measure(enum resource_id id, void *buf, size_t len)
 		digestp = stb_sw_payload_hash(buf, len);
 		if(!digestp) {
 			prlog(PR_EMERG, "STB Container is corrupt, can't find hash\n");
-			abort();
+			return -1;
 		}
 
 		c1vc->sha512((void*) c1vc->sha512_addr,
@@ -377,9 +377,7 @@  int tb_measure(enum resource_id id, void *buf, size_t len)
 			stb_print_data(digestp, TPM_ALG_SHA256_SIZE);
 			prlog(PR_ALERT, "STB: Computed hash (on %lx bytes):\n", len);
 			stb_print_data(digest, TPM_ALG_SHA256_SIZE);
-
-			if (secure_mode)
-				abort();
+			return -1;
 		}
 	} else {
 		c1vc->sha512((void*) c1vc->sha512_addr, buf, len, digest);