Commit 5c23cb0
committed
security/tpm: detect and use all active PCR banks
All of the client has already been updated to permit use of multiple
banks, but at most one was ever enabled. TPM 2 log was also updated to
permit handling of multiple digests, but similarly only one was in use.
From now on, it's possible to configure more than one digest (only SHA1
and SHA256 are selected by default). This changes previous TSPI API of
`tpm_log_alg()` (single hash) to `tpm_log_alg_active(enum
vb2_hash_algorithm)` coupled with `enabled_tpm_algs` array (multiple
hashes).
The bulk of the code here is for dealing with the set of banks of TPM:
- querying it from the device to know what digests should be used
- synchronizing set of digests in the log with the actual set of active
banks
The latter is needed in case TPM is initialized in ramstage while
measurements are accumulated starting from the bootblock. An
alternative was to require initializing TPM in the bootblock, but
bootblock may not have enough space for the extra code required for
TPM, hence a different approach was taken: take all supported hashes
before TPM is initialized, trim unnecessary digests after the
initialization.
Change-Id: Ia326b22869c4983fc4e02e150461e7a9ff94dc4e
Upstream-Status: Pending
Signed-off-by: Sergii Dmytruk <[email protected]>1 parent be8a10d commit 5c23cb0
File tree
7 files changed
+297
-45
lines changed- configs
- src/security/tpm
- tspi
7 files changed
+297
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 111 | + | |
116 | 112 | | |
117 | 113 | | |
118 | | - | |
| 114 | + | |
| 115 | + | |
119 | 116 | | |
120 | | - | |
| 117 | + | |
| 118 | + | |
121 | 119 | | |
122 | | - | |
| 120 | + | |
123 | 121 | | |
124 | | - | |
| 122 | + | |
125 | 123 | | |
126 | | - | |
| 124 | + | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 54 | + | |
66 | 55 | | |
67 | | - | |
68 | | - | |
| 56 | + | |
| 57 | + | |
69 | 58 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 59 | + | |
76 | 60 | | |
77 | 61 | | |
78 | 62 | | |
| |||
179 | 163 | | |
180 | 164 | | |
181 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
182 | 175 | | |
183 | 176 | | |
184 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
183 | 190 | | |
184 | 191 | | |
185 | 192 | | |
| |||
0 commit comments