Commit 1513887
committed
fix: clevis-luks-list didn't show all configured bindings
Previously, the value of sss was overwritten every time, so only the last entry for sss pins was displayed. Fix this by saving them all and instead of manually processing the sss pin, reuse clevis_luks_join_sss_cfg as it is used in the other functions
Fixes #505.
The test adjustments are needed since previously the command always
listed an object for sss instead of a list. This is not the way
it works for other pins, for example tang does always give you a list.
So if you apply this patch:
```diff
diff --git a/src/luks/tests/list-sss-tang-luks2 b/src/luks/tests/list-sss-tang-luks2
index 5f05696..a9dad34 100755
--- a/src/luks/tests/list-sss-tang-luks2
+++ b/src/luks/tests/list-sss-tang-luks2
@@ -36,15 +36,9 @@ PIN="sss"
PINS="sss tang"
CFG=$(printf '
{
- "t": 2,
+ "t": 1,
"pins": {
- "tang": [
- {"url":"ADDR1","adv":"%s"},
- {"url":"ADDR2","adv":"%s"},
- {"url":"ADDR3","adv":"%s"},
- {"url":"ADDR4","adv":"%s"},
- {"url":"ADDR5","adv":"%s"}
- ]
+ "tang": {"url":"ADDR1","adv":"%s"}
}
}
' "${ADV}" "${ADV}" "${ADV}" "${ADV}" "${ADV}")
```
to only have one tang config and not have it in a list, the test
`list-sss-tang-luks2` will also fail with non-matching configs even
outside of this branch. So while both formats are equivalent, we can't
reasonably determine which format was used on encryption and we should
use one format everywhere. It makes sense to adapt the more general
format that is already used for tang and tpm.1 parent bcac529 commit 1513887
3 files changed
Lines changed: 37 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | | - | |
52 | | - | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | | - | |
52 | | - | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
0 commit comments