veritysetup: keep parsing after ignored NvPCR options
tpm2-measure-nvpcr=no and invalid NvPCR names only affect the current
comma-separated option. They returned from parse_options(), so later
options were silently skipped.
Repro:
build/systemd-veritysetup attach testvol /dev/null /no/such \
0000000000000000000000000000000000000000000000000000000000000000 \
tpm2-measure-nvpcr=no,root-hash-signature=relative
Before: root-hash-signature=relative was skipped, and execution continued
to the missing block-device error.
After: root-hash-signature=relative is parsed and rejected. Invalid NvPCR
names take the same continue path.
Follow-up for: 85d7fb2247
This commit is contained in:
committed by
Yu Watanabe
parent
47536f5aac
commit
99c6f01321
@@ -300,13 +300,13 @@ static int parse_options(const char *options) {
|
||||
r = isempty(val) ? 0 : parse_boolean(val);
|
||||
if (r == 0) {
|
||||
arg_tpm2_measure_nvpcr = mfree(arg_tpm2_measure_nvpcr);
|
||||
return 0;
|
||||
continue;
|
||||
}
|
||||
if (r > 0)
|
||||
val = "verity";
|
||||
else if (!tpm2_nvpcr_name_is_valid(val)) {
|
||||
log_warning("Invalid NvPCR name, ignoring: %s", word);
|
||||
return 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (free_and_strdup(&arg_tpm2_measure_nvpcr, val) < 0)
|
||||
|
||||
Reference in New Issue
Block a user