Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCTI: Add tcti-spidev #2715

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

AndreasFuchsTPM
Copy link
Member

Add a new TCTI module that can talk to TPMs connected via spidev to the host.

@AndreasFuchsTPM AndreasFuchsTPM force-pushed the tcti-spidev branch 3 times, most recently from eb53dc4 to 3536c2b Compare November 27, 2023 11:40
doc/tcti-spidev.md Outdated Show resolved Hide resolved
@AndreasFuchsTPM AndreasFuchsTPM force-pushed the tcti-spidev branch 4 times, most recently from 7c2bd45 to 89eaf23 Compare November 28, 2023 13:05
Add a new TCTI module that can talk to TPMs connected via spidev
to the host.

Signed-off-by: Andreas Fuchs <andreas.fuchs@infineon.com>
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (ede63dd) 82.60% compared to head (2d1e858) 82.58%.

Files Patch % Lines
src/tss2-tcti/tcti-spidev.c 75.94% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2715      +/-   ##
==========================================
- Coverage   82.60%   82.58%   -0.02%     
==========================================
  Files         368      369       +1     
  Lines       43001    43080      +79     
==========================================
+ Hits        35519    35576      +57     
- Misses       7482     7504      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

#define FD_NO 5
int __wrap_open(const char *path, int flags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mock the open() system call, gcov will fail silently. To address this, check whether the path parameter starts with "/dev". If it doesn't, invoke __real_open(). An example of this can be found in https://github.com/tpm2-software/tpm2-tss/blob/master/test/unit/tcti-device.c#L47

@AndreasFuchsTPM AndreasFuchsTPM merged commit b9f7b32 into tpm2-software:master Nov 29, 2023
28 checks passed
@AndreasFuchsTPM AndreasFuchsTPM deleted the tcti-spidev branch November 29, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants