From b3426c03b4cf84af871c6d4c32afed2086f3fd1a Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 11 Sep 2019 14:24:47 -0700 Subject: Revert "security/tpm/tss/tcg-2.0: Add multi digits support to tlcl_extend()" This reverts commit fdb9805d6884090fd7bf62dbdf9c858692e55fb4. CB:33252 wasn't reviewed by a TPM maintainer and breaks abstraction layers (pulling TSS-details into TSPI, completely changing interpretation of the arguments to tlcl_extend() based on TSS version). It's also not clear why it was implemented the way it was (should have been much easier and cleaner ways to achieve the same thing). Since the author is not reacting, let's revert it for now. It can be cleaned up and resubmitted later. (Not reverting the header changes since those are not objectionable, and there are later patches dependent on it.) Change-Id: Ice44f55c75a0acc07794fe41c757a7bca75406eb Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/c/coreboot/+/35351 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- src/security/tpm/tspi/tspi.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/security/tpm/tspi') diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c index e64e04fbbe..4698a4dc8c 100644 --- a/src/security/tpm/tspi/tspi.c +++ b/src/security/tpm/tspi/tspi.c @@ -4,7 +4,6 @@ * Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Copyright 2017 Facebook Inc. * Copyright 2018 Siemens AG - * Copyright 2019 Eltan B.V. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +20,6 @@ #include #include #include -#include #if CONFIG(VBOOT) #include #include @@ -211,28 +209,7 @@ uint32_t tpm_extend_pcr(int pcr, enum vb2_hash_algorithm digest_algo, if (!digest) return TPM_E_IOERROR; -#if CONFIG(TPM2) - TPML_DIGEST_VALUES tpml_digests; - - tpml_digests.count = 1; - switch (digest_algo) { - case VB2_HASH_SHA1: - tpml_digests.digests[0].hashAlg = TPM_ALG_SHA1; - memcpy(tpml_digests.digests[0].digest.sha1, - digest, SHA1_DIGEST_SIZE); - break; - case VB2_HASH_SHA256: - tpml_digests.digests[0].hashAlg = TPM_ALG_SHA256; - memcpy(tpml_digests.digests[0].digest.sha256, - digest, SHA256_DIGEST_SIZE); - break; - default: - return TPM_E_IOERROR; - } - result = tlcl_extend(pcr, (uint8_t *)&tpml_digests, NULL); -#else result = tlcl_extend(pcr, digest, NULL); -#endif if (result != TPM_SUCCESS) return result; -- cgit v1.2.3