tpm2_changeeps(1)
hii bestie π welcome to the tpm2_changeeps(1) page from the tpm2-tools manual β the one that's all about swapping out your endorsement primary seed. it's giving "fresh start" energy and honestly? we're obsessed. periodt. β¨
π NAME π
tpm2_changeeps(1) β replaces the active endorsement primary seed with a shiny new one generated off the TPM2 RNG. that's the whole vibe. π
β¨ SYNOPSIS β¨
tpm2_changeeps [OPTIONS]
π DESCRIPTION π
okay so bestie, here's the tea β β tpm2_changeeps(1) swaps your active endorsement primary seed for a brand new one generated off the TPM2 RNG. the way that this is a big deal: the Transient and Persistent objects hanging out under the endorsement hierarchy are lost. like gone gone. π no cap, they do not survive this.
also important: this command requires platform auth. don't forget it. π
π₯ OPTIONS π₯
-p,--auth=AUTHβ specifies the AUTH for the platform hierarchy. this is your platform auth ticket, bestie ποΈ--cphash=FILEβ file path to record the hash of the command parameters. this is commonly termed as cpHash. NOTE: when this option is selected, the tool will not actually execute the command β it simply returns a cpHash, unless rphash is also required. iykyk π--rphash=FILEβ file path to record the hash of the response parameters. this is commonly termed as rpHash. matching set with cphash fr fr π«-S,--session=FILE:β the session created usingtpm2_startauthsession. this can be used to specify an auxiliary session for auditing and/or encryption/decryption of the parameters. very main character energy π
π«Ά References π«Ά
π Authorization Formatting π
authorization for use of an object in TPM2.0 can come in 3 different forms, bestie:
- Password
- HMAC
- Sessions
NOTE: "Authorizations default to the EMPTY PASSWORD when not specified". yes that's the whole point, don't come for me π
for authentication with auth values, the tool commands implicitly generate an HMAC session. thus passwords are not transmitted unencrypted. this does not apply to passwords defined for objects β in this case, an HMAC session should be used (see tpm2_startauthsession(1)). slay for secure defaults π
Passwords
passwords are interpreted in the following forms below using prefix identifiers.
Note: by default passwords are assumed to be in the string form when they do not have a prefix.
String
a string password, specified by prefix str: or its absence (raw string without prefix) is not interpreted, and is directly used for authorization. simple as that β¨
Examples:
foobar
str:foobar
Hex-string
a hex-string password, specified by prefix hex: is converted from a hexadecimal form into a byte array form β thus allowing passwords with non-printable and/or terminal un-friendly characters. no more keyboard-mashing mysteries π¦
Example:
hex:1122334455667788
File
a file based password, specified with the prefix file:, should be the path of a file containing the password to be read by the tool β or a - to use stdin. storing passwords in files prevents information leakage; passwords passed as options can be read from the process list or common shell history features. protect your secrets bestie π
Examples:
# to use stdin and be prompted
file:-
# to use a file from a path
file:path/to/password/file
# to echo a password via stdin:
echo foobar | tpm2_tool -p file:-
# to use a bash here-string via stdin:
tpm2_tool -p file:- <<< foobar
Sessions
when using a policy session to authorize the use of an object, prefix the option argument with the session keyword. then indicate a path to a session file that was created with tpm2_startauthsession(1). optionally, if the session requires an auth value to be sent with the session handle (eg policy password), then append a + and a string as described in the Passwords section. okay so it's giving modular β¨
Examples:
to use a session context file called session.ctx:
session:session.ctx
to use a session context file called session.ctx AND send the authvalue mypassword:
session:session.ctx+mypassword
to use a session context file called session.ctx AND send the HEX authvalue 0x11223344:
session:session.ctx+hex:11223344
PCR Authorizations
you can satisfy a PCR policy using the pcr: prefix and the PCR minilanguage. the PCR minilanguage is as follows:
<pcr-spec>=<raw-pcr-file>
the PCR spec is documented in the section "PCR bank specifiers". π§
the raw-pcr-file is an optional argument that contains the output of the raw PCR contents as returned by tpm2_pcrread(1).
PCR bank specifiers
Examples:
to satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier of:
pcr:sha256:0,1,2,3
specifying AUTH.
π 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 versatile π«
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 debate π
the current known TCTIs are:
tabrmdβ the resource manager, called tabrmd. note thattabrmdandabrmdas a tcti name are synonymous. same vibe, different name πmssimβ typically used for communicating to the TPM software simulator. simulator girlies rise πΈdeviceβ used when talking directly to a TPM device file. old school, we respect it π«Ά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 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". read that again β exact text bestie, no extra characters π€
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. mystery solved π
π¦ 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 TCTI, we love a custom moment π
π 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 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.- 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. the various known TCTI modules.
π EXAMPLES π
Change the endorsement primary seed where the platform auth is NULL.
tpm2_changeeps
that's it. that's the example. iconic minimalism π
π Returns π
tools can return any of the following codes:
0β Success. we love a win π1β General non-specific error. vague but okay π2β Options handling error. check your flags bestie π©3β Authentication error. wrong key energy π4β TCTI related error. communication breakdown π5β Non supported scheme. applicable totpm2_testparams. not every scheme is invited to the party π
π Limitations π
it expects a session to be already established via tpm2_startauthsession(1) and requires one of the following:
- direct device access
- extended session support with
tpm2-abrmd.
without it, most resource managers will not save session state between command invocations. so plan ahead, bestie π§
π BUGS π
Github Issues. the classic. found a bug? the github is right there π«Ά
π HELP π
See the Mailing List. the group chat of the tpm2 world β¨
π License π
this work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
~ fin ~ π brought to you by the tpm2-tools gang, dated whenever this manual page was last touched β no cap, slay, and happy seed-swapping bestie πβ¨π
π¦ 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