Skip to content

Commit

Permalink
Merge fortanix#280
Browse files Browse the repository at this point in the history
280: Don't pass filename to enclave as first arg r=jethrogb a=mzohreva



Co-authored-by: Mohsen Zohrevandi <[email protected]>
  • Loading branch information
bors[bot] and mzohreva authored Oct 14, 2020
2 parents 3d53ec3 + e7bffce commit ea3123b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion enclave-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "enclave-runner"
version = "0.4.1"
version = "0.5.0"
authors = ["Fortanix, Inc."]
license = "MPL-2.0"
edition = "2018"
Expand Down
14 changes: 6 additions & 8 deletions enclave-runner/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ impl<'a> EnclaveBuilder<'a> {
self
}

fn initialized_args_mut(&mut self) -> &mut Vec<Vec<u8>> {
self.cmd_args.get_or_insert_with(|| vec![b"enclave".to_vec()])
}

/// Adds multiple arguments to pass to enclave's `fn main`.
/// **NOTE:** This is not an appropriate channel for passing secrets or
/// security configurations to the enclave.
Expand All @@ -279,10 +283,7 @@ impl<'a> EnclaveBuilder<'a> {
S: AsRef<[u8]>,
{
let args = args.into_iter().map(|a| a.as_ref().to_owned());
match self.cmd_args {
None => self.cmd_args = Some(args.collect()),
Some(ref mut cmd_args) => cmd_args.extend(args),
}
self.initialized_args_mut().extend(args);
self
}

Expand All @@ -298,10 +299,7 @@ impl<'a> EnclaveBuilder<'a> {
/// [`build_library`]: struct.EnclaveBuilder.html#method.build_library
pub fn arg<S: AsRef<[u8]>>(&mut self, arg: S) -> &mut Self {
let arg = arg.as_ref().to_owned();
match self.cmd_args {
None => self.cmd_args = Some(vec![arg]),
Some(ref mut cmd_args) => cmd_args.push(arg),
}
self.initialized_args_mut().push(arg);
self
}

Expand Down
4 changes: 2 additions & 2 deletions fortanix-sgx-tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fortanix-sgx-tools"
version = "0.4.3"
version = "0.5.0"
authors = ["Fortanix, Inc."]
license = "MPL-2.0"
description = """
Expand All @@ -21,7 +21,7 @@ edition = "2018"
# Project dependencies
aesm-client = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] }
sgxs-loaders = { version = "0.3.0", path = "../sgxs-loaders" }
enclave-runner = { version = "0.4.0", path = "../enclave-runner" }
enclave-runner = { version = "0.5.0", path = "../enclave-runner" }
sgxs = { version = "0.7.0", path = "../sgxs" }
sgx-isa = { version = "0.3.0", path = "../sgx-isa" }

Expand Down
1 change: 0 additions & 1 deletion fortanix-sgx-tools/src/bin/ftxsgx-runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ fn main() -> Result<(), Error> {
None => (),
}

enclave_builder.arg(file);
if let Some(enclave_args) = args.values_of("enclave-args") {
enclave_builder.args(enclave_args);
}
Expand Down
4 changes: 2 additions & 2 deletions report-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "report-test"
version = "0.3.1"
version = "0.3.2"
authors = ["Fortanix, Inc."]
license = "MPL-2.0"
description = """
Expand All @@ -16,7 +16,7 @@ categories = ["development-tools"]

[dependencies]
# Project dependencies
"enclave-runner" = { version = "0.4.0", path = "../enclave-runner" }
"enclave-runner" = { version = "0.5.0", path = "../enclave-runner" }
"sgxs" = { version = "0.7.0", path = "../sgxs" }
"sgx-isa" = { version = "0.3.0", path = "../sgx-isa" }

Expand Down
4 changes: 2 additions & 2 deletions sgxs-tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sgxs-tools"
version = "0.8.3"
version = "0.8.4"
authors = ["Fortanix, Inc."]
license = "MPL-2.0"
description = """
Expand Down Expand Up @@ -34,7 +34,7 @@ path = "src/sgx_detect/main.rs"
"aesm-client" = { version = "0.5.0", path = "../aesm-client", features = ["sgxs"] }
"sgx-isa" = { version = "0.3.0", path = "../sgx-isa" }
"report-test" = { version = "0.3.1", path = "../report-test" }
"enclave-runner" = { version = "0.4.0", path = "../enclave-runner" }
"enclave-runner" = { version = "0.5.0", path = "../enclave-runner" }

# External dependencies
lazy_static = "1" # MIT/Apache-2.0
Expand Down

0 comments on commit ea3123b

Please sign in to comment.