1tpm2_checkquote(1)          General Commands Manual         tpm2_checkquote(1)
2
3
4

NAME

6       tpm2_checkquote(1) - Validates a quote provided by a TPM.
7

SYNOPSIS

9       tpm2_checkquote [OPTIONS]
10

DESCRIPTION

12       tpm2_checkquote(1)  -  Uses  the  public portion of the provided key to
13       validate a quote generated by a TPM.  This will validate the  signature
14       against  the quote message and, if provided, verify that the qualifying
15       data and PCR values match those in the quote.  The PCR  values  can  be
16       provided  with or without the TPML_PCR_SELECTION information.  An exam‐
17       ple of PCR values without the PCR selection information is  the  output
18       from tpm2_pcrread.  If PCR value is specified without the PCR selection
19       information, then the PCR selection string must be specified using  the
20       -l option to interpret the PCR data.
21

OPTIONS

23-u, --public=FILE:
24
25         File  input for the public portion of the signature verification key.
26         Either the pem file or tss public format file.
27
28-g, --hash-algorithm=ALGORITHM:
29
30         The hash algorithm used to digest the message.
31
32-m, --message=FILE:
33
34         The quote message that makes up the data that is signed by the TPM.
35
36-s, --signature=FILE:
37
38         The input signature file of the signature to be validated.
39
40-f, --pcr=FILE:
41
42         Optional PCR input file to save the list of PCR values that were  in‐
43         cluded in the quote.
44
45-l, --pcr-list=PCR:
46
47         The list of PCR banks and selected PCRs’ ids for each bank.
48
49-q, --qualification=HEX_STRING_OR_PATH:
50
51         Qualification  data  for  the  quote.   Can either be a hex string or
52         path.  This is typically used to add a nonce against replay attacks.
53
54-F, --format=FORMAT:
55
56         DEPRECATED and IGNORED  as it’s superfluous.
57
58   References

Algorithm Specifiers

60       Options that take algorithms support “nice-names”.
61
62       There are two major algorithm specification string classes, simple  and
63       complex.  Only certain algorithms will be accepted by the TPM, based on
64       usage and conditions.
65
66   Simple specifiers
67       These are strings with no additional specification data.  When creating
68       objects,  non-specified  portions of an object are assumed to defaults.
69       You can find the list of known “Simple Specifiers” below.
70
71   Asymmetric
72       • rsa
73
74       • ecc
75
76   Symmetric
77       • aes
78
79       • camellia
80
81       • sm4
82
83   Hashing Algorithms
84       • sha1
85
86       • sha256
87
88       • sha384
89
90       • sha512
91
92       • sm3_256
93
94       • sha3_256
95
96       • sha3_384
97
98       • sha3_512
99
100   Keyed Hash
101       • hmac
102
103       • xor
104
105   Signing Schemes
106       • rsassa
107
108       • rsapss
109
110       • ecdsa
111
112       • ecdaa
113
114       • ecschnorr
115
116       • sm2
117
118   Asymmetric Encryption Schemes
119       • oaep
120
121       • rsaes
122
123       • ecdh
124
125   Modes
126       • ctr
127
128       • ofb
129
130       • cbc
131
132       • cfb
133
134       • ecb
135
136   Misc
137       • null
138
139   Complex Specifiers
140       Objects, when specified for creation by the TPM,  have  numerous  algo‐
141       rithms  to  populate  in the public data.  Things like type, scheme and
142       asymmetric details, key size, etc.  Below is  the  general  format  for
143       specifying this data: <type>:<scheme>:<symmetric-details>
144
145   Type Specifiers
146       This  portion  of the complex algorithm specifier is required.  The re‐
147       maining scheme and symmetric details will default  based  on  the  type
148       specified and the type of the object being created.
149
150       • aes - Default AES: aes128
151
152       • aes128<mode>  - 128 bit AES with optional mode (ctr|ofb|cbc|cfb|ecb).
153         If mode is not specified, defaults to null.
154
155       • aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
156
157       • aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
158
159       • sm4 - Default SM4: sm4128
160
161       • sm4128  or  sm4_128  <mode>  -  128  bit  SM4  with   optional   mode
162         (ctr|ofb|cbc|cfb|ecb).  If mode is not specified, defaults to null.
163
164       • ecc - Elliptical Curve, defaults to ecc256.
165
166       • ecc192 or ecc_nist_p192 - 192 bit ECC NIST curve
167
168       • ecc224 or ecc_nist_p224 - 224 bit ECC NIST curve
169
170       • ecc256 or ecc_nist_p256 - 256 bit ECC NIST curve
171
172       • ecc384 or ecc_nist_p384 - 384 bit ECC NIST curve
173
174       • ecc521 or ecc_nist_p521 - 521 bit ECC NIST curve
175
176       • ecc_sm2 or ecc_sm2_p256 - 256 bit SM2 curve
177
178       • rsa - Default RSA: rsa2048
179
180       • rsa1024 - RSA with 1024 bit keysize.
181
182       • rsa2048 - RSA with 2048 bit keysize.
183
184       • rsa3072 - RSA with 3072 bit keysize.
185
186       • rsa4096 - RSA with 4096 bit keysize.
187
188   Scheme Specifiers
189       Next, is an optional field, it can be skipped.
190
191       Schemes  are  usually Signing Schemes or Asymmetric Encryption Schemes.
192       Most signing schemes take a hash algorithm directly following the sign‐
193       ing  scheme.   If the hash algorithm is missing, it defaults to sha256.
194       Some take no arguments, and some take multiple arguments.
195
196   Hash Optional Scheme Specifiers
197       These scheme specifiers are followed by a dash and a valid  hash  algo‐
198       rithm, For example: oaep-sha256.
199
200       • oaep
201
202       • ecdh
203
204       • rsassa
205
206       • rsapss
207
208       • ecdsa
209
210       • ecschnorr
211
212       • sm2
213
214   Multiple Option Scheme Specifiers
215       This  scheme  specifier  is  followed by a count (max size UINT16) then
216       followed by a dash(-) and a valid hash algorithm.  * ecdaa For example,
217       ecdaa4-sha256.  If no count is specified, it defaults to 4.
218
219   No Option Scheme Specifiers
220       This scheme specifier takes NO arguments.  * rsaes
221
222   Symmetric Details Specifiers
223       This  field is optional, and defaults based on the type of object being
224       created and it’s attributes.  Generally, any valid Symmetric  specifier
225       from  the Type Specifiers list should work.  If not specified, an asym‐
226       metric objects symmetric details defaults to aes128cfb.
227
228   Examples
229   Create an rsa2048 key with an rsaes asymmetric encryption scheme
230       tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
231
232   Create an ecc256 key with an ecdaa signing scheme with a  count  of  4  and
233       sha384 hash
234       /tpm2_create  -C  parent.ctx  -G  ecc256:ecdaa4-sha384  -u  key.pub  -r
235       key.priv cryptographic algorithms ALGORITHM.
236

