tpm2_pcrreset(1)
π tpm2_pcrreset(1) π
ok so this is a page from the General Commands Manual β yes that one β and it's about tpm2_pcrreset. bestie, we're resetting PCR banks and honestly? it's giving factory-reset-for-cryptographic-measurements. let's get into it π«Ά
β¨ NAME β¨
tpm2_pcrreset(1) β reset one or more PCR banks. that's it. that's the whole job. iconic.
πΈ SYNOPSIS πΈ
tpm2_pcrreset [OPTIONS] PCR_INDEX ...
π¦ DESCRIPTION π¦
tpm2_pcrreset(1) resets the PCR value in all banks for the index you specify. and yes, you can pass more than one PCR index β go off, honestly.
the reset value is manufacturer-dependent, so it's either a whole sequence of 00 or a whole sequence of FF, and it's as long as the hash algorithm length for each supported bank. so like, every bank gets its own length of zeroes-or-FFs. no cap. π
PCR_INDEX is a space separated list of PCR indexes to be reset when issuing the command.
π OPTIONS π
the page literally states "This tool accepts no tool specific options." and then immediately gives you one (1) tool specific option. we love a plot twist π anyway:
--cphash=FILEβ file path where you want the hash of the command parameters recorded. this is commonly called cpHash, iykyk. NOTE: when this option is selected, the tool will not actually execute the command β it just returns a cpHash. literally just the hash, nothing else happens. π
π COMMON OPTIONS π
these are the options a bunch of the programs share, because consistency is cute and users expect them:
-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 themanoption argument β but if you explicitly ask forman, the tool will give you errors frommanon stderr. if you specify theno-manoption, or the manpager just fails, the short options get output to stdout.
to actually use the manpages feature you need the manpages installed or on MANPATH, see man(1) for more details.
-v,--versionβ display version information for this tool, plus supported tctis, then exit.-V,--verboseβ increases the info the tool prints to the console while it runs. when you use this option, the file and line number get printed. detective mode π-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 variableTPM2TOOLS_ENABLE_ERRATAis equivalent.-z,--pwd-sessionβ use 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.-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 variableTPM2TOOLS_AUTOFLUSHis set toyesortrue. (the original page says "is is" and honestly same, typos happen π)
π TCTI Configuration π
the TCTI, aka "Transmission Interface", is the communication mechanism with the TPM. TCTIs can be changed for communication with TPMs across different mediums. very flexible, very main character energy.
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. always. periodt.
the current known TCTIs are:
tabrmdβ the resource manager, calledtabrmd. 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 initialize 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. exact. like, character for character. no vibes-based spelling.
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. so like, empty = default. easy.
π§ 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. it's not a suggestion.
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. so this could be a path to the shared library, or a library name as understood by dlopen(3) semantics. bring your own TCTI, we'll load it π«Ά
π 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 defaults 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.
the 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 tosession' 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. same girl, different name π
πΈ EXAMPLES πΈ
Reset a single PCR
tpm2_pcrreset 23
Reset multiple PCRs
tpm2_pcrreset 16 23
look at that. two indexes, one command. we love efficiency π
π NOTES π
on operating system's locality (generally locality 0), only PCR 23 can be reset. PCR-16 can also be reset on this locality, depending on TPM manufacturers, which could define this PCR as resettable.
PCR 0 to 15 are not resettable (being part of SRTM). PCR 16 to 22 are mostly reserved for DRTM or dedicated to specific localities and might not be resettable depending on current TPM locality.
so real talk: if you try to reset PCR 0β15, that's a no. and 16β22 is very much a "depends on your TPM and your locality" situation. check before you wreck, bestie π«Ά
π₯ 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 totpm2_testparams.
π BUGS π
Github Issues
π HELP π
See the Mailing List
π License π
This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
and that's the page, bestie!! β¨ this little gem is brought to you by the fine folks of tpm2-tools β the footer on the original is literally just tpm2-tools and the page name tpm2_pcrreset(1), so no date to give you, it's giving mystery π΅οΈββοΈ anyway go reset those PCRs responsibly, mwah ππΈπ¦
π¦ 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