Skip to content

Commit dc64679

Browse files
committed
enclave_build: fix argument parsing and image generation
- 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
1 parent a80cda0 commit dc64679

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enclave_build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "enclave_build"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["The AWS Nitro Enclaves Team <[email protected]>"]
55
edition = "2018"
66
rust-version = "1.58"

enclave_build/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ fn main() {
131131
let linuxkit_path = matches.value_of("linuxkit_path").unwrap();
132132
let output = matches.value_of("output").unwrap();
133133
let signing_certificate = matches
134-
.value_of("signing_certificate")
135-
.map(|val| val.to_string());
136-
let private_key = matches
137-
.value_of("private_certificate")
134+
.value_of("signing-certificate")
138135
.map(|val| val.to_string());
136+
let private_key = matches.value_of("private-key").map(|val| val.to_string());
139137
let img_name = matches.value_of("image_name").map(|val| val.to_string());
140138
let img_version = matches.value_of("image_version").map(|val| val.to_string());
141139
let metadata = matches.value_of("metadata").map(|val| val.to_string());
@@ -144,6 +142,7 @@ fn main() {
144142
.read(true)
145143
.write(true)
146144
.create(true)
145+
.truncate(true)
147146
.open(output)
148147
.expect("Failed to create output file");
149148

0 commit comments

Comments
 (0)