mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust/pvimg: Add support for '--image-key'
Add support for '--image-key'. This new option can be used to select the
components encryption key (e.g. kernel, initrd, and kernel command
line). Previously, this was only available as an experimental
option ('--x-comp-key').
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
a24be25779
commit
29ff9408e0
@@ -8,7 +8,7 @@ use anyhow::Result;
|
||||
use log::info;
|
||||
use pv::{misc::read_file, request::Confidential};
|
||||
|
||||
use crate::cli::{CreateBootImageExperimentalArgs, UserKeys};
|
||||
use crate::cli::UserKeys;
|
||||
|
||||
#[macro_export]
|
||||
/// Makes it easier to
|
||||
@@ -23,12 +23,9 @@ pub struct UserProvidedKeys {
|
||||
}
|
||||
|
||||
/// Reads all user provided keys.
|
||||
pub fn read_user_provided_keys(
|
||||
keys: &UserKeys,
|
||||
experimental_args: &CreateBootImageExperimentalArgs,
|
||||
) -> Result<UserProvidedKeys> {
|
||||
pub fn read_user_provided_keys(keys: &UserKeys) -> Result<UserProvidedKeys> {
|
||||
let components_key = {
|
||||
match &experimental_args.x_comp_key {
|
||||
match &keys.image_key {
|
||||
Some(key_path) => {
|
||||
info!(
|
||||
"Use file '{}' as the image components protection key",
|
||||
|
||||
@@ -126,7 +126,7 @@ pub fn create(opt: &CreateBootImageArgs) -> Result<OwnExitCode> {
|
||||
let verified_host_keys = opt
|
||||
.certificate_args
|
||||
.get_verified_hkds("Secure Execution image")?;
|
||||
let user_provided_keys = read_user_provided_keys(&opt.keys, &opt.experimental_args)?;
|
||||
let user_provided_keys = read_user_provided_keys(&opt.keys)?;
|
||||
let (plaintext_flags, secret_flags) = parse_flags(opt)?;
|
||||
|
||||
if plaintext_flags.is_set(PcfV1::NoComponentEncryption) {
|
||||
|
||||
Reference in New Issue
Block a user