Skip to content

Document protocol details in READMEs#37

Open
ameba23 wants to merge 5 commits into
mainfrom
peg/document-protocol-details
Open

Document protocol details in READMEs#37
ameba23 wants to merge 5 commits into
mainfrom
peg/document-protocol-details

Conversation

@ameba23
Copy link
Copy Markdown
Collaborator

@ameba23 ameba23 commented Apr 27, 2026

This adds more details to the top-level and crate-level readme files, covering the implementation, intended use and the protocol at a high level.

This also addresses #23 by documenting that particular crates expect a tokio runtime.

@ameba23 ameba23 requested a review from 0x416e746f6e May 6, 2026 06:47
ameba23 added 2 commits May 8, 2026 08:45
* main:
  doc: qualify the `build()` method description
  chore: switch to single-threaded tests
  chore: switch to blocking verifier
  feat: implement allow-lists of leaf cert pubkeys
  feat: implement builder for cert resolver/verifier
  fix: be explicit w.r.t attestation types
  fix: make `AttestedCertificateResolver::new()` non-async
  fix: re-export `ra_tls::rcgen`
  feat: allow using custom key-pairs
  chore: rename primary_name to subject
  chore: make detect() non-async
  Attested certificate verifier should require client authentication
  Bump rustls-webpki from 0.103.12 to 0.103.13
Copy link
Copy Markdown
Member

@0x416e746f6e 0x416e746f6e left a comment

Choose a reason for hiding this comment

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

great docs!

Comment on lines +17 to +23
PCCS enabled and calling verification APIs, including
`verify_attestation_sync()`, is expected to happen from within a Tokio runtime,
and will panic if called outside of one.

Note that the synchronous verification API is synchronous in its return type,
but it still relies on Tokio-backed background tasks for PCCS pre-warm
and cache refresh.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
PCCS enabled and calling verification APIs, including
`verify_attestation_sync()`, is expected to happen from within a Tokio runtime,
and will panic if called outside of one.
Note that the synchronous verification API is synchronous in its return type,
but it still relies on Tokio-backed background tasks for PCCS pre-warm
and cache refresh.
PCCS enabled and calling verification APIs is expected to happen from within a
Tokio runtime and might panic if called outside of one.
Note that although some of the verification API methods are synchronous (for
example `verify_attestation_sync`), still their functionality depends on
Tokio-backed background tasks such as PCCS pre-warm and cache refresh.

