tpm2_selftest(1)

🌸 tpm2_selftest(1) β€” the self-test one πŸ’…

okay bestie so this page is tpm2_selftest(1), straight out of the General Commands Manual, and it's genuinely so useful, i promise.

✨ SYNOPSIS ✨

tpm2_selftest [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

tpm2_selftest(1) β€” this is the one that makes your TPM go run a self-test on its own capabilities. like, it checks itself before it wrecks itself, periodt.

Self-test can be executed in two modes:

  • Simple test β€” the TPM tests the functions that require testing. only the necessities, lowkey efficient.
  • Full test β€” the TPM tests all functions regardless of what has already been tested. main character energy: everything gets checked, no exceptions.

Once the TPM receives this request, the TPM will return TPM_RC_TESTING for any command that requires a test. If a test fails, the TPM will return TPM_RC_FAILURE for any command other than TPM2_GetTestResult() and TPM2_GetCapability() during this time. πŸ’€ The TPM will remain in failure mode until the next TPM initialization. That's not a vibe, that's just how it is, so be aware.

πŸŽ€ OPTIONS πŸŽ€

  • -f, --fulltest β€” run the self-test in full mode. everything, bestie, all of it.

🌈 References

(cute little heading, the original just says References)

πŸ’œ COMMON OPTIONS

This collection of options are common to many programs and provide information that many users may expect. iykyk.

  • -h, --help=[man|no-man] β€” display the tool's manpage. by default it tries to invoke the manpager for the tool, but on failure it'll output a short tool summary instead. same behavior if you pass the man option argument, except if you explicitly request man, the tool will provide errors from man on stderr. if the no-man option is specified, or the manpager fails, the short options get output to stdout.
to actually use the manpages feature, the manpages have to be installed or on MANPATH. see man(1) for more details. 🫢
  • -v, --version β€” display version information for this tool, supported tctis and exit.
  • -V, --verbose β€” increase the information that the tool prints to the console during its execution. when you use this option the file and line number are printed. so much detail, obsessed.
  • -Q, --quiet β€” silence normal tool output to stdout. shhh 🀫
  • -Z, --enable-errata β€” enable the application of errata fixups. useful if an errata fixup needs to be applied to commands sent to the TPM. defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. two ways, same slay.
  • -z, --pwd-session β€” use password session instead of a HMAC session for authentication. a clear text password is passed to the TPM to authorize the action. this option can be used to avoid problems when unsalted sessions are used in OpenSSL FIPS mode. if auth values are used a salted session should be used for authentication. πŸ‘‘
  • -R, --autoflush β€” enable autoflush for transient objects created by the command. if a parent object is loaded from a context file, also the transient parent object will be flushed. autoflush can also be activated if the environment variable TPM2TOOLS_AUTOFLUSH is set to yes or true. (yep, the original says "is is set", typo and all, we're keeping the facts πŸ’– β€” and yes, it really does end with "information many users may expect.")

πŸ”Œ TCTI Configuration

The TCTI or "Transmission Interface" is the communication mechanism with the TPM. TCTIs can be changed for communication with TPMs across different mediums. it's giving flexible.

To control the TCTI, the tools respect:

  1. The command line option -T or --tcti
  2. The environment variable: TPM2TOOLS_TCTI.
Note: the command line option always overrides the environment variable. no cap.

The current known TCTIs are:

  • tabrmd β€” the resource manager, called tabrmd. note that tabrmd and abrmd as a tcti name are synonymous.
  • mssim β€” typically used for communicating to the TPM software simulator.
  • device β€” used when talking directly to a TPM device file.
  • none β€” do not initalize a connection with the TPM. some tools allow for off-tpm options and thus support not using a TCTI. tools that do not support it will error when attempted to be used without a TCTI connection. does not support ANY options and MUST BE presented as the exact text of none. literally exactly that, don't get creative.

The arguments to either the command line option or the environment variable are in the form:

<tcti-name>:<tcti-option-config>

Specifying an empty string for either the <tcti-name> or <tcti-option-config> results in the default being used for that portion respectively.

⭐ TCTI Defaults

When a TCTI is not specified, the default TCTI is searched for using dlopen(3) semantics. The tools will search for tabrmd, device and mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. you can query what TCTI will be chosen as the default by using the -v option to print the version information. the "default-tcti" key-value pair will indicate which of the aforementioned TCTIs is the default. 🎯

🧚 Custom TCTIs

Any TCTI that implements the dynamic TCTI interface can be loaded. The tools internally use dlopen(3), and the raw tcti-name value is used for the lookup. thus, this could be a path to the shared library, or a library name as understood by dlopen(3) semantics. bring your own, bestie.

πŸ“ TCTI OPTIONS

This collection of options are used to configure the various known TCTI modules available:

  • device: for the device TCTI, the TPM character device file for use by the device TCTI can be specified. the default is /dev/tpm0.

Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI="device:/dev/tpm0"

  • mssim: for the mssim TCTI, the domain name or IP address and port number used by the simulator can be specified. the default are 127.0.0.1 and 2321.

Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TCTI="mssim:host=localhost,port=2321"

  • abrmd: for the abrmd TCTI, the configuration string format is a series of simple key value pairs separated by a , character. each key and value string are separated by a = character.
    • TCTI abrmd supports two keys:
      1. bus_name : the name of the tabrmd service on the bus (a string).
      2. bus_type : the type of the dbus instance (a string) limited to session and system.

Specify the tabrmd tcti name and a config string of bus_name=com.example.FooBar:

--tcti=tabrmd:bus_name=com.example.FooBar

Specify the default (abrmd) tcti and a config string of bus_type=session:

--tcti:bus_type=session
NOTE: abrmd and tabrmd are synonymous. (the original also trails off with "the various known TCTI modules." β€” iconic, we're keeping it.)

🌟 EXAMPLES

🌸 Perform a simple TPM self-test

tpm2_selftest

πŸ”₯ Perform a complete TPM self-test

tpm2_selftest -f

πŸ’« Returns

Tools can return any of the following codes:

  • 0 β€” Success. πŸŽ‰
  • 1 β€” General non-specific error.
  • 2 β€” Options handling error.
  • 3 β€” Authentication error.
  • 4 β€” TCTI related error.
  • 5 β€” Non supported scheme. applicable to tpm2_testparams.

πŸ™ˆ BUGS

Github Issues β€” that's where they live, go report 'em.

πŸ’Œ HELP

See the Mailing List.

πŸ‘‘ License

This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). slay, legally.


okay that's the whole thing, bestie 🫢 this was tpm2_selftest(1) from tpm2-tools β€” go forth and self-test, and remember: the TPM stays in failure mode until the next TPM initialization, so be nice to it. bye pookie πŸ’–βœ¨

πŸ“¦ where this page comes from