tpm2_sessionconfig(1)

πŸ’– NAME πŸ’–

tpm2_sessionconfig(1) β€” from the General Commands Manual β€” is here to configure session attributes and print session info from a session file. That’s the whole assignment, bestie. 🫢

🌸 SYNOPSIS 🌸

tpm2_sessionconfig [OPTIONS] [ARGUMENT]

✨ DESCRIPTION ✨

So again: tpm2_sessionconfig(1) β€” Configure session attributes and print session info from a session file.

This tool has two modes, and you’re gonna pick one:

  1. Configure/ modify the session attributes.
  2. Print the session information.

Mode 2 is the default behavior. Periodt. πŸ’…

πŸ’… OPTIONS πŸ’…

  • --enable-continuesession β€” turns on continueSession in the session-attributes.
  • --disable-continuesession β€” turns off continuesession in the session-attributes.
  • --enable-auditexclusive β€” turns on auditexclusive in the session-attributes.
  • --disable-auditexclusive β€” turns off auditexclusive in the session-attributes.
  • --enable-auditreset β€” turns on auditreset in the session-attributes.
  • --disable-auditreset β€” turns off auditreset in the session-attributes.
  • --enable-decrypt β€” turns on decrypt in the session-attributes.
  • --disable-decrypt β€” turns off decrypt in the session-attributes.
  • --enable-encrypt β€” turns on encrypt in the session-attributes.
  • --disable-encrypt β€” turns off encrypt in the session-attributes.
  • --enable-audit β€” turns on audit in the session-attributes.
  • --disable-audit β€” turns off audit in the session-attributes.
  • ARGUMENT β€” the session context file.

πŸ“Ž References πŸ“Ž

The original page just drops the word References here and keeps it moving 😭.

🌈 COMMON OPTIONS 🌈

These common options show up in a bunch of programs and give you information many users expect. Very β€œshared lore” of the tpm2-tools universe. ✨

  • -h, --help=[man|no-man] β€” shows the tool’s manpage. By default it tries to invoke the manpager, but on failure it outputs a short tool summary. Same behavior if you pass the man option argument; however, if explicit man is requested, the tool will provide errors from man on stderr. If no-man is specified, or the manpager fails, the short options will be output to stdout.

To successfully use the manpages feature, the manpages need to be installed or on MANPATH; see man(1) for more details.

  • -v, --version β€” displays version information for this tool, supported tctis, and exits.
  • -V, --verbose β€” increases the information the tool prints to the console during its execution. When using this option the file and line number are printed.
  • -Q, --quiet β€” silences normal tool output to stdout.
  • -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 TPM2TOOLS_ENABLE_ERRATA is equivalent.
  • -z, --pwd-session β€” uses 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 β€” enables 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 is set to yes or true. (The page then trails off with β€œinformation many users may expect.” β€” iconic manpage chaos 😭)

🌈 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.

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

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.

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. Slay, dynamic loading. πŸ¦‹

πŸŽ€ TCTI OPTIONS πŸŽ€

These options 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 various known TCTI modules.

πŸ“ EXAMPLES πŸ“

Start a bounded & salted session, disable continuesession and display session

tpm2 createprimary -c prim.ctx
tpm2 startauthsession -S session.ctx --policy-session -c prim.ctx

### Session info before changing attributes
tpm2 sessionconfig session.ctx

### Session info after changing attributes
tpm2 sessionconfig --disable-continuesession
tpm2 sessionconfig session.ctx

🫢 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.

πŸ‘‘ HELP πŸ‘‘

See the Mailing List.

πŸ“œ License πŸ“œ

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


tpm2_sessionconfig(1) is brought to you by tpm2-tools 🫢 β€” date: not listed on this page, so I’m not making one up, bestie πŸ’–

πŸ“¦ where this page comes from