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

tctildr: turn tctildr into a tcti #2695

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

joholl
Copy link
Collaborator

@joholl joholl commented Oct 13, 2023

Currently the tctildr is almost a tcti. I stumbled upon that when I wanted to create an abstraction for tctis in Rust.

  • it misses the Tss2_Tcti_Info symbol which enables dynamic loading
  • it does not have a caller-allocated init function, only callee-allocated ones

So I added the init function and the symbol. Technically it is a tcti now, so you can load the tctildr by specifying its path now:

tpm2 startup -c -T "/path/to/libtss2-tctildr.so"

Unfortunately, it does not keep to the libtss2-tcti-<name>.so convention, so I added a commit which enables loading by just passing tctildr and the loading mechanism will try libtss2-<name>.so as well.

tpm2 startup -c -T "tctildr"

You might ask yourself: why would I want tctildr to be loadable? No idea, but there is no harm in it... Btw, I also refactored the code for loading, so it is less chunky.

src/tss2-tcti/tctildr.c Fixed Show fixed Hide fixed
src/tss2-tcti/tctildr.c Fixed Show fixed Hide fixed
@joholl joholl force-pushed the tctildr-tcti branch 2 times, most recently from da229c0 to fe4011d Compare October 27, 2023 12:44
Add the Tss2_Tcti_Info symbol to tctildr, including a compliant
Tss2_Tcti_TctiLdr_Init() function.

Signed-off-by: Johannes Holland <[email protected]>
The tctildr has a different file name than other tctis.
Normal tctis:
 * libtss2-tcti-<name>.so
Tctildr:
 * libtss2-tctildr.so

Enable loading the tctildr tcti module.

Signed-off-by: Johannes Holland <[email protected]>
Copy link

codecov bot commented Nov 11, 2023

Codecov Report

Merging #2695 (181d9d2) into master (ede63dd) will decrease coverage by 0.01%.
The diff coverage is 85.18%.

@@            Coverage Diff             @@
##           master    #2695      +/-   ##
==========================================
- Coverage   82.60%   82.59%   -0.01%     
==========================================
  Files         368      368              
  Lines       43001    43024      +23     
==========================================
+ Hits        35519    35536      +17     
- Misses       7482     7488       +6     
Files Coverage Δ
src/tss2-tcti/tctildr-dl.c 96.87% <90.00%> (+3.89%) ⬆️
src/tss2-tcti/tctildr.c 93.63% <84.50%> (-3.72%) ⬇️

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@AndreasFuchsTPM AndreasFuchsTPM merged commit fcff6da into tpm2-software:master Nov 29, 2023
27 checks passed
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.

2 participants