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

sgxs crate changes to enable offline signing #429

Merged
merged 7 commits into from
Jan 3, 2023

Conversation

arai-fortanix
Copy link
Contributor

This change adds new interfaces to the sgxs crate to make it possible to sign enclaves separately from creating the sigstructs. This is useful, for example, for performing signing via an HSM.

The first two commits in this sequence come from this pull request from ravenac95: #327. I did not include the changes to the command-line sgx-sign tool from that pull request. I think we can have a separate discussion about whether we want to support that model. The library changes should be less controversial.

I also included a change to expose the hash bytes from an EnclaveHash object. That comes from #341 from trevor-crypto.

This change should be backward-compatible with old code using this crate. New code that wants to use the new cat_sign() method and is using a custom key implementation will need to provide the new SgxRsaPubOps() trait for calculating the Q1 and Q2 values from a signature, instead of doing this during signing.

Copy link
Contributor

@Pagten Pagten left a comment

Choose a reason for hiding this comment

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

This looks good to me.

available, reconstruct the sigstruct and call `sigstruct.cat_sign()` with the signature to get the signed
and populated Sigstruct.
- If you are using a custom key implementation, you will need to implement the new `SgxRsaPubOps()`
trait for your key. This trait must provide a `calculate_q1_q2()` method that calculates the q1 and q1
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Typo "q1 and q1"

@arai-fortanix
Copy link
Contributor Author

bors r=[Pagten]

@bors
Copy link
Contributor

bors bot commented Jan 3, 2023

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 9c4589c into master Jan 3, 2023
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.

None yet

4 participants