tpm2_send(1)
๐ tpm2_send(1) โ General Commands Manual (yes bestie, that's the whole vibe) ๐
Okay so this is tpm2_send(1) from the General Commands Manual, and honestly it's giving "raw unfiltered TPM energy" โ let's get into it ๐ซถ
โจ NAME โจ
tpm2_send(1) โ literally just: send a raw command buffer to the TPM. That's it. That's the whole gig ๐
๐ธ SYNOPSIS ๐ธ
tpm2_send [OPTIONS] [STDIN]
๐ฆ DESCRIPTION ๐ฆ
So tpm2_send(1) sends a TPM command to the TPM, periodt. The command gets read from a file as a binary stream, then transmitted to the TPM using the TCTI that the caller specified. Whatever the TPM sends back โ the response โ gets written to the output file.
Lowkey, you're probably gonna want to redirect that output somewhere: into a file, or straight into a program that decodes it and shows the response in human-readable form. That's the main character move here ๐
๐ OPTIONS ๐
-o,--output=FILEโ the output file where the response buffer gets sent. Defaults toSTDOUT. (So if you say nothing, it just yeets it at your terminal ๐)_STDINโ the file containing the TPM2 command. That's your input, bestie.
๐ References
(That's the subsection, no cap โ nothing extra hiding in here.)
๐ COMMON OPTIONS ๐
This little collection of options is common to many programs, and it provides info that a lot of users justโฆ expect to be there. It's the standard bestie starter pack โจ
-h,--help=[man|no-man]โ displays 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 themanoption argument โ except if you explicitly ask forman, the tool will actually give you the errors from man onstderr. If you specify theno-manoption, or the manpager just fails, the short options get output tostdout.
Just so you know ๐ซถ โ for the manpages feature to actually work, the manpages need to be installed or onMANPATH. Seeman(1)for more details.
-v,--versionโ displays version information for this tool plus the supported tctis, then exits. Slay.-V,--verboseโ increases the info the tool prints to the console while it's running. When you use this option, the file and line number get printed too. iykyk ๐-Q,--quietโ silences normal tool output tostdout. Shhh ๐คซ-Z,--enable-errataโ enables the application of errata fixups. Useful if an errata fixup needs to be applied to commands sent to the TPM. Defining the environment variableTPM2TOOLS_ENABLE_ERRATAis equivalent. Two paths, same destination ๐ซ-z,--pwd-sessionโ uses a 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. (Read that last bit again, bestie โ it matters ๐)-R,--autoflushโ enables autoflush for transient objects created by the command. If a parent object is loaded from a context file, then also the transient parent object will be flushed. Autoflush can also be activated if the environment variableTPM2TOOLS_AUTOFLUSHis set toyesortrue. Here's that info 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:
- The command line option
-Tor--tcti - The environment variable:
TPM2TOOLS_TCTI.
Note: the command line option always overrides the environment variable. No negotiating ๐
The current known TCTIs are:
tabrmdโ the resource manager, called tabrmd. Note thattabrmdandabrmdas 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 don't support it will error when you try to use them without a TCTI connection. Does not support ANY options and MUST BE presented as the exact text ofnone.
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. Cute and forgiving ๐
๐ง TCTI Defaults
When a TCTI isn't 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 โ yes, the caps are doing their job, that's the actual emphasis ๐ญ
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 tell you which of the aforementioned TCTIs is the default. Peek at your future, bestie ๐ฎ
โญ 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 that could be a path to the shared library, or a library name as understood by dlopen(3) semantics. Bring your own, we love a guest appearance ๐
๐ TCTI OPTIONS ๐
This collection of options is 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 are127.0.0.1and2321.
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:
bus_name: the name of the tabrmd service on the bus (a string).bus_type: the type of the dbus instance (a string) limited tosessionandsystem.
- TCTI abrmd supports two keys:
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:abrmdandtabrmdare synonymous. Also, that's the various known TCTI modules. ๐
๐ฅ EXAMPLES ๐ฅ
๐ซ Send and receive raw commands to TPM
Send the contents of tpm2-command.bin to a device and collect the response as tpm2-response.bin. Watch her work:
tpm2_send < tpm2-command.bin > tpm2-response.bin
tpm2_send < tpm2-command.bin -o tpm2-response.bin
Two ways, same energy. Do it with shell redirection or do it with -o โ your call, both slay ๐
๐ Returns ๐
Tools can return any of the following codes:
0โ Success. We love to see it ๐1โ General non-specific error. Vague, unhelpful, but real.2โ Options handling error.3โ Authentication error. Locked out, bestie ๐ญ4โ TCTI related error.5โ Non supported scheme. Applicable totpm2_testparams.
๐ BUGS ๐
Github Issues. That's it, that's the whole bug section. Take it up with the issues page ๐ซถ
๐ฃ HELP ๐ฃ
See the Mailing List.
๐ License ๐
This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). Respect the license, bestie ๐
And that's the whole page!! ๐ฆ This came to you from tpm2-tools โ the source/version behind everything you just read โ with tpm2_send(1) as the manpage name riding along at the bottom, exactly like the original footer (no date printed on this one, so no date to gossip about ๐). Go send some raw commands, you absolute icon ๐โจ
๐ฆ where this page comes from
- arch rolling: tpm2-tools 5.8-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms