tpm2-tss icon indicating copy to clipboard operation
tpm2-tss copied to clipboard

TCTI: Add generic platform independent SPI TCTI module (continue from #1862)

Open wxleong opened this issue 2 years ago • 4 comments

This is to revive the dormant PR (https://github.com/tpm2-software/tpm2-tss/pull/1862). The base commit is taken from https://github.com/jpxd/tpm2-tss/commit/a2c32757d6fdda82d0d8d663f16a2b4d3665550c with the additional changes listed below:

  • Implement wait state handling. Implemented Variant 1: The TSS2_TCTI_SPI_HELPER_PLATFORM struct remains as it is, but we allow to disable the wait-state handling by passing NULL for the spi_acquire and spi_release functions.

  • Bug fix, do not treat active locality as an error

  • Rename tcti-spi to tcti-spi-helper

wxleong avatar Jul 25 '22 08:07 wxleong

Unit test is now implemented in the force-pushed fbafc1c

wxleong avatar Aug 11 '22 10:08 wxleong

Unit test now covers both with and without wait-state scenarios in f9eadea

wxleong avatar Aug 12 '22 08:08 wxleong

Following fixed in 33d0cbc:

  • MAXLOGLEVEL=none induced error
  • Indentation

wxleong avatar Aug 29 '22 05:08 wxleong

Codecov Report

Merging #2397 (14b44f9) into master (cdeba44) will decrease coverage by 0.31%. The diff coverage is 38.90%.

@@            Coverage Diff             @@
##           master    #2397      +/-   ##
==========================================
- Coverage   83.62%   83.30%   -0.32%     
==========================================
  Files         351      352       +1     
  Lines       37914    38249     +335     
==========================================
+ Hits        31705    31864     +159     
- Misses       6209     6385     +176     
Impacted Files Coverage Δ
src/tss2-tcti/tcti-spi-helper.c 38.90% <38.90%> (ø)
src/tss2-esys/esys_tr.c 88.71% <0.00%> (-0.28%) :arrow_down:
src/tss2-fapi/ifapi_helpers.c 85.06% <0.00%> (-0.18%) :arrow_down:
src/tss2-fapi/ifapi_policy_json_deserialize.c 84.77% <0.00%> (-0.16%) :arrow_down:
src/tss2-fapi/ifapi_policy_json_serialize.c 87.87% <0.00%> (-0.02%) :arrow_down:
src/tss2-tcti/tcti-swtpm.c 89.76% <0.00%> (ø)
src/tss2-esys/api/Esys_Commit.c 93.93% <0.00%> (ø)
src/tss2-esys/api/Esys_PCR_Read.c 92.85% <0.00%> (ø)
src/tss2-esys/api/Esys_EC_Ephemeral.c 93.58% <0.00%> (ø)
src/tss2-esys/api/Esys_PCR_Allocate.c 96.10% <0.00%> (ø)
... and 5 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Aug 30 '22 06:08 codecov[bot]