cryptsetup: move default choice of nvpcr for keyslots from generator into cryptsetup

Let's pick the default NvPCR name to use inside of cryptsetup itself, instead
of in the generator. I think this is the better choice, since it means
the default can also be used if the regular verittab generator is used
instead of the gpt-auto generator.
This commit is contained in:
Lennart Poettering
2026-02-17 22:00:13 +01:00
parent 450e0dce02
commit d84d17853e
3 changed files with 12 additions and 10 deletions
+5 -3
View File
@@ -557,12 +557,14 @@ static int parse_one_option(const char *option) {
} else if ((val = startswith(option, "tpm2-measure-keyslot-nvpcr="))) {
if (isempty(val)) {
r = isempty(val) ? false : parse_boolean(val);
if (r == 0) {
arg_tpm2_measure_keyslot_nvpcr = mfree(arg_tpm2_measure_keyslot_nvpcr);
return 0;
}
if (!tpm2_nvpcr_name_is_valid(val)) {
if (r > 0)
val = "cryptsetup";
else if (!tpm2_nvpcr_name_is_valid(val)) {
log_warning("Invalid NvPCR name, ignoring: %s", option);
return 0;
}