Skip to content

Commit

Permalink
rust-mbedtls: Make all the changes for IceCap more explicit.
Browse files Browse the repository at this point in the history
Veracruz code must now select the correct set of features
for mbedtls, including "icecap" where appropriate.
  • Loading branch information
egrimley-arm committed Jun 15, 2023
1 parent 63daf07 commit 94bbbf7
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion execution-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "0.3.0"
[features]
default = []
icecap = [
"mbedtls/icecap",
"platform-services/icecap",
"policy-utils/icecap",
]
Expand All @@ -34,7 +35,7 @@ cfg-if = "1"
ctor = "=0.1.16"
err-derive = "0.2"
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
nix = { version = "0.20.2", optional = true }
num = { version = "0.4", default-features = false }
num-derive = { version = "0.3", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion policy-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.3.0"

[features]
icecap = [
"mbedtls/icecap",
"veracruz-utils/icecap",
]
nitro = [
Expand All @@ -26,7 +27,7 @@ err-derive = { version = "0.2", default-features = false }
hex = { version = "0.4.2" }
lalrpop-util = { version = "0.19.8", features = ["lexer"] }
lexical-core = { version = "0.8.2", default-features = false }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
regex = "1"
serde = { version = "1.0.115", features = ["derive"] }
serde_json = { version = "1.0", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions psa-attestation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = ["rlib"]

[features]
# build.rs depends on features
icecap = []
icecap = ["mbedtls-sys-auto/icecap"]
linux = []
nitro = [
"mbedtls-sys-auto/monitor_getrandom",
Expand All @@ -21,8 +21,8 @@ nitro = [
[dependencies]
libc = "0.2.124"
# We are not really using mbedtls-sys-auto but we are using the C
# libraries libmbedcrypto.a and libshim.a that mbedtls-sys-auto builds.
mbedtls-sys-auto = { path = "../third-party/rust-mbedtls/mbedtls-sys" }
# library libmbedcrypto.a that mbedtls-sys-auto builds.
mbedtls-sys-auto = { path = "../third-party/rust-mbedtls/mbedtls-sys", default-features = false }

[build-dependencies]
bindgen = "0.59.2"
Expand Down
2 changes: 1 addition & 1 deletion runtime-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ icecap = [
"libc",
"libm",
"policy-utils/icecap",
"psa-attestation",
"psa-attestation/icecap",
"serde",
"session-manager/icecap",
"transport-protocol/icecap",
Expand Down
3 changes: 2 additions & 1 deletion session-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.3.0"

[features]
icecap = [
"mbedtls/icecap",
"policy-utils/icecap",
"veracruz-utils/icecap",
]
Expand All @@ -23,7 +24,7 @@ std = [
[dependencies]
anyhow = "1"
err-derive = "0.2"
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
platform-services = { path = "../platform-services" }
policy-utils = { path = "../policy-utils" }
veracruz-utils = { path = "../veracruz-utils", optional = true }
3 changes: 2 additions & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ path = "./src/lib.rs"
# cannot connect)
debug = ["veracruz-server/debug"]
icecap = [
"mbedtls/icecap",
"policy-utils/icecap",
"veracruz-server/icecap",
"veracruz-utils/icecap",
Expand All @@ -42,7 +43,7 @@ env_logger = "0.9.0"
hex = "0.4.2"
lazy_static = "1.4.0"
log = "0.4.13"
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
nix = "0.25.0"
postcard = "0.7.2"
policy-utils = { path = "../policy-utils", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion tests/tlstest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "2018"
version = "0.3.0"

[dependencies]
mbedtls = { path = "../../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
2 changes: 1 addition & 1 deletion veracruz-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env_logger = { version = "0.9.0", optional = true }
err-derive = "0.2"
hex = "0.4.2"
log = "0.4.13"
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
policy-utils = { path = "../policy-utils", features = ["std"] }
rand = "0.8.3"
# The cargo patch mechanism does NOT work when we add function into a macro_rules!
Expand Down
3 changes: 2 additions & 1 deletion veracruz-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.3.0"

[features]
icecap = [
"mbedtls/icecap",
"platform-services/icecap",
"serde/derive",
]
Expand All @@ -33,7 +34,7 @@ anyhow = "1"
bincode = { version = "1.2.1", default-features = false, optional = true }
chrono = { version = "0.4.19", default-features = false, features = ["clock", "std"], optional = true }
err-derive = "0.2"
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls" }
mbedtls = { path = "../third-party/rust-mbedtls/mbedtls", default-features = false, features = ["std", "aesni", "padlock", "tls13"] }
platform-services = { path = "../platform-services" }
# The cargo patch mechanism does NOT work when we add function into a macro_rules!
serde = { version = "1.0.115", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion workspaces/icecap-runtime/src/icecap-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ icecap-lkvm = []
icecap-qemu = []

[dependencies]
runtime-manager = { path = "../../crates/runtime-manager" }
runtime-manager = { path = "../../crates/runtime-manager", features = ["icecap"] }

0 comments on commit 94bbbf7

Please sign in to comment.