Skip to content

feat(tdx): replace FFI DCAP verifier with pure-Rust dcap-qvl backend#167

Merged
imlk0 merged 2 commits into
masterfrom
builtin-tdx-verifier
Jul 13, 2026
Merged

feat(tdx): replace FFI DCAP verifier with pure-Rust dcap-qvl backend#167
imlk0 merged 2 commits into
masterfrom
builtin-tdx-verifier

Conversation

@imlk0

@imlk0 imlk0 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the FFI-based DCAP quote verifier (which links Intel's
libtdx-attest / libsgx-dcap-quote-verify C libraries) with a pure-Rust
dcap-qvl backend, removing the dependency on the Intel DCAP C libraries.

Core changes

  • Feature split (tng/Cargo.toml, rats-cert/Cargo.toml): the old single
    builtin-as-tdx feature is split into two mutually-exclusive backends:
    • builtin-as-tdx-ffi -> attestation-service/tdx-verifier: legacy FFI
      backend, still links the Intel C libraries.
    • builtin-as-tdx-rust -> attestation-service/tdx-dcap-rust: pure Rust
      dcap-qvl, statically linkable, fetches TDX collateral from a PCCS over
      HTTPS, no Intel C library dependency.
  • Trustee pin bump fec2cf58 -> b3009fcd (the commit that introduces the
    tdx-dcap-rust feature).
  • Dockerfiles: removed all Intel SGX/TDX repo setup and the
    libtdx-attest[-dev] / libsgx-dcap-quote-verify[-dev] /
    libsgx-dcap-default-qpl packages (build and runtime stages in both
    Dockerfile and Dockerfile.ubuntu2404); builds now pass
    --features 'builtin-as-tdx-rust'.
  • Build invocations switched to --features 'builtin-as-tdx-rust':
    Makefile bin-build / python-wheel, RPM spec %build, the go-sdk
    workflow, and the build-python-sdk Linux step.
  • scripts/setup-vendor-config: the PCCS note now references the
    builtin-as-tdx-ffi feature name.

Artifact × platform × builtin-AS status

Artifact / build path Platform / target builtin AS Notes
Docker image (Dockerfile) x86_64 Linux (Alibaba Cloud Linux 3) builtin-as-tdx-rust build & runtime stages dropped Intel DCAP libs
Docker image (Dockerfile.ubuntu2404) x86_64 Linux (Ubuntu 24.04) builtin-as-tdx-rust Intel SGX repo + dev/runtime packages removed
Makefile bin-build host (Linux) builtin-as-tdx-rust cargo build --release --features 'builtin-as-tdx-rust'
Makefile python-wheel host builtin-as-tdx-rust bundles the tng binary with this feature
RPM package (trusted-network-gateway.spec %build) x86_64 Linux (RPM) builtin-as-tdx-rust cargo install ... --features 'builtin-as-tdx-rust'
.github/workflows/go-sdk.yml x86_64 Linux builtin-as-tdx-rust "Build TNG binary" step
.github/workflows/build-python-sdk.yml Linux x86_64 (x86_64-unknown-linux-gnu) builtin-as-tdx-rust Linux step passes the feature
.github/workflows/build-python-sdk.yml Linux aarch64 (aarch64-unknown-linux-gnu) builtin-as-tdx-rust (config) same Linux step; TDX is x86_64-only, aarch64 compilability needs verification
.github/workflows/build-python-sdk.yml macOS x86_64 (x86_64-apple-darwin) cargo build -p tng --release (no features)
.github/workflows/build-python-sdk.yml macOS aarch64 (aarch64-apple-darwin) same
.github/workflows/build-python-sdk.yml Windows cross (x86_64-pc-windows-gnu) cargo zigbuild ... (no features)
tng-wasm (WASM SDK / www demo) wasm32 (browser) depends on tng default-features=false, only __ingress-common
tng-hook-cdylib (Dockerfile / Makefile tng-hook-build / zigbuild workflow) host Linux no builtin-as feature passed
tng-testsuite test build (--features on-bin/on-podman) host no builtin-as
plain cargo build -p tng (tng crate default features) any default contains no builtin-as-*

Conclusions

  • All x86_64-Linux artifacts now default to the pure-Rust builtin-as-tdx-rust
    backend and no longer link the Intel DCAP C libraries.
  • No artifact defaults to the FFI backend (builtin-as-tdx-ffi) — it is kept
    only as an opt-in alternative.
  • Non-x86_64-Linux platforms (macOS / Windows / wasm) do not enable builtin AS,
    which is expected: TDX verification is an x86_64-Linux concern.
  • Open question: the build-python-sdk aarch64-Linux step also passes
    builtin-as-tdx-rust; since TDX is x86_64-only, whether it actually compiles
    on aarch64 needs a real build to confirm.

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

imlk0 added 2 commits July 13, 2026 19:44
Version/release bumps across the repo (Cargo.toml, Cargo.lock, buildspec.yml, pyproject.toml, and the RPM spec Version + changelog) are produced at a specific release stage by make bump-version-{major,minor,patch}, which regenerates the spec changelog from commit subjects since the last tag. Hand-editing the spec Version/Release or adding a version-stamped changelog entry carries a wrong release number and duplicates the auto-collected commits. Edit the spec only for packaging logic (BuildRequires/Requires, build flags); leave versioning to make bump-version-*.
Split the single `builtin-as-tdx` feature into two mutually-exclusive
backends:
- `builtin-as-tdx-ffi` -> attestation-service/tdx-verifier (legacy FFI
  backend, links Intel libtdx-attest / libsgx-dcap-quote-verify)
- `builtin-as-tdx-rust` -> attestation-service/tdx-dcap-rust (pure Rust
  dcap-qvl, statically linkable, fetches TDX collateral from a PCCS over
  HTTPS, no Intel C library dependency)

Switch all x86_64-Linux build artifacts (Dockerfiles, Makefile, RPM spec,
go-sdk and build-python-sdk workflows) to `builtin-as-tdx-rust` and drop
the Intel SGX/TDX repo setup plus libtdx-attest / libsgx-dcap-* packages
from both build and runtime stages.

Bump the trustee pin (fec2cf58 -> b3009fcd), which introduces the
tdx-dcap-rust feature.
@imlk0
imlk0 force-pushed the builtin-tdx-verifier branch from 9f207d2 to 862c827 Compare July 13, 2026 11:46
@imlk0
imlk0 merged commit 862c827 into master Jul 13, 2026
16 of 20 checks passed
@imlk0
imlk0 temporarily deployed to github-pages July 13, 2026 12:08 — with GitHub Actions Inactive
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