Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kbs-types dependency to 0.7.0 #210

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LIBRARY_HEADER = include/libkrun.h

ABI_VERSION=1
FULL_VERSION=1.9.3
FULL_VERSION=1.9.4

INIT_SRC = init/init.c
KBS_INIT_SRC = init/tee/kbs/kbs.h \
Expand Down
2 changes: 1 addition & 1 deletion src/libkrun/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libkrun"
version = "1.9.3"
version = "1.9.4"
authors = ["Sergio Lopez <slp@redhat.com>"]
edition = "2021"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions src/vmm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ polly = { path = "../polly" }

# Dependencies for amd-sev
codicon = { version = "3.0.0", optional = true }
kbs-types = { version = "0.5.1, < 0.5.3", features = ["tee-sev", "tee-snp"], optional = true }
kbs-types = { version = "0.7.0", features = ["tee-sev", "tee-snp"], optional = true }
procfs = { version = "0.12", optional = true }
serde = { version = "1.0.125", optional = true }
serde_json = { version = "1.0.64", optional = true }
sev = { version = "1.2.0", features = ["openssl"], optional = true }
sev = { version = "3.2.0", features = ["openssl"], optional = true }
curl = { version = "0.4", optional = true }
nix = "0.24.1"

Expand Down
9 changes: 4 additions & 5 deletions src/vmm/src/linux/tee/amdsev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl AmdSev {
let request = Request {
version: "0.0.0".to_string(),
tee: tee_config.tee,
extra_params: serde_json::json!(sev_request).to_string(),
extra_params: serde_json::json!(sev_request),
};

let response = curl_agent
Expand All @@ -302,7 +302,7 @@ impl AmdSev {

let challenge: Challenge =
serde_json::from_slice(&response).map_err(Error::ParseSessionResponse)?;
let sev_challenge: SevChallenge = serde_json::from_str(&challenge.extra_params)
let sev_challenge: SevChallenge = serde_json::from_value(challenge.extra_params)
.map_err(Error::ParseSessionResponse)?;

if sev_challenge
Expand Down Expand Up @@ -408,16 +408,15 @@ impl AmdSev {
let measurement = launcher.measurement();

if !self.tee_config.attestation_url.is_empty() {
let tee_pubkey = TeePubKey {
kty: "".to_string(),
let tee_pubkey = TeePubKey::RSA {
alg: "".to_string(),
k_mod: "".to_string(),
k_exp: "".to_string(),
};

let attestation = Attestation {
tee_pubkey,
tee_evidence: serde_json::json!(measurement).to_string(),
tee_evidence: serde_json::json!(measurement),
};

let mut curl_agent = self.curl_agent.lock().unwrap();
Expand Down
12 changes: 2 additions & 10 deletions src/vmm/src/linux/tee/amdsnp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
use crate::vstate::MeasuredRegion;
use arch::x86_64::layout::*;

use sev::firmware::host::Firmware;
use sev::firmware::{guest::GuestPolicy, host::Firmware};
use sev::launch::snp::*;

use kvm_bindings::{kvm_enc_region, CpuId, KVM_CPUID_FLAG_SIGNIFCANT_INDEX};
Expand Down Expand Up @@ -101,15 +101,7 @@ impl AmdSnp {
.map_err(|_| Error::MemoryEncryptRegion)?;
}

let start = Start::new(
None,
Policy {
flags: PolicyFlags::SMT,
..Default::default()
},
false,
[0; 16],
);
let start = Start::new(None, GuestPolicy(0), false, [0; 16]);

let launcher = launcher.start(start).map_err(Error::LaunchStart)?;

Expand Down
Loading