1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

bootctl: Validate private key path

This commit is contained in:
Daan De Meyer 2024-11-06 18:05:54 +01:00
parent 5cca978dae
commit 4047b99c00

View File

@ -960,6 +960,12 @@ int verb_install(int argc, char *argv[], void *userdata) {
if (r < 0)
return log_error_errno(r, "Failed to load X.509 certificate from %s: %m", arg_certificate);
if (arg_private_key_source_type == OPENSSL_KEY_SOURCE_FILE) {
r = parse_path_argument(arg_private_key, /* suppress_root= */ false, &arg_private_key);
if (r < 0)
return log_error_errno(r, "Failed to parse private key path %s: %m", arg_private_key);
}
r = openssl_load_private_key(
arg_private_key_source_type,
arg_private_key_source,