Skip to content
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
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,27 @@ clippy:
check: fmt-check clippy

.PHONY: test
test:
@echo "Building and running unit tests..."
test: enclave-test untrusted-test
@echo "All tests completed successfully!"

.PHONY: enclave-test
enclave-test:
@echo "Building and running enclave unit tests..."
@cd unit-test && make clean all
@cd unit-test/bin && ./app

.PHONY: untrusted-test
untrusted-test:
@echo "Running untrusted crate tests..."
@echo "Testing sgx-types..."
@cd sgx-types && cargo test --features urts
@echo "Testing sgx-urts..."
@cd sgx-urts && cargo test --features simulate_utils
@echo "Testing sgx-build..."
@cd sgx-build && cargo test
@echo "Testing cargo-sgx..."
@cd cargo-sgx && cargo test

.PHONY: toml-fmt
toml-fmt:
@echo "Formatting TOML files..."
Expand Down
10 changes: 2 additions & 8 deletions samples/hello-rust/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,15 @@ extern "C" {
fn init_enclave() -> SgxResult<SgxEnclave> {
let mut launch_token: sgx_launch_token_t = [0; 1024];
let mut launch_token_updated: i32 = 0;
let debug = match env::var("SGX_DEBUG") {
Ok(val) => match val.as_str() {
"1" => 1,
_ => 0,
},
Err(_) => 0,
};
let debug = env::var("SGX_DEBUG").unwrap_or_default() == "1";
let mut misc_attr = sgx_misc_attribute_t {
secs_attr: sgx_attributes_t { flags: 0, xfrm: 0 },
misc_select: 0,
};
// call sgx_create_enclave to initialize an enclave instance
SgxEnclave::create(
ENCLAVE_FILE,
debug,
debug.into(),
&mut launch_token,
&mut launch_token_updated,
&mut misc_attr,
Expand Down
14 changes: 7 additions & 7 deletions sgx-ert/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sgx-ert"
version = "1.2.0"
authors = ["The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-ert"
version = "1.2.0"
authors = ["The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_ert"
Expand Down
14 changes: 7 additions & 7 deletions sgx-tcrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sgx-tcrypto"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-tcrypto"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_tcrypto"
Expand Down
14 changes: 7 additions & 7 deletions sgx-trts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sgx-trts"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-trts"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_trts"
Expand Down
14 changes: 7 additions & 7 deletions sgx-tse/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sgx-tse"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-tse"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_tse"
Expand Down
14 changes: 7 additions & 7 deletions sgx-tseal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sgx-tseal"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-tseal"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_tseal"
Expand Down
14 changes: 7 additions & 7 deletions sgx-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
name = "sgx-types"
version = "1.2.0"
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
name = "sgx-types"
version = "1.2.0"
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_types"
Expand Down
26 changes: 15 additions & 11 deletions sgx-urts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
[package]
name = "sgx-urts"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"
name = "sgx-urts"
version = "1.2.0"
authors = ["The Teaclave Authors", "The SGX-SDK-RS Authors"]
repository = "https://github.com/datachainlab/sgx-sdk-rs"
license = "Apache-2.0"
description = "Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language."
edition = "2021"

[lib]
name = "sgx_urts"
crate-type = ["rlib"]

[features]
default = []
global_init = ["global_exit"]
global_exit = ["global_init"]
default = []
global_init = ["global_exit"]
global_exit = ["global_init"]
simulate_utils = ["tracing", "object", "iced-x86"]

[dependencies]
sgx-types = { path = "../sgx-types", default-features = false, features = ["urts"] }
libc = "0.2"
tracing = { version = "0.1", optional = true }
libc = { version = "0.2" }
object = { version = "0.37", optional = true }
iced-x86 = { version = "1.21", optional = true }
2 changes: 2 additions & 0 deletions sgx-urts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub mod net;
pub mod pipe;
pub mod process;
pub mod signal;
#[cfg(feature = "simulate_utils")]
pub mod simulate;
pub mod socket;
pub mod sys;
pub mod thread;
Expand Down
Loading