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

orc tool: support for signing SGXS binaries #1056

Merged
merged 4 commits into from
Aug 3, 2022

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jul 22, 2022

This adds support for offline singing of SGX enclaves, removing the need for https://github.com/oasislabs/rust-sgx/tree/ravenac95/sgxs-sign-support-offline-sign

Changes:

  • orc sgx-sign-data <bundle.orc> subcommand is added which constructs the SIGSTRUCT and outputs the hash to be signed (this replaces the sgx-sign gendata from the rust-sgx tool).
  • orc sgx-set-sig <bundle.orc> <signature.sig> <public_key.pub> is updated so that it accepts the signature (of the SIGSTRUCT hash) and the signing public key. It then constructs the signed SIGSTRUCT and inserts it into the manifest (this replaces the two-step process from before, which used: sgx-sign catsig and orc sgx-set-sig)

At the moment the command flags for configuring the SIGSTRUCT fileds matches arguments in the rust-sgx tool: https://github.com/oasislabs/rust-sgx/blob/79ceb56714234f30576d8ccb61548828cfd934c4/sgxs-tools/src/bin/sgxs-sign.rs#L110-L121

NOTE: The above code says that: "ATTRIBUTES.XFRM and inverse ATTRIBUTEMASK.XFRM fields (default: 0x3/0)", but due to a bug the ATTRIBUTEMASK.XFRM actually defaults to 0x3 (the command ignores the flag) and it uses the default defined here: https://github.com/oasislabs/rust-sgx/blob/79ceb56714234f30576d8ccb61548828cfd934c4/sgxs/src/sigstruct.rs#L80-L84

TODO:

@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #1056 (e174385) into main (60136c9) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1056   +/-   ##
=======================================
  Coverage   68.14%   68.14%           
=======================================
  Files         128      128           
  Lines       11061    11061           
=======================================
  Hits         7537     7537           
  Misses       3492     3492           
  Partials       32       32           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ptrus ptrus force-pushed the ptrus/features/orctool-sgx-signing branch 9 times, most recently from d6bda44 to 381bf28 Compare July 27, 2022 06:15
docs/runtime/reproducibility.md Outdated Show resolved Hide resolved
tools/orc/sgx.go Outdated Show resolved Hide resolved
@kostko kostko force-pushed the ptrus/features/orctool-sgx-signing branch from 381bf28 to d7a2812 Compare August 3, 2022 08:12
@kostko kostko marked this pull request as ready for review August 3, 2022 08:12
@kostko kostko requested a review from pro-wh as a code owner August 3, 2022 08:12
@kostko kostko enabled auto-merge August 3, 2022 08:44
@kostko kostko merged commit 3bdef4f into main Aug 3, 2022
@kostko kostko deleted the ptrus/features/orctool-sgx-signing branch August 3, 2022 09:07
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Sep 20, 2022
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Oct 11, 2022
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Oct 11, 2022
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Oct 11, 2022
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Oct 11, 2022
tjanez pushed a commit to oasisprotocol/cli that referenced this pull request Oct 11, 2022
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.

3 participants