forked from tokio-rs/tokio
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from fortanix/raoul/tokio-1.36.0-sgx
SGX port tokio 1.36.0
- Loading branch information
Showing
75 changed files
with
406 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash -ex | ||
repo_root=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | ||
cd ${repo_root} | ||
|
||
source ${repo_root}/ct_env.sh | ||
|
||
cargo test | ||
|
||
pushd tokio | ||
cargo test --target x86_64-fortanix-unknown-sgx --features "full-sgx" | ||
popd | ||
|
||
pushd tokio-macros | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd | ||
|
||
pushd tokio-stream | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd | ||
|
||
pushd stress-test | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -ex | ||
repo_root=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | ||
cd ${repo_root} | ||
|
||
# Unfortunately, the `ftxsgx-runner-cargo` application doesn't enable us to point to a runner within the same workspace. We use a hack here by pointing to `enclave-runner` and making sure such an executable exists when running CI | ||
pushd enclave-runner | ||
cargo build | ||
popd | ||
|
||
export PATH=${repo_root}/target/debug/:${PATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "enclave-runner" | ||
version = "0.1.0" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
aesm-client = { version = "0.5", features = ["sgxs"] } | ||
clap = "4.4" | ||
enclave-runner = "0.5" | ||
sgxs-loaders = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use aesm_client::AesmClient; | ||
use clap::{Command, Arg, ArgAction}; | ||
use enclave_runner::EnclaveBuilder; | ||
|
||
#[cfg(windows)] | ||
use sgxs_loaders::enclaveapi::Sgx as IsgxDevice; | ||
#[cfg(unix)] | ||
use sgxs_loaders::isgx::Device as IsgxDevice; | ||
|
||
fn main() { | ||
let args = Command::new("runner") | ||
.arg(Arg::new("file").required(true)) | ||
.arg( | ||
Arg::new("enclave-args") | ||
.help( | ||
"Arguments passed to the enclave. \ | ||
Note that this is not an appropriate channel for passing \ | ||
secrets or security configurations to the enclave.", | ||
) | ||
.action(ArgAction::Append) | ||
) | ||
.get_matches(); | ||
|
||
let file = args.get_one::<String>("file").unwrap(); | ||
|
||
let mut device = IsgxDevice::new() | ||
.expect("failed to open SGX device") | ||
.einittoken_provider(AesmClient::new()) | ||
.build(); | ||
|
||
let mut enclave_builder = EnclaveBuilder::new(file.as_ref()); | ||
if let Err(_) = enclave_builder.coresident_signature() { | ||
enclave_builder.dummy_signature(); | ||
} | ||
|
||
if let Some(enclave_args) = args.get_many::<String>("enclave-args") { | ||
enclave_builder.args(enclave_args); | ||
} | ||
|
||
let enclave = enclave_builder | ||
.build(&mut device) | ||
.expect("failed to load SGX enclave"); | ||
|
||
match enclave.run() { | ||
Err(e) => { | ||
eprintln!("Error while executing SGX enclave.\n{}", e); | ||
std::process::exit(-1) | ||
} | ||
Ok(()) => {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.