security/tpm/tss/tcg-2.0: Use tlcl_get_hash_size_from_algo() for hash size

mashal_TPMT_HA() uses size of SHA-256 hash.
Use tlcll_get_hash_size_from_algo() to determince the hash size.

BUG=N/A
TEST=Build binary and verified logging on Facebook FBG-1701

Change-Id: I739260e13e9cd10a61d52e13e8741b12ec868d7f
Signed-off-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33251
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lance Zhao <lance.zhao@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
index 345aec5..ec3cd8b 100644
--- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
+++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c
@@ -84,7 +84,7 @@
 
 	rc |= marshal_TPMI_ALG_HASH(ob, tpmtha->hashAlg);
 	rc |= obuf_write(ob, tpmtha->digest.sha256,
-			sizeof(tpmtha->digest.sha256));
+			 tlcl_get_hash_size_from_algo(tpmtha->hashAlg));
 
 	return rc;
 }