From 7e220cac2d9a7065442ea0d757e424b17cd06961 Mon Sep 17 00:00:00 2001 From: Frans Hendriks Date: Fri, 28 Jun 2019 10:18:22 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33251 Tested-by: build bot (Jenkins) Reviewed-by: Lance Zhao Reviewed-by: Felix Held --- src/security/tpm/tss/tcg-2.0/tss_marshaling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/security/tpm/tss/tcg-2.0/tss_marshaling.c') 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 345aec5124..ec3cd8b4b2 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 @@ static int marshal_TPMT_HA(struct obuf *ob, TPMT_HA *tpmtha) 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; } -- cgit v1.2.3