Skip to content

testing registration#76

Draft
adambalogh wants to merge 1 commit into
mainfrom
ani/registration-check
Draft

testing registration#76
adambalogh wants to merge 1 commit into
mainfrom
ani/registration-check

Conversation

@adambalogh
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_data hash.
  • 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")
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