mirror of
https://github.com/systemd/systemd.git
synced 2025-09-19 01:44:42 +03:00
bootctl: Validate private key path
This commit is contained in:
@@ -960,6 +960,12 @@ int verb_install(int argc, char *argv[], void *userdata) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to load X.509 certificate from %s: %m", arg_certificate);
|
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(
|
r = openssl_load_private_key(
|
||||||
arg_private_key_source_type,
|
arg_private_key_source_type,
|
||||||
arg_private_key_source,
|
arg_private_key_source,
|
||||||
|
Reference in New Issue
Block a user