Signature Format Specifiers

238       Format selection for the signature output file.  tss (the default) will
239       output a binary blob according to the TPM 2.0 specification and any po‐
240       tential compiler padding.  The option plain will output the plain  sig‐
241       nature  data as defined by the used cryptographic algorithm.  signature
242       FORMAT.
243

COMMON OPTIONS

245       This collection of options are common to many programs and provide  in‐
246       formation that many users may expect.
247
248-h,  --help=[man|no-man]:  Display the tools manpage.  By default, it
249         attempts to invoke the manpager for the  tool,  however,  on  failure
250         will  output  a short tool summary.  This is the same behavior if the
251         “man” option argument is specified, however if explicit “man” is  re‐
252         quested,  the  tool  will  provide errors from man on stderr.  If the
253         “no-man” option if specified, or the manpager fails,  the  short  op‐
254         tions will be output to stdout.
255
256         To  successfully use the manpages feature requires the manpages to be
257         installed or on MANPATH, See man(1) for more details.
258
259-v, --version: Display version information for this  tool,  supported
260         tctis and exit.
261
262-V,  --verbose:  Increase the information that the tool prints to the
263         console during its execution.  When using this option  the  file  and
264         line number are printed.
265
266-Q, --quiet: Silence normal tool output to stdout.
267
268-Z, --enable-errata: Enable the application of errata fixups.  Useful
269         if an errata fixup needs to be applied to commands sent to  the  TPM.
270         Defining  the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.  in‐
271         formation many users may expect.
272

TCTI Configuration

