Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enclave_build: fix argument parsing and image generation #424

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sstone
Copy link

@sstone sstone commented Nov 22, 2022

Description of changes:

  • 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

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@raulmldv
Copy link
Contributor

Checked the logs:
Makefile:221: recipe for target 'nitro-format' failed
Make sure to run cargo-fmt --all before commiting.

@sstone
Copy link
Author

sstone commented Nov 29, 2022

Checked the logs: Makefile:221: recipe for target 'nitro-format' failed Make sure to run cargo-fmt --all before commiting.

done in dc64679

@raulmldv
Copy link
Contributor

Currently failing on license check make nitro-about. Opened a PR to update our license file. After we merge it, you should rebase.

@@ -303,7 +303,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"

[[package]]
name = "enclave_build"
version = "0.1.0"
version = "0.2.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we bump the version here? Is the version 0.1.0 released on crates.io?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a significant change I thought it would make sense to change the version here, but I don't know how this library's maintainers manage versioning.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not on crates.io, I don't see a point in updating the version here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, I think it's up to the maintainers to choose here.

@@ -303,7 +303,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to follow the 50/72 rule for commit messages. Also please add a Signed-off-by line: git commit -s --amend.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rebase on main and update the commit message.

@petreeftime
Copy link
Contributor

Can you describe a bit more the issue that this patch is fixing? It seems to make the commandline arguments inconsistent, since they follow snake_case rather than kebab-case in enclave_build crate. I think they would all need to be updated to look the same.

@sstone
Copy link
Author

sstone commented Jan 30, 2023

Can you describe a bit more the issue that this patch is fixing? It seems to make the commandline arguments inconsistent, since they follow snake_case rather than kebab-case in enclave_build crate. I think they would all need to be updated to look the same.

The issue here is that it is not possible to create a signed image with enclave_build because the private key parameter is not parsed at all (instead the code reuses private_certificate which is imho a bug). I used private-key and not private_key because that's how the command line option is defined as the beginning of main.rs.

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.

Signed-off-by: sstone <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants