Skip to content

Commit

Permalink
attest: Hash negotiation params, write evidence
Browse files Browse the repository at this point in the history
Given the negotiation parameters from the proxy, SVSM can now hash the
parameters and embed them in the attestation evidence. It can also read
the negotiation key specified and create key accordingly.

As SEV-SNP is the only supported TEE architecture at the moment, there's
also a few changes required to serialize a SEV-SNP attestation report
into bytes.

Co-developed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
  • Loading branch information
tylerfanelli committed Jan 6, 2025
1 parent 874b86f commit b4a614a
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 44 deletions.
76 changes: 47 additions & 29 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ userinit = { path = "user/init" }
# crates.io
aes-gcm = { version = "0.10.3", default-features = false }
arbitrary = "1.3.0"
base64 = { version = "0.22.1", default-features = false, features = ["alloc"] }
bitfield-struct = "0.6.2"
bitflags = "2.4"
clap = { version = "4.4.14", default-features = false }
Expand All @@ -59,10 +60,12 @@ intrusive-collections = "0.9.6"
kbs-types = { version = "0.9.2", default-features = false, features = ["alloc"] }
libfuzzer-sys = "0.4"
log = "0.4.17"
p384 = { version = "0.13.0" }
p384 = { version = "0.13.0", default-features = false, features = ["alloc", "arithmetic", "ecdh", "jwk"] }
rand_chacha = { version = "0.3.1", default-features = false }
rdrand = { version = "0.8.3", default-features = false }
serde = { version = "1.0.215", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
sha2 = "0.10.8"
sha2 = { version = "0.10.8", default-features = false, features = ["force-soft"] }
uuid = "1.6.1"
# Add the derive feature by default because all crates use it.
zerocopy = { version = "0.8.2", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion igvmmeasure/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clap = { workspace = true, default-features = true, features = ["derive"] }
sha2.workspace = true
igvm.workspace = true
igvm_defs.workspace = true
p384.workspace = true
p384 = { version = "0.13.0" }
zerocopy.workspace = true
# igvm_defs still uses 0.7, so we need to import the zerocopy 0.7 traits to use them.
zerocopy07 = { package = "zerocopy", version = "0.7" }
Expand Down
9 changes: 8 additions & 1 deletion kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ elf.workspace = true
syscall.workspace = true

aes-gcm = { workspace = true, features = ["aes", "alloc"] }
base64 = { workspace = true, optional = true }
bitfield-struct.workspace = true
bitflags.workspace = true
gdbstub = { workspace = true, optional = true }
Expand All @@ -34,10 +35,14 @@ igvm_defs = { workspace = true, features = ["unstable"] }
intrusive-collections.workspace = true
kbs-types = { workspace = true, optional = true }
log = { workspace = true, features = ["max_level_info", "release_max_level_info"] }
p384 = { workspace = true, optional = true }
packit.workspace = true
rand_chacha = { workspace = true, optional = true }
rdrand = { workspace = true, optional = true }
libtcgtpm = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
sha2 = { workspace = true, optional = true }
zerocopy = { workspace = true, features = ["alloc", "derive"] }

builtin = { workspace = true, optional = true }
Expand All @@ -50,7 +55,9 @@ verify_external = { workspace = true, optional = true}
test.workspace = true

[features]
attest = ["dep:kbs-types", "dep:libaproxy", "dep:serde", "dep:serde_json"]
attest = ["dep:base64", "dep:kbs-types", "dep:libaproxy", "dep:p384",
"dep:rand_chacha", "dep:rdrand", "dep:serde", "dep:serde_json",
"dep:sha2"]
default = []
enable-gdb = ["dep:gdbstub", "dep:gdbstub_arch"]
vtpm = ["dep:libtcgtpm"]
Expand Down
Loading

0 comments on commit b4a614a

Please sign in to comment.