mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-06 03:10:07 +00:00
runtime-rs: remove snp_certs_path support
SNP certs were apparently obsoleted by AMD. Signed-off-by: Pavel Mores <pmores@redhat.com>
This commit is contained in:
@@ -829,10 +829,6 @@ pub struct SecurityInfo {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub sev_snp_guest: bool,
|
pub sev_snp_guest: bool,
|
||||||
|
|
||||||
/// Path to SNP certificates
|
|
||||||
#[serde(default)]
|
|
||||||
pub snp_certs_path: String,
|
|
||||||
|
|
||||||
/// Path to OCI hook binaries in the *guest rootfs*.
|
/// Path to OCI hook binaries in the *guest rootfs*.
|
||||||
///
|
///
|
||||||
/// This does not affect host-side hooks which must instead be added to the OCI spec passed to
|
/// This does not affect host-side hooks which must instead be added to the OCI spec passed to
|
||||||
|
@@ -21,7 +21,6 @@ pub struct SevSnpConfig {
|
|||||||
pub is_snp: bool,
|
pub is_snp: bool,
|
||||||
pub cbitpos: u32,
|
pub cbitpos: u32,
|
||||||
pub firmware: String,
|
pub firmware: String,
|
||||||
pub certs_path: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@@ -1785,7 +1785,6 @@ struct ObjectSevSnpGuest {
|
|||||||
kernel_hashes: bool,
|
kernel_hashes: bool,
|
||||||
|
|
||||||
is_snp: bool,
|
is_snp: bool,
|
||||||
certs_path: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ObjectSevSnpGuest {
|
impl ObjectSevSnpGuest {
|
||||||
@@ -1796,14 +1795,8 @@ impl ObjectSevSnpGuest {
|
|||||||
reduced_phys_bits: 1,
|
reduced_phys_bits: 1,
|
||||||
kernel_hashes: true,
|
kernel_hashes: true,
|
||||||
is_snp,
|
is_snp,
|
||||||
certs_path: "".to_owned(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_certs_path(&mut self, certs_path: &str) -> &mut Self {
|
|
||||||
self.certs_path = certs_path.to_owned();
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
@@ -1826,9 +1819,6 @@ impl ToQemuParams for ObjectSevSnpGuest {
|
|||||||
"kernel-hashes={}",
|
"kernel-hashes={}",
|
||||||
if self.kernel_hashes { "on" } else { "off" }
|
if self.kernel_hashes { "on" } else { "off" }
|
||||||
));
|
));
|
||||||
if !self.certs_path.is_empty() {
|
|
||||||
params.push(format!("certs-path={}", self.certs_path));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(vec!["-object".to_owned(), params.join(",")])
|
Ok(vec!["-object".to_owned(), params.join(",")])
|
||||||
}
|
}
|
||||||
@@ -2189,14 +2179,8 @@ impl<'a> QemuCmdLine<'a> {
|
|||||||
.set_nvdimm(false);
|
.set_nvdimm(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_sev_snp_protection_device(
|
pub fn add_sev_snp_protection_device(&mut self, cbitpos: u32, firmware: &str) {
|
||||||
&mut self,
|
let sev_snp_object = ObjectSevSnpGuest::new(true, cbitpos);
|
||||||
cbitpos: u32,
|
|
||||||
firmware: &str,
|
|
||||||
certs_path: &str,
|
|
||||||
) {
|
|
||||||
let mut sev_snp_object = ObjectSevSnpGuest::new(true, cbitpos);
|
|
||||||
sev_snp_object.set_certs_path(certs_path);
|
|
||||||
self.devices.push(Box::new(sev_snp_object));
|
self.devices.push(Box::new(sev_snp_object));
|
||||||
|
|
||||||
self.devices.push(Box::new(Bios::new(firmware.to_owned())));
|
self.devices.push(Box::new(Bios::new(firmware.to_owned())));
|
||||||
|
@@ -132,7 +132,6 @@ impl QemuInner {
|
|||||||
cmdline.add_sev_snp_protection_device(
|
cmdline.add_sev_snp_protection_device(
|
||||||
sev_snp_cfg.cbitpos,
|
sev_snp_cfg.cbitpos,
|
||||||
&sev_snp_cfg.firmware,
|
&sev_snp_cfg.firmware,
|
||||||
&sev_snp_cfg.certs_path,
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
cmdline.add_sev_protection_device(
|
cmdline.add_sev_protection_device(
|
||||||
|
@@ -343,7 +343,6 @@ impl VirtSandbox {
|
|||||||
is_snp: false,
|
is_snp: false,
|
||||||
cbitpos: details.cbitpos,
|
cbitpos: details.cbitpos,
|
||||||
firmware: hypervisor_config.boot_info.firmware.clone(),
|
firmware: hypervisor_config.boot_info.firmware.clone(),
|
||||||
certs_path: "".to_owned(),
|
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
GuestProtection::Snp(details) => {
|
GuestProtection::Snp(details) => {
|
||||||
@@ -359,17 +358,10 @@ impl VirtSandbox {
|
|||||||
info!(sl!(), "reverting to SEV even though SEV-SNP is available as requested by 'sev_snp_guest'");
|
info!(sl!(), "reverting to SEV even though SEV-SNP is available as requested by 'sev_snp_guest'");
|
||||||
}
|
}
|
||||||
|
|
||||||
let certs_path = if is_snp {
|
|
||||||
hypervisor_config.security_info.snp_certs_path.clone()
|
|
||||||
} else {
|
|
||||||
"".to_owned()
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(Some(ProtectionDeviceConfig::SevSnp(SevSnpConfig {
|
Ok(Some(ProtectionDeviceConfig::SevSnp(SevSnpConfig {
|
||||||
is_snp,
|
is_snp,
|
||||||
cbitpos: details.cbitpos,
|
cbitpos: details.cbitpos,
|
||||||
firmware: hypervisor_config.boot_info.firmware.clone(),
|
firmware: hypervisor_config.boot_info.firmware.clone(),
|
||||||
certs_path,
|
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
GuestProtection::Se => {
|
GuestProtection::Se => {
|
||||||
|
Reference in New Issue
Block a user