Skip to content

Commit

Permalink
enclave_build: fix argument parsing and image generation
Browse files Browse the repository at this point in the history
- fixed inconsistencies in argument names that make it impossible to generate a signed image
- fixed potential image corruption if the output image already exists by truncating it before writing to it
- bump version to 0.2.0
  • Loading branch information
sstone committed Nov 28, 2022
1 parent a80cda0 commit dc64679
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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_build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "enclave_build"
version = "0.1.0"
version = "0.2.0"
authors = ["The AWS Nitro Enclaves Team <[email protected]>"]
edition = "2018"
rust-version = "1.58"
Expand Down
7 changes: 3 additions & 4 deletions enclave_build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ fn main() {
let linuxkit_path = matches.value_of("linuxkit_path").unwrap();
let output = matches.value_of("output").unwrap();
let signing_certificate = matches
.value_of("signing_certificate")
.map(|val| val.to_string());
let private_key = matches
.value_of("private_certificate")
.value_of("signing-certificate")
.map(|val| val.to_string());
let private_key = matches.value_of("private-key").map(|val| val.to_string());
let img_name = matches.value_of("image_name").map(|val| val.to_string());
let img_version = matches.value_of("image_version").map(|val| val.to_string());
let metadata = matches.value_of("metadata").map(|val| val.to_string());
Expand All @@ -144,6 +142,7 @@ fn main() {
.read(true)
.write(true)
.create(true)
.truncate(true)
.open(output)
.expect("Failed to create output file");

Expand Down

0 comments on commit dc64679

Please sign in to comment.