tpm2_policypcr(1) General Commands Manual tpm2_policypcr(1) (NAME) tpm2_policypcr(1) - PCR . (SYNOPSIS) tpm2_policypcr [] (DESCRIPTION) tpm2_policypcr(1) PCR TPM . PCR PCR policyor policyauthorize . tpm2_policyor(1) tpm2_policyauthorize(1) . PCR : 1. PCR tpm2_pcrread. 2. PCR TPM PCR. 3. PCR . (OPTIONS) o -L --policy=FILE: . o -f --pcr=FILE: PCR . PCR . o -l --pcr-list=PCR: PCR PCR . (forward sealing) . o -S --session=FILE: -S tpm2_startauthsession(1). o (ARGUMENT): PCR . : openssl dgst -sha256 -binary pcr.bin | xxd -p -c 32 (References) (Context Object Format) (handle) : o (transient object) TPM . o : o owner: (owner hierarchy) o platform: (platform hierarchy) o endorsement: (endorsement hierarchy) o lockout: (lockout control persistent object) o ( 0x81010013) ._OBJECT_. (Authorization Formatting) TPM 2.0 : 1. (Password) 2. HMAC 3. (Sessions) : " (EMPTY PASSWORD) ". auth HMAC . . . HMAC ( tpm2_startauthsession(1) ). (Passwords) . : (string) . (String) "str:" ( ) . (Examples) foobar str:foobar (Hex-string) "hex:" . (Example) hex:1122334455667788 (File) "file:" "-" stdin. . (Examples) # stdin : file:- # : file:path/to/password/file # stdin echo: echo foobar | tpm2_tool -p file:- # here-string stdin: tpm2_tool -p file:- <<< foobar (Sessions) session . tpm2_startauthsession(1) . auth ( ) + (Passwords) . (Examples) session.ctx: session:session.ctx session.ctx auth mypassword: session:session.ctx+mypassword session.ctx auth HEX 0x11223344: session:session.ctx+hex:11223344 PCR (PCR Authorizations) PCR "pcr:" PCR . PCR : = PCR " PCR (PCR bank specifiers)" . raw-pcr-file PCR tpm2_pcrread(1) . PCR. (Examples) PCR sha256 0 1 2 3 : pcr:sha256:0,1,2,3 AUTH. PCR (PCR Bank Specifiers) PCR : :[,] or :all `+' . : sha1:3,4+sha256:all SHA1 SHA256 . (forward sealing) : sha1:0,1=da39a3ee5e6b4b0d3255bfef95601890afd80709,2 PCR PCR 1 . . 0x . (Note) PCR PCR . TPM PCR . PCR. (COMMON OPTIONS) . o -h --help=[man|no-man]: (manpage) . (manpager) . "man" "man" man stderr . "no-man" stdout . MANPATH man(1) . o -v --version: TCTI . o -V --verbose: . . o -Q --quiet: stdout. o -Z --enable-errata: (errata fixups). errata TPM . TPM2TOOLS_ENABLE_ERRATA . o -z --pwd-session: HMAC . (clear text) TPM . (unsalted) OpenSSL FIPS . auth (salted) . o -R --autoflush: (autoflush) . . TPM2TOOLS_AUTOFLUSH yes true . . TCTI (TCTI Configuration) TCTI "Transmission Interface" TPM . TCTI TPM . TCTI : 1. -T --tcti 2. : TPM2TOOLS_TCTI. : . TCTI : o tabrmd - tabrmd . tabrmd abrmd tcti . o mssim - TPM . o device - TPM . o none - TPM . TPM (off-tpm) TCTI . TCTI . "none" . : : . TCTI (TCTI Defaults) TCTI TCTI dlopen(3) . TCTI tabrmd device mssim . -v TCTI . - "default-tcti" TCTI . TCTI (Custom TCTIs) TCTI TCTI . dlopen(3) tcti-name . dlopen(3) . TCTI (TCTI OPTIONS) TCTI : o device: TCTI (device) (character device) TPM TCTI . /dev/tpm0 . : -T device:/dev/tpm0 export TPM2TOOLS_TCTI="device:/dev/tpm0" o mssim: TCTI mssim IP () . 127.0.0.1 2321 . : -T mssim:host=localhost,port=2321 export TPM2TOOLS_TCTI="mssim:host=localhost,port=2321" o abrmd: TCTI abrmd - `,' . `=' . o TCTI abrmd : 1. `bus_name' : tabrmd ( ). 2. `bus_type' : dbus ( ) `session' `system'. tcti tabrmd bus_name=com.example.FooBar: \--tcti=tabrmd:bus_name=com.example.FooBar tcti (abrmd) bus_type=session: \--tcti:bus_type=session : abrmd tabrmd . TCTI. (EXAMPLES) (trial) PCR . (policy) (unseal) . : (Step 1: create a policy) tpm2_createprimary -C e -g sha256 -G ecc -c primary.ctx tpm2_pcrread -o pcr.dat "sha1:0,1,2,3" tpm2_startauthsession -S session.dat tpm2_policypcr -S session.dat -l "sha1:0,1,2,3" -f pcr.dat -L policy.dat tpm2_flushcontext session.dat : (Step 2: create an object using that policy) tpm2_create -Q -u key.pub -r key.priv -C primary.ctx -L policy.dat \ -i- <<< "12345678" tpm2_load -C primary.ctx -u key.pub -r key.priv -n unseal.key.name \ -c unseal.key.ctx : (Step 3: Satisfy the policy) tpm2_startauthsession --policy-session -S session.dat tpm2_policypcr -S session.dat -l "sha1:0,1,2,3" -f pcr.dat -L policy.dat : (Step 4: Use the policy) tpm2_unseal -psession:session.dat -c unseal.key.ctx 12345678 tpm2_flushcontext session.dat (RETURNS) : o 0 - . o 1 - . o 2 - . o 3 - . o 4 - TCTI. o 5 - . tpm2_testparams. (LIMITATIONS) tpm2_startauthsession(1) : o o tpm2-abrmd. . (BUGS) (Github Issues) (HELP) (Mailing List) (LICENSE) Creative Commons Attribution 4.0 (CC BY 4.0) . tpm2-tools tpm2_policypcr(1)