274       The TCTI or “Transmission Interface”  is  the  communication  mechanism
275       with  the TPM.  TCTIs can be changed for communication with TPMs across
276       different mediums.
277
278       To control the TCTI, the tools respect:
279
280       1. The command line option -T or --tcti
281
282       2. The environment variable: TPM2TOOLS_TCTI.
283
284       Note: The command line option always overrides  the  environment  vari‐
285       able.
286
287       The current known TCTIs are:
288
289       • tabrmd      -     The     resource     manager,     called     tabrmd
290         (https://github.com/tpm2-software/tpm2-abrmd).  Note that tabrmd  and
291         abrmd as a tcti name are synonymous.
292
293       • mssim  - Typically used for communicating to the TPM software simula‐
294         tor.
295
296       • device - Used when talking directly to a TPM device file.
297
298       • none - Do not initalize a connection with the TPM.  Some tools  allow
299         for off-tpm options and thus support not using a TCTI.  Tools that do
300         not support it will error when attempted to be used  without  a  TCTI
301         connection.   Does  not  support ANY options and MUST BE presented as
302         the exact text of “none”.
303
304       The arguments to either the command  line  option  or  the  environment
305       variable are in the form:
306
307       <tcti-name>:<tcti-option-config>
308
309       Specifying  an  empty  string  for  either the <tcti-name> or <tcti-op‐
310       tion-config> results in the default being used for that portion respec‐
311       tively.
312
313   TCTI Defaults
314       When  a  TCTI  is not specified, the default TCTI is searched for using
315       dlopen(3) semantics.  The tools will  search  for  tabrmd,  device  and
316       mssim  TCTIs  IN THAT ORDER and USE THE FIRST ONE FOUND.  You can query
317       what TCTI will be chosen as the default by using the -v option to print
318       the  version information.  The “default-tcti” key-value pair will indi‐
319       cate which of the aforementioned TCTIs is the default.
320
321   Custom TCTIs
322       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
323       tools internally use dlopen(3), and the raw tcti-name value is used for
324       the lookup.  Thus, this could be a path to the shared library, or a li‐
325       brary name as understood by dlopen(3) semantics.
326

TCTI OPTIONS

328       This collection of options are used to configure the various known TCTI
329       modules available:
330
331device: For the device TCTI, the TPM character device file for use by
332         the device TCTI can be specified.  The default is /dev/tpm0.
333
334         Example:    -T   device:/dev/tpm0   or   export   TPM2TOOLS_TCTI=“de‐
335         vice:/dev/tpm0”
336
337mssim: For the mssim TCTI, the domain name or  IP  address  and  port
338         number  used  by  the  simulator  can  be specified.  The default are
339         127.0.0.1 and 2321.
340
341         Example: -T mssim:host=localhost,port=2321  or  export  TPM2TOOLS_TC‐
342         TI=“mssim:host=localhost,port=2321”
343
344abrmd:  For  the abrmd TCTI, the configuration string format is a se‐
345         ries of simple key value pairs separated by a  `,'  character.   Each
346         key and value string are separated by a `=' character.
347
348         • TCTI abrmd supports two keys:
349
350           1. `bus_name'  :  The  name  of  the  tabrmd  service on the bus (a
351              string).
352
353           2. `bus_type' : The type of the dbus instance (a string) limited to
354              `session' and `system'.
355
356         Specify  the tabrmd tcti name and a config string of bus_name=com.ex‐
357         ample.FooBar:
358
359                \--tcti=tabrmd:bus_name=com.example.FooBar
360
361         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
362         sion:
363
364                \--tcti:bus_type=session
365
366         NOTE:  abrmd  and tabrmd are synonymous.  the various known TCTI mod‐
367         ules.
368

EXAMPLES

370   Generate a quote with a TPM, then verify it
371              tpm2_createek -c 0x81010001 -G rsa -u ekpub.pem -f pem
372
373              tpm2_createak -C 0x81010001 -c ak.ctx -G rsa -s rsassa -g sha256 \
374              -u akpub.pem -f pem -n ak.name
375
376              tpm2_quote -c ak.ctx -l sha256:15,16,22 -q abc123 -m quote.msg -s quote.sig \
377                -o quote.pcrs -g sha256
378
379              tpm2_checkquote -u akpub.pem -m quote.msg -s quote.sig -f quote.pcrs -g sha256 \
380                -q abc123
381

Returns

383       Tools can return any of the following codes:
384
385       • 0 - Success.
386
387       • 1 - General non-specific error.
388
389       • 2 - Options handling error.
390
391       • 3 - Authentication error.
392
393       • 4 - TCTI related error.
394
395       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
396

BUGS

398       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
399

HELP

401       See the Mailing List (https://lists.linuxfoundation.org/mailman/listin
402       fo/tpm2)
403
404
405
406tpm2-tools                                                  tpm2_checkquote(1)
Impressum