1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

4 Commits

Author SHA1 Message Date
Arnaud Patard
0bcea67612 src/pcrlock/pcrlock.c: Handle empty pcrlock.d directories
Running the following commands:

  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock predict --pcr=1+2+3+4+5+16

Will result in:

...
Floating point exception

Running the following commands:
  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock make-policy --pcr=1+2+3+4+5+16

Will result to this (partial) log:
...
Predicted future PCRs in 133us.
[]
...
Written policy digest 0000000000000000000000000000000000000000000000000000000000000000 to NV index 0x1921da6
...

So, add missing checks to handle gracefully cases where there's no variant
inside the component.

Signed-off-by: Arnaud Patard <arnaud.patard@collabora.com>
(cherry picked from commit e7a93e75219b22424bab95fe45982f5eef21d581)
(cherry picked from commit 74f830e048beab8b48c4a25dcb8666a861981aec)
2024-08-16 11:07:11 +02:00
Lennart Poettering
5e5d4d36b4 test: make sure pcrlock tests run headless
We want the tests to fail rather than hang if unlock via tpm doesn't
work.
2023-11-21 23:43:23 +00:00
Luca Boccassi
42c1df5e2d test: add simple test case for invalid userspace log records 2023-11-20 14:27:38 +01:00
Lennart Poettering
3e6a25a6f3 test: add pcrlock integration test
(Contains various test additions added by @mrc0mmand)
2023-11-03 11:25:14 +01:00