testing registration#76
Draft
adambalogh wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes how the enclave registers its signing key with the local nitriding daemon by reverting the registered digest to SHA256(DER-SPKI(public RSA key)) (instead of a domain-separated transcript that also committed to the HPKE public key). As a result, the HPKE key used for OHTTP is no longer covered by the attested/on-chain-verified user_data hash.
Changes:
- Update comments to state the HPKE keypair is generated in-enclave but not included in the attested/on-chain
user_datahash. - Change nitriding registration to post
base64(SHA256(public_key_der))(no longer includes HPKE in the hashed transcript). - Remove the defensive runtime check that enforced presence/length of the HPKE public key for registration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+43
| # HPKE keypair for OHTTP-style anonymous inference. Generated inside | ||
| # the enclave, but not currently included in the on-chain nitriding | ||
| # user_data hash. |
Comment on lines
+42
to
+43
| # the enclave, but not currently included in the on-chain nitriding | ||
| # user_data hash. |
Comment on lines
98
to
104
| public_key_der = self.public_key.public_bytes( | ||
| encoding=serialization.Encoding.DER, | ||
| format=serialization.PublicFormat.SubjectPublicKeyInfo, | ||
| ) | ||
|
|
||
| # Domain-separated transcript so a future addition of more keys | ||
| # can't be confused with the existing layout. | ||
| transcript = ( | ||
| b"og-tee-keys|v2|rsa-spki=" | ||
| + public_key_der | ||
| + b"|hpke-x25519=" | ||
| + self.hpke_public_key_raw | ||
| ) | ||
| key_hash = hashlib.sha256(transcript).digest() | ||
| key_hash = hashlib.sha256(public_key_der).digest() | ||
| key_hash_b64 = base64.b64encode(key_hash).decode("utf-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.