tpm2_startup(1)

πŸ’… tpm2_startup(1) β€” the general commands manual page, bestie edition

okay so this is tpm2_startup(1) from the General Commands Manual and it's literally just about sending a startup command to the TPM. short page, big energy. let's get into it 🫢


✨ NAME ✨

tpm2_startup(1) β€” Send a startup command to the TPM. that's it. that's the whole job. πŸ’«


πŸ¦‹ SYNOPSIS πŸ¦‹

tpm2_startup [OPTIONS]

🌸 DESCRIPTION 🌸

tpm2_startup(1) sends a TPM2_Startup command, and it's gonna be either TPM_SU_CLEAR or TPM_SU_STATE. pick your fighter, we'll get to how. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -c, --clear β€” sends the startup type as TPM_SU_CLEAR instead of TPM2_SU_STATE. lowkey a whole vibe change, no cap.

References

(this is a heading that exists in the original with nothing under it β€” yes really, we're keeping it, we don't skip parts around here 😌)


πŸ‘‘ COMMON OPTIONS πŸ‘‘

okay these are the options a bunch of the tools share, the little communal closet of flags that many users may expect:

  • -h, --help=[man|no-man] β€” shows you the tool's manpage. by default it tries to invoke the manpager for the tool, but if that fails it'll output a short tool summary instead. same behavior if you pass the man option argument β€” BUT if you explicitly ask for man, the tool will give you errors from man on stderr. if you specify the no-man option, or if the manpager fails, the short options get output to stdout.
to actually use the manpages feature, the manpages need to be installed or on MANPATH. see man(1) for more deets. πŸ“–
  • -v, --version β€” displays version info for this tool plus the supported tctis, then exits. slay and goodbye ✌️
  • -V, --verbose β€” makes the tool print more info to the console while it runs. when you use this one, the file and line number get printed too. very "show your work" of it.
  • -Q, --quiet β€” silences normal tool output to stdout. shhh 🀫
  • -Z, --enable-errata β€” enables applying errata fixups. useful if an errata fixup needs to be applied to commands sent to the TPM. defining the environment variable TPM2TOOLS_ENABLE_ERRATA is equivalent. same thing, different font.
  • -z, --pwd-session β€” uses a password session instead of a HMAC session for authentication. a clear text password gets 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 β€” enables autoflush for transient objects created by the command. if a parent object is loaded from a context file, the transient parent object will be flushed too. autoflush can also be activated if the environment variable TPM2TOOLS_AUTOFLUSH is set to yes or true. (yes, the original says "is is" β€” we're keeping the spirit, it's giving typo, love that for us πŸ’€) β€” information many users may expect. 🧚

🌈 TCTI Configuration 🌈

the TCTI, aka the "Transmission Interface", is the communication mechanism with the TPM. TCTIs can be changed so you can talk to TPMs across different mediums. versatile icon.

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. always. periodt. πŸ’…

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. simulator girlie behavior.
  • device β€” used when talking directly to a TPM device file. no middleman, main character energy.
  • 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.
⚠️ like, literally the exact text none. no decor, no extra options, doesn't support ANY. don't try it.

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. convenient!

🐚 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. order matters bestie, do not come for me.

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. cute lil detective work πŸ”

πŸ¦„ 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. so this could be a path to the shared library, or a library name as understood by dlopen(3) semantics. bring your own, we love a custom moment.


⭐ TCTI OPTIONS ⭐

this collection of options configures 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 defaults 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.
    • the 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 various known TCTI modules. 🫢

πŸ”₯ EXAMPLES πŸ”₯

Send a TPM Startup Command with flags TPM2_SU_STATE

tpm2_startup

Send a TPM Startup Command with flags TPM2_SU_CLEAR

tpm2_startup -c

πŸ’œ NOTES πŸ’œ

typically a Resource Manager (like tpm2-abrmd) or low-level/boot software will have already sent this command. so like… check before you go doing it again, bestie. πŸ™ˆ


🌟 Returns 🌟

tools can return any of the following codes:

  • 0 β€” Success. we love a win πŸ’–
  • 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 the whole thing. go file one, i believe in you.)


πŸ“¬ HELP πŸ“¬

See the Mailing List.


πŸŽ€ License πŸŽ€

this work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). iconic of them, honestly.


and that's the page!! 🌈 this whole thing comes to you from tpm2-tools, and it's the tpm2_startup(1) page β€” ok bye bestie, go start some TPMs responsibly πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from