hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/Documentation/security/keys/trusted-encrypted.rst
....@@ -18,9 +18,31 @@
1818 when the kernel and initramfs are updated. The same key can have many saved
1919 blobs under different PCR values, so multiple boots are easily supported.
2020
21
+TPM 1.2
22
+-------
23
+
2124 By default, trusted keys are sealed under the SRK, which has the default
2225 authorization value (20 zeros). This can be set at takeownership time with the
2326 trouser's utility: "tpm_takeownership -u -z".
27
+
28
+TPM 2.0
29
+-------
30
+
31
+The user must first create a storage key and make it persistent, so the key is
32
+available after reboot. This can be done using the following commands.
33
+
34
+With the IBM TSS 2 stack::
35
+
36
+ #> tsscreateprimary -hi o -st
37
+ Handle 80000000
38
+ #> tssevictcontrol -hi o -ho 80000000 -hp 81000001
39
+
40
+Or with the Intel TSS 2 stack::
41
+
42
+ #> tpm2_createprimary --hierarchy o -G rsa2048 -c key.ctxt
43
+ [...]
44
+ #> tpm2_evictcontrol -c key.ctxt 0x81000001
45
+ persistentHandle: 0x81000001
2446
2547 Usage::
2648
....@@ -30,7 +52,9 @@
3052 keyctl print keyid
3153
3254 options:
33
- keyhandle= ascii hex value of sealing key default 0x40000000 (SRK)
55
+ keyhandle= ascii hex value of sealing key
56
+ TPM 1.2: default 0x40000000 (SRK)
57
+ TPM 2.0: no default; must be passed every time
3458 keyauth= ascii hex auth for sealing key default 0x00...i
3559 (40 ascii zeros)
3660 blobauth= ascii hex auth for sealed data default 0x00...
....@@ -76,13 +100,19 @@
76100
77101 Where::
78102
79
- format:= 'default | ecryptfs'
103
+ format:= 'default | ecryptfs | enc32'
80104 key-type:= 'trusted' | 'user'
81105
82106
83107 Examples of trusted and encrypted key usage:
84108
85
-Create and save a trusted key named "kmk" of length 32 bytes::
109
+Create and save a trusted key named "kmk" of length 32 bytes.
110
+
111
+Note: When using a TPM 2.0 with a persistent key with handle 0x81000001,
112
+append 'keyhandle=0x81000001' to statements between quotes, such as
113
+"new 32 keyhandle=0x81000001".
114
+
115
+::
86116
87117 $ keyctl add trusted kmk "new 32" @u
88118 440502848
....@@ -169,7 +199,11 @@
169199 24717c64 5972dcb82ab2dde83376d82b2e3c09ffc
170200
171201 Other uses for trusted and encrypted keys, such as for disk and file encryption
172
-are anticipated. In particular the new format 'ecryptfs' has been defined in
202
+are anticipated. In particular the new format 'ecryptfs' has been defined
173203 in order to use encrypted keys to mount an eCryptfs filesystem. More details
174204 about the usage can be found in the file
175205 ``Documentation/security/keys/ecryptfs.rst``.
206
+
207
+Another new format 'enc32' has been defined in order to support encrypted keys
208
+with payload size of 32 bytes. This will initially be used for nvdimm security
209
+but may expand to other usages that require 32 bytes payload.