tpm2_getpolicydigest(1)

πŸ‘‘ tpm2_getpolicydigest(1) β€” General Commands Manual πŸ‘‘

okay so bestie, buckle up: this is the page for tpm2_getpolicydigest(1), and it's genuinely one of the simpler ones β€” it just retrieves the policy digest from a session. That's the whole vibe. Let's get into it πŸ’…


✨ NAME ✨

tpm2_getpolicydigest(1) β€” retrieves the policy digest from session. yep, that's it, that's the girl πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

tpm2_getpolicydigest [OPTIONS] [ARGUMENT]

literally that's the whole shape of it. [OPTIONS] and one [ARGUMENT], both optional, no drama 🌸


πŸ’– DESCRIPTION πŸ’–

tpm2_getpolicydigest(1) returns the policydigest of a session. that's the entire personality πŸ”₯

By default the output goes to stdout and it comes out in binary format β€” unless you say otherwise with the -o option and the --hex option respectively. so like, you can change both the destination and the format, but only if you actually ask. otherwise: binary, stdout, no cap πŸ’€


🌈 OPTIONS 🌈

  • -o, --output=FILE β€” tells it which filename to write the raw bytes to. defaults to stdout as a hex string 🫢
  • --hex β€” converts the output data to hex format, and ngl it does it without a leading "0x". so no cute little prefix, just the hex, periodt ✨
  • -S, --session=FILE: β€” the session, created using tpm2_startauthsession. this is your main character option, it's the whole point of the command πŸ‘‘
tiny note from the original page: there's a stray References bit just hanging out between the options and the common options. we don't know her, we don't question her, we simply report that she is there πŸ™ˆ

πŸ’œ COMMON OPTIONS πŸ’œ

okay so this collection of options is common to a bunch of these programs, and they provide information that many users may expect. group-chat classics, basically πŸ’…

  • -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 just output a short tool summary. same behavior if you pass the "man" option argument β€” however (!!) if you explicitly request "man", the tool will hand you errors from man on stderr instead. and if "no-man" is specified, or the manpager just flops, the short options get output to stdout. to successfully use the manpages feature, you need the manpages installed or on MANPATH. see man(1) for more details, iykyk πŸ“–
  • -v, --version β€” displays version information for this tool, plus the supported tctis, then exits. cute little flex 🌟
  • -V, --verbose β€” increases the information the tool prints to the console during execution. when you use this option, the file and line number get printed too. detective mode πŸ”
  • -Q, --quiet β€” silences normal tool output to stdout. she's not talking to you rn 🀫
  • -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 variable TPM2TOOLS_ENABLE_ERRATA is equivalent. same energy, different door πŸšͺ
  • -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. noted, bestie, safety first 🧚
  • -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 variable TPM2TOOLS_AUTOFLUSH is set to yes or true. (and yes, the original page trails off with information many users may expect right after that β€” copy-paste queen behavior, we respect it πŸ™ˆ) πŸ“

πŸ”Œ 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. so like, it's the group chat the tool and the TPM are in together πŸ“±

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. no exceptions, she said what she said πŸ’…

The current known TCTIs are:

  • tabrmd β€” the resource manager, called tabrmd. note that tabrmd and abrmd as a tcti name are synonymous. same girl, two names πŸ‘―
  • 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". (sic β€” "initalize" is the original's spelling, we keep her πŸ’€)

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 the <tcti-option-config> results in the default being used for that portion respectively. blank = 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. 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. it's giving first-come-first-served πŸ‘‘


🧚 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 guest star πŸ’œ


πŸ”₯ 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 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 original page ends this section with the fragment the various known TCTI modules. β€” another little copy-paste ghost, keeping her here for accuracy πŸ‘»)

🌸 EXAMPLES 🌸

πŸ’« Create a session and retrieve policydigest πŸ’«

tpm2 startauthsession -S session.ctx
tpm2 policypassword -S session.ctx -L test.policy
tpm2 getpolicydigest -S session.ctx -o policy.out
tpm2 flushcontext session.ctx

like, look at her go. start a session, set a policy, grab the digest, flush the context. clean, iconic, no notes πŸ’…βœ¨


⭐ Returns ⭐

Tools can return any of the following codes:

  • 0 β€” Success. we love a win πŸŽ‰
  • 1 β€” General non-specific error. vague, mysterious, honestly relatable 😭
  • 2 β€” Options handling error. you did too much with the flags, bestie πŸ™ˆ
  • 3 β€” Authentication error. she doesn't know you like that πŸ”’
  • 4 β€” TCTI related error. communication breakdown πŸ’€
  • 5 β€” Non supported scheme. applicable to tpm2_testparams.

πŸ› BUGS πŸ›

Github Issues β€” that's where you go 🫢


πŸ“– HELP πŸ“–

See the Mailing List 🌈


©️ License ©️

This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). slay, legally πŸ’œ


okay that's the whole page, bestie β€” and fr fr, this one ships as part of tpm2-tools, so go forth and get those policy digests. no date on this footer, just the source, we keep it 100 πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from