Comment on lines +7 to +16
- `AttestedCertificateResolver`: issues TLS certificates which contain an
embedded attestation and handles renewal. It implements
[`rustls::server::ResolvesServerCert`](https://docs.rs/rustls/latest/rustls/server/trait.ResolvesServerCert.html)
and [`rustls::client::ResolvesClientCert`](https://docs.rs/rustls/latest/rustls/client/trait.ResolvesClientCert.html).
- `AttestedCertificateVerifier`: verifies the TLS certificate and the embedded
attestation during TLS handshake. It implements [`rustls::client::danger::ServerCertVerifier`](https://docs.rs/rustls/latest/rustls/client/danger/trait.ServerCertVerifier.html)
and [`rustls::server::danger::ClientCertVerifier`](https://docs.rs/rustls/latest/rustls/server/danger/trait.ClientCertVerifier.html).

The crate supports both server and client TLS authentication, and can be used as the
inner attested session inside [`nested-tls`](../nested-tls).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
- `AttestedCertificateResolver`: issues TLS certificates which contain an
embedded attestation and handles renewal. It implements
[`rustls::server::ResolvesServerCert`](https://docs.rs/rustls/latest/rustls/server/trait.ResolvesServerCert.html)
and [`rustls::client::ResolvesClientCert`](https://docs.rs/rustls/latest/rustls/client/trait.ResolvesClientCert.html).
- `AttestedCertificateVerifier`: verifies the TLS certificate and the embedded
attestation during TLS handshake. It implements [`rustls::client::danger::ServerCertVerifier`](https://docs.rs/rustls/latest/rustls/client/danger/trait.ServerCertVerifier.html)
and [`rustls::server::danger::ClientCertVerifier`](https://docs.rs/rustls/latest/rustls/server/danger/trait.ClientCertVerifier.html).
The crate supports both server and client TLS authentication, and can be used as the
inner attested session inside [`nested-tls`](../nested-tls).
- `AttestedCertificateResolver`: issues and renews TLS certificates with
attestations embedded in their extensions.
It implements [`rustls::server::ResolvesServerCert`](https://docs.rs/rustls/latest/rustls/server/trait.ResolvesServerCert.html)
and [`rustls::client::ResolvesClientCert`](https://docs.rs/rustls/latest/rustls/client/trait.ResolvesClientCert.html).
- `AttestedCertificateVerifier`: verifies the TLS certificates and their
embedded attestations during TLS handshake.
It implements [`rustls::client::danger::ServerCertVerifier`](https://docs.rs/rustls/latest/rustls/client/danger/trait.ServerCertVerifier.html)
and [`rustls::server::danger::ClientCertVerifier`](https://docs.rs/rustls/latest/rustls/server/danger/trait.ClientCertVerifier.html).
The crate supports both server and client TLS authentication, and can be used as
the inner attested session inside [`nested-tls`](../nested-tls).


## Protocol details

The resolver issues a short-lived X.509 leaf certificate whose attestation is
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

grammar:

Suggested change
The resolver issues a short-lived X.509 leaf certificate whose attestation is
The resolver issues a short-lived X.509 leaf certificate which attestation is

(certificate is a thing, not a person)

Comment on lines +39 to +40
- Issues either a self-signed leaf certificate or a leaf signed by a provided
private CA
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
- Issues either a self-signed leaf certificate or a leaf signed by a provided
private CA
- Issues either a self-signed certificate or a leaf certificate signed by a
provided (private) CA

Comment on lines +70 to +71
The attestation is embedded using the `ra-tls` certificate extension format.
When verifying a certificate, this crate first tries to parse the `ra-tls`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

provide hyperlinks:

Suggested change
The attestation is embedded using the `ra-tls` certificate extension format.
When verifying a certificate, this crate first tries to parse the `ra-tls`
The attestation is embedded using the [`ra-tls`](https://github.com/Dstack-TEE/dstack/tree/master/ra-tls)
certificate extension format. When verifying a certificate, this crate first
tries to parse the [`ra-tls`](https://github.com/Dstack-TEE/dstack/tree/master/ra-tls)

Comment thread crates/pccs/README.md

This crate is used by attestation verification code that needs Intel TDX/SGX
collateral such as TCB info, QE identity, and certificate revocation lists.
It can:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
It can:
It can:

Comment thread crates/pccs/README.md
Comment on lines +25 to +27
That applies even when calling synchronous-looking APIs such as
`get_collateral_sync()`: cache miss repair, proactive refresh, and startup
pre-warm are all driven by Tokio background tasks.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
That applies even when calling synchronous-looking APIs such as
`get_collateral_sync()`: cache miss repair, proactive refresh, and startup
pre-warm are all driven by Tokio background tasks.
The above applies even when calling synchronous-looking APIs such as
`get_collateral_sync()` because cache miss repair, proactive refresh, and
startup pre-warm are all driven by Tokio background tasks.

Comment thread readme.md
Primitives for attested TLS channels.

Provided crates:
This workspace contains components for a protocol which binds confidential
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

grammar:

Suggested change
This workspace contains components for a protocol which binds confidential
This workspace contains components for a protocol that binds confidential

("binds confidential computing attestation evidence" is definitive property of the protocol, also called "restrictive")

Comment thread readme.md
Comment on lines +23 to +24
- An inner TLS session which uses a certificate with attestation
evidence embedded in an extension.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
- An inner TLS session which uses a certificate with attestation
evidence embedded in an extension.
- An inner TLS session uses a certificate with attestation evidence embedded in
an extension.

Comment thread readme.md
Comment on lines +31 to +32
The inner identity should not be persistent and represents a particular CVM
instance and particular OS image build.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rephrase:

Suggested change
The inner identity should not be persistent and represents a particular CVM
instance and particular OS image build.
The inner identity represents particular CVM lifetime (for example, it can
persist across service restarts, but must not persist across CVM reboots, let
alone CVM image updates).

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.

2 participants