Fix wrong arg used (#408)

This commit is contained in:
Itxaka 2024-06-19 16:45:33 +02:00 committed by GitHub
parent 1477b07170
commit 2bc901ed2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,7 +150,7 @@ func LuksifyMeasurements(label string, publicKeyPcrs []string, pcrs []string, lo
fmt.Sprintf("--tpm2-pcrs=%s", strings.Join(pcrs, "+")),
"--tpm2-signature=/run/systemd/tpm2-pcr-signature.json",
"--tpm2-device-key=/run/systemd/tpm2-srk-public-key.tpm2b_public",
part}
device}
logger.Debug().Str("args", strings.Join(args, " ")).Msg("running command")
cmd := exec.Command("systemd-cryptenroll", args...)
cmd.Env = append(cmd.Env, fmt.Sprintf("PASSWORD=%s", pass), "SYSTEMD_LOG_LEVEL=debug") // cannot pass it via stdin
@ -166,6 +166,8 @@ func LuksifyMeasurements(label string, publicKeyPcrs []string, pcrs []string, lo
return err
}
logger.Debug().Str("output", stdOut.String()).Msg("debug from cryptenroll")
err = formatLuks(device, b.Name, mapper, label, pass, logger)
if err != nil {
logger.Err(err).Msg("format luks")