diff --git a/execution-engine/Cargo.toml b/execution-engine/Cargo.toml index fcc594bb5d..b7b69986eb 100644 --- a/execution-engine/Cargo.toml +++ b/execution-engine/Cargo.toml @@ -29,7 +29,7 @@ pinecone = "0.2" name = "execution_engine" path = "./src/lib.rs" -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [patch.crates-io] diff --git a/platform-services/Cargo.toml b/platform-services/Cargo.toml index 621162bf0b..3bc2b70c27 100644 --- a/platform-services/Cargo.toml +++ b/platform-services/Cargo.toml @@ -22,10 +22,10 @@ getrandom = { version = "0.1.14", optional = true } nsm_lib = { git = "https://github.com/aws/aws-nitro-enclaves-nsm-api.git/", branch = "main", package="nsm-lib", optional = true } nsm_io = { git = "https://github.com/aws/aws-nitro-enclaves-nsm-api.git/", branch = "main", package = "nsm-io", optional = true } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_trts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } -[target.'cfg(target_arch = "aarch64")'.dependencies] +[target.'cfg(target_os = "optee")'.dependencies] optee-utee = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true } [profile.release] diff --git a/proxy-attestation-server/Cargo.toml b/proxy-attestation-server/Cargo.toml index dfc650048e..4ef779d865 100644 --- a/proxy-attestation-server/Cargo.toml +++ b/proxy-attestation-server/Cargo.toml @@ -54,7 +54,7 @@ serde_cbor = {version = "0.11", optional = true } nitro-enclave-token = { git = "https://github.com/veracruz-project/nitro-enclave-token.git", branch = "main", optional = true } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/runtime-manager/Cargo.toml b/runtime-manager/Cargo.toml index 43e30a5833..eb9e31dd72 100644 --- a/runtime-manager/Cargo.toml +++ b/runtime-manager/Cargo.toml @@ -44,12 +44,12 @@ nsm_io = { git = "https://github.com/aws/aws-nitro-enclaves-nsm-api.git/", bran uuid = { version = "0.7", features = ["v4"] } target_build_utils = "0.1" -[target.'cfg(target_arch = "aarch64")'.dependencies] +[target.'cfg(target_os = "optee")'.dependencies] libc = { git = "https://github.com/veracruz-project/libc.git", branch = "veracruz", optional = true } optee-utee-sys = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true } optee-utee = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_tcrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/runtime-manager/build.rs b/runtime-manager/build.rs index 22fd922080..1c748ff32b 100644 --- a/runtime-manager/build.rs +++ b/runtime-manager/build.rs @@ -18,7 +18,7 @@ use uuid::Uuid; fn main() -> std::io::Result<()> { let target = target_build_utils::TargetInfo::new().expect("could not get target info"); - if target.target_arch() == "aarch64" { + if target.target_os() == "optee" { let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); let runtime_manager_uuid: &str = &std::fs::read_to_string("../runtime-manager-uuid.txt").unwrap(); diff --git a/session-manager/Cargo.toml b/session-manager/Cargo.toml index ef9495487d..4028e5501e 100644 --- a/session-manager/Cargo.toml +++ b/session-manager/Cargo.toml @@ -19,7 +19,7 @@ webpki = { git = "https://github.com/veracruz-project/webpki.git", branch = "ver webpki-roots = { git = "https://github.com/veracruz-project/webpki-roots.git" , branch = "veracruz"} err-derive = "0.2" -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/sgx-root-enclave/Cargo.toml b/sgx-root-enclave/Cargo.toml index 4dbd79a345..b3d5e0f50c 100644 --- a/sgx-root-enclave/Cargo.toml +++ b/sgx-root-enclave/Cargo.toml @@ -18,7 +18,7 @@ ring = { git = "https://github.com/veracruz-project/ring.git", version = "=0.16. veracruz-utils = { path = "../veracruz-utils", features = ["sgx"] } psa-attestation = { path = "../psa-attestation", features = ["sgx"] } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" } sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" } sgx_tdh = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" } diff --git a/transport-protocol/Cargo.toml b/transport-protocol/Cargo.toml index 2ee88e8493..1ec85c5bde 100644 --- a/transport-protocol/Cargo.toml +++ b/transport-protocol/Cargo.toml @@ -18,7 +18,7 @@ err-derive = "0.2" [build-dependencies] protoc-rust = { git = "https://github.com/veracruz-project/rust-protobuf.git", branch = "veracruz" } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/veracruz-client/Cargo.toml b/veracruz-client/Cargo.toml index 1ae5c74a72..7baa61f665 100644 --- a/veracruz-client/Cargo.toml +++ b/veracruz-client/Cargo.toml @@ -35,7 +35,7 @@ err-derive = "0.2" mockall = { version = "0.5.0", optional = true } mockito = { version = "0.23.1", optional = true } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/veracruz-server-test/Cargo.toml b/veracruz-server-test/Cargo.toml index fc17a2539c..5c59daba32 100644 --- a/veracruz-server-test/Cargo.toml +++ b/veracruz-server-test/Cargo.toml @@ -47,7 +47,7 @@ lazy_static = "1.4" regex = "1.4" local_ipaddress = "0.1.3" -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/veracruz-server/Cargo.toml b/veracruz-server/Cargo.toml index 75d2c9148b..34381d1065 100644 --- a/veracruz-server/Cargo.toml +++ b/veracruz-server/Cargo.toml @@ -38,13 +38,13 @@ byteorder = { version = "1.3.2", optional = true } nix = { version = "0.15", optional = true } ssh2 = {version = "0.8.3", optional = true } -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } runtime-manager-bind = { path = "../runtime-manager-bind", optional = true } sgx-root-enclave-bind = { path = "../sgx-root-enclave-bind", optional = true } -[target.'cfg(target_arch = "aarch64")'.dependencies] +[target.'cfg(target_os = "optee")'.dependencies] optee-teec = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true } # for the error handling uuid = { version = "0.7", optional = true } diff --git a/veracruz-server/build.rs b/veracruz-server/build.rs index 052e840f62..0996609227 100644 --- a/veracruz-server/build.rs +++ b/veracruz-server/build.rs @@ -28,7 +28,7 @@ fn main() { "SW" => println!("cargo:rustc-link-lib=dylib=sgx_urts_sim"), "HW" => { let target = target_build_utils::TargetInfo::new().unwrap(); - if target.target_arch() == "x86_64" { + if target.target_env() == "sgx" { println!("cargo:rustc-link-lib=dylib=sgx_urts"); println!("cargo:rustc-link-lib=dylib=sgx_tkey_exchange"); println!("cargo:rustc-link-lib=dylib=sgx_uae_service"); diff --git a/veracruz-test/Cargo.toml b/veracruz-test/Cargo.toml index 8f95dfde5b..ac84cb4fe4 100644 --- a/veracruz-test/Cargo.toml +++ b/veracruz-test/Cargo.toml @@ -31,7 +31,7 @@ log = "=0.4.13" lazy_static = "1.4" err-derive = "0.2" -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(target_env = "sgx")'.dependencies] sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_alloc = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }