tpmr: Don't add newline when extending PCR with literal data

tpmr extend with -ic (extend with literal data) was adding a newline,
use echo -n so it only includes the data given in the hash.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2023-03-07 16:35:22 -05:00
parent 809b55666b
commit 641bea4d46
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -26,10 +26,10 @@ tpm2_extend() {
index="$2"
shift 2;;
-ic)
hash="`echo $2|sha256sum|cut -d' ' -f1`"
hash="$(echo -n "$2"|sha256sum|cut -d' ' -f1)"
shift 2;;
-if)
hash="`sha256sum $2|cut -d' ' -f1`"
hash="$(sha256sum "$2"|cut -d' ' -f1)"
shift 2;;
*)
break;;