Skip to content

feat(kms): stamp key epochs in issued certificates - #1645

Open
kvinwang wants to merge 1 commit into
nextfrom
feat/kms-cert-key-epochs
Open

kvinwang wants to merge 1 commit into
nextfrom
feat/kms-cert-key-epochs

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

Rotating the root or app epoch stops the KMS from issuing new keys to retired composes, but certificates it already signed stay valid until they expire. The requester chooses not_after (the default is 10 years), and there is no revocation list. A pre-rotation certificate also carries nothing that marks it as old: the app CA keeps the same subject across app epochs, so a verifier cannot tell which epoch signed a peer certificate.

Fix

SignCert stamps the (root_epoch, app_epoch) it authorized into a new extension, PHALA_RATLS_KEY_EPOCHS (OID 1.3.6.1.4.1.62397.1.10). The extension is a MessagePack map, encoded the same way as app info. CertExt::get_key_epochs reads it, so a verifier that knows the current epochs can reject a peer certificate from an older one. Certificates from a local CA carry no epochs. Readers that do not know the extension ignore it.

docs/app-key-epochs.md documents the extension and the lack of revocation.

Verification

  • cargo test -p ra-tls -p cert-client -p dstack-kms --all-features passes, including a new certificate round-trip test for the extension.
  • cargo clippy on these crates is clean.
  • cargo check --workspace --all-features --tests passes.

Signed-off-by: Kevin Wang <wy721@qq.com>

This branch has not been deployed

No deployments
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.

1 participant