33 Commits

Author SHA1 Message Date
Michael Vogt
c3ac482011 Merge pull request #10815 from mvo5/ice/has-device-unlock
fde: add HasDeviceUnlock() helper
2021-09-23 09:53:41 +02:00
Michael Vogt
73e43db495 fde: fix typos
Co-authored-by: Pawel Stolowski <stolowski@gmail.com>
2021-09-23 09:21:24 +02:00
Michael Vogt
d2e7e6b19f fde: add HasDeviceUnlock() helper
This method is used to determine if the fde-device-unlock helper is
available.
2021-09-21 09:41:41 +02:00
Alberto Mardegan
2efa777f8c kernel/fde: mock systemd-run in unit test
This test has been occasionally failing under spread:

```
FAIL: fde_test.go:492: fdeSuite.TestRevealErr

using shellcheck: ""
fde_test.go:508:
    c.Assert(err, ErrorMatches, `(?s)cannot run fde-reveal-key "reveal":
    -----
    failed
    service result: exit-code
    -----`)
... error string = "cannot run fde-reveal-key \"reveal\": exit status 1"
... regex string = "" +
...     "(?s)cannot run fde-reveal-key \"reveal\": \n" +
...     "-----\n" +
...     "failed\n" +
...     "service result: exit-code\n" +
...     "-----"

OOPS: 9 passed, 5 skipped, 1 FAILED
```

While we couldn't yet reproduce it locally and find what exactly
triggers it, it makes sense to exclude systemd-run from the picture by
mocking it. We now simply check that it was invoked with the right
parameters and that its output is captured correctly.
2021-09-20 09:18:42 +03:00
Michael Vogt
8229fcb8b9 kernel: fix typo/improve comment (thanks to Pawel) 2021-04-27 17:49:40 +02:00
Samuele Pedroni
134203ec32 many: drop some now spurious [:] slicing 2021-04-25 13:56:57 +02:00
Samuele Pedroni
c671a47246 kernel/fde,secboot: small cleanups 2021-04-25 13:47:39 +02:00
Samuele Pedroni
ff83cead1e kernel/fde: typo in filename reveal_key.go 2021-04-25 13:25:11 +02:00
Samuele Pedroni
ed9bb579d8 Merge remote-tracking branch 'upstream/master' into fde-hooks-v2.4
Adjusted code to the refactoring using kernel/fde.
Split responsibility to deal with v1/v2 hooks with kernel/fde.
Now dealing with aux key will come later.
2021-04-24 19:33:52 +02:00
Samuele Pedroni
e4c4589ca4 kernel/fde,secboot: move infra to run fde-reveal-key to kernel/fde
deprecate KeyName in fde-reveal-key "reveal"
2021-04-23 20:06:40 +02:00
Samuele Pedroni
9b2c3e0fbd kernel/fde: drop unused SetupRequest.Models 2021-04-23 20:06:40 +02:00
Samuele Pedroni
0a2d2856ca kernel/fde: fix v1 marker handle 2021-04-23 20:06:40 +02:00
Samuele Pedroni
e509090cac many: disentagle kernel/fde from secboot, reorg files in the latter
this stops kernel/fde from importing secboot, which also means that
secboot can now kernel/fde naturally

rename/reorg/split secboot_tpm.go into hooks specific bits
and general secboot-using secboot_sb.go
2021-04-23 16:09:58 +02:00
Michael Vogt
cf3ce57662 boot,fde: cleanup after master merge 2021-04-23 11:06:51 +02:00
Michael Vogt
8ed6aa2a18 fix tests, remove left-over code 2021-04-23 07:54:45 +02:00
Michael Vogt
ff3fbc4112 fix tests 2021-04-22 22:27:38 +02:00
Michael Vogt
511cd88dd0 update tests 2021-04-22 19:04:05 +02:00
Michael Vogt
cec0146d60 Merge branch 'fde-hooks-split-from-10149-1' into fde-hooks-v2.4 2021-04-22 18:39:01 +02:00
Samuele Pedroni
887e0844b0 many: move FDE details to kernel/fde (was devicestate/fde)
this moves many definition and implementations details of FDE
kernel hooks to kernel/fde out of devicemgr.go and boot
2021-04-22 14:43:55 +02:00
Maciej Borzecki
90d81284de kernel: export valid asset name regex
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-10 14:03:08 +01:00
Maciej Borzecki
204e43d75a kernel: match with gadget code and allow dashes in asset name, update validation
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-10 10:46:23 +01:00
Maciej Borzecki
51a1796cbe kernel: validate the sanity of asset.content
Add code for validating the sanity of the content entries of a given asset.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-10 10:46:22 +01:00
Michael Vogt
fb39f2d373 kernel: update doc string (thanks to Maciej) 2020-09-02 08:54:28 +02:00
Michael Vogt
0996eec820 kernel: remove "edition" from kernel.yaml and add "update"
This commit changes the supported yaml for the kernel snap. For
the raspberry pi DTB use case the kernel assets are tightly
coupled with the kernel. So the edition would have to be bumped
everytime the kernel is build. So the edition does not make much
sense in this context. Hence a new "update" field that is boolean
for now but we may expand it later into a map. This map would
allow to specify what content items should get updated and which
should not get updated.
2020-08-28 07:57:58 +02:00
Michael Vogt
8876dcba1c kernel: tweak error message in validateAssetsContent() (thanks to Maciej) 2020-08-20 17:47:07 +02:00