[go: up one dir, main page]

File: nv-attrs.md

package info (click to toggle)
tpm2-tools 5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,396 kB
  • sloc: ansic: 35,984; sh: 12,809; xml: 8,089; makefile: 569
file content (36 lines) | stat: -rw-r--r-- 1,817 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# NV Attributes

NV Attributes are used to control various properties of the NV defined space.
When specified as an option, either the raw bitfield mask or "nice-names" may be
used. The values can be found in Table 204 Part 2 of the TPM2.0 specification,
which can be found here:

<https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf>

Nice names are calculated by taking the name field of table 204 and removing the
prefix **TPMA_NV_** and lowercasing the result. Thus, **TPMA_NV_PPWRITE** becomes
ppwrite. Nice names can be joined using the bitwise or "|" symbol.

Note that the **TPM_NT** field is 4 bits wide, and thus can be set via
**nt=<num>** format. For instance, to set The fields **TPMA_NV_OWNERREAD**,
**TPMA_NV_OWNERWRITE**, **TPMA_NV_POLICYWRITE**, and **TPMA_NT = 0x2**, the argument
would be:

**ownerread|ownerwrite|policywrite|nt=0x2**

Additionally, the NT field, which denotes the type of the NV index, can also be specified
via friendly names:
  * ordinary - Ordinary contains data that is opaque to the TPM that can
      only be modified using TPM2\_NV\_Write.
  * counter - Counter contains an 8-octet value that is to be used as a
      counter and can only be modified with TPM2\_NV\_Increment
  * bits - Bit Field contains an 8-octet value to be used as a bit field
      and can only be modified with TPM2\_NV\_SetBits.
  * pinfail - PIN Fail contains an 8-octet pinCount that increments on a PIN authorization failure and a pinLimit.
  * pinpass - PIN Pass contains an 8-octet pinCount that increments on a PIN authorization success and a pinLimit.

For instance, to set The fields **TPMA_NV_OWNERREAD**,
**TPMA_NV_OWNERWRITE**, **TPMA_NV_POLICYWRITE**, and **TPMA_NT = bits**, the argument
would be:

**ownerread|ownerwrite|policywrite|nt=bits**