]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix: sd-measure `dtbauto` and `hwdids` arg parsing
authorNoel Georgi <git@frezbo.dev>
Fri, 27 Dec 2024 11:50:41 +0000 (17:20 +0530)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Jan 2025 11:23:24 +0000 (12:23 +0100)
Commit 630cf4e7dafb062588a2d9e09cf470806f00bb9e introduced `.dtbauto`,
but since it's before `.hwdids` commit 4c0b7f425024923f37c7e571fa563f602e8bf369
made `dtbauto` the last argument whereas it should have been `hwdids`.

Otherwise the code was measuring the content of hwdids into dtbauto
section and vice-versa.

Found this while adding the new `dtbauto` and `.hwdids` fields in the go
implementation of `sd-measure` at
https://github.com/siderolabs/talos/blob/main/internal/pkg/secureboot/measure/measure.go.

Signed-off-by: Noel Georgi <git@frezbo.dev>
src/measure/measure.c

index 18461797b7e991c55897ea3347bc52dcf896e02e..fceca7c4a113632985680015c511fde8c55084f9 100644 (file)
@@ -158,9 +158,9 @@ static int parse_argv(int argc, char *argv[]) {
                 _ARG_PCRSIG, /* the .pcrsig section is not input for signing, hence not actually an argument here */
                 ARG_PCRPKEY,
                 ARG_PROFILE,
-                ARG_HWIDS,
+                ARG_DTBAUTO,
                 _ARG_SECTION_LAST,
-                ARG_DTBAUTO = _ARG_SECTION_LAST,
+                ARG_HWIDS = _ARG_SECTION_LAST,
                 ARG_BANK,
                 ARG_PRIVATE_KEY,
                 ARG_PRIVATE_KEY_SOURCE,