Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0/tss_marshaling.c: Increase supported algorithms ......................................................................
security/tpm/tss/tcg-2.0/tss_marshaling.c: Increase supported algorithms
Function marshal_TPMT_HA() supports SHA-256 only. Add support for more algorithms
BUG=N/A TEST=Build binary and verified logging on Facebook FBG-1701
Change-Id: Ife8d44484c7a7cb717035e5ae0870bbee205661b Signed-off-by: Frans Hendriks fhendriks@eltan.com --- M src/security/tpm/tss/tcg-2.0/tss_marshaling.c 1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35276/1
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 ec3cd8b..1bf211a 100644 --- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c +++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c @@ -83,9 +83,30 @@ int rc = 0;
rc |= marshal_TPMI_ALG_HASH(ob, tpmtha->hashAlg); - rc |= obuf_write(ob, tpmtha->digest.sha256, + switch (tpmtha->hashAlg) { + case TPM_ALG_SHA1: + rc |= obuf_write(ob, tpmtha->digest.sha1, tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); - + break; + case TPM_ALG_SHA256: + rc |= obuf_write(ob, tpmtha->digest.sha256, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SM3_256: + rc |= obuf_write(ob, tpmtha->digest.sm3_256, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SHA384: + rc |= obuf_write(ob, tpmtha->digest.sha384, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SHA512: + rc |= obuf_write(ob, tpmtha->digest.sha512, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + default: + rc = -1; + } return rc; }
Frans Hendriks has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0/tss_marshaling.c: Add support for algorithms ......................................................................
security/tpm/tss/tcg-2.0/tss_marshaling.c: Add support for algorithms
Function marshal_TPMT_HA() supports SHA-256 only. Add support for more algorithms.
BUG=N/A TEST=Build binary and verified logging on Facebook FBG-1701
Change-Id: Ife8d44484c7a7cb717035e5ae0870bbee205661b Signed-off-by: Frans Hendriks fhendriks@eltan.com --- M src/security/tpm/tss/tcg-2.0/tss_marshaling.c 1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35276/2
Lance Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0/tss_marshaling.c: Add support for algorithms ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/35276/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35276/3//COMMIT_MSG@6 PS3, Line 6: : security/tpm/tss/tcg-2.0/tss_marshaling.c Just security/tpm/tss/tcg-2.0:
Hello Patrick Rudolph, Felix Held, Lance Zhao, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35276
to look at the new patch set (#4).
Change subject: security/tpm/tss/tcg-2.0: Add support for algorithms ......................................................................
security/tpm/tss/tcg-2.0: Add support for algorithms
Function marshal_TPMT_HA() supports SHA-256 only. Add support for more algorithms.
BUG=N/A TEST=Build binary and verified logging on Facebook FBG-1701
Change-Id: Ife8d44484c7a7cb717035e5ae0870bbee205661b Signed-off-by: Frans Hendriks fhendriks@eltan.com --- M src/security/tpm/tss/tcg-2.0/tss_marshaling.c 1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35276/4
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0: Add support for algorithms ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35276/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35276/3//COMMIT_MSG@6 PS3, Line 6: : security/tpm/tss/tcg-2.0/tss_marshaling.c
Just […]
Done
Lance Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0: Add support for algorithms ......................................................................
Patch Set 4: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35276 )
Change subject: security/tpm/tss/tcg-2.0: Add support for algorithms ......................................................................
security/tpm/tss/tcg-2.0: Add support for algorithms
Function marshal_TPMT_HA() supports SHA-256 only. Add support for more algorithms.
BUG=N/A TEST=Build binary and verified logging on Facebook FBG-1701
Change-Id: Ife8d44484c7a7cb717035e5ae0870bbee205661b Signed-off-by: Frans Hendriks fhendriks@eltan.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35276 Reviewed-by: Lance Zhao lance.zhao@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/security/tpm/tss/tcg-2.0/tss_marshaling.c 1 file changed, 23 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Lance Zhao: Looks good to me, approved
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 ec3cd8b..1bf211a 100644 --- a/src/security/tpm/tss/tcg-2.0/tss_marshaling.c +++ b/src/security/tpm/tss/tcg-2.0/tss_marshaling.c @@ -83,9 +83,30 @@ int rc = 0;
rc |= marshal_TPMI_ALG_HASH(ob, tpmtha->hashAlg); - rc |= obuf_write(ob, tpmtha->digest.sha256, + switch (tpmtha->hashAlg) { + case TPM_ALG_SHA1: + rc |= obuf_write(ob, tpmtha->digest.sha1, tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); - + break; + case TPM_ALG_SHA256: + rc |= obuf_write(ob, tpmtha->digest.sha256, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SM3_256: + rc |= obuf_write(ob, tpmtha->digest.sm3_256, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SHA384: + rc |= obuf_write(ob, tpmtha->digest.sha384, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + case TPM_ALG_SHA512: + rc |= obuf_write(ob, tpmtha->digest.sha512, + tlcl_get_hash_size_from_algo(tpmtha->hashAlg)); + break; + default: + rc = -1; + } return rc; }