Commit 504823b
committed
feat(tdx-attest): Rewrite TDX attestation in pure Rust
Replace the C-based tdx-attest-sys with a pure Rust implementation:
- Implement TDX ioctl commands directly using libc
- Support ConfigFS quote generation (Linux 6.7+)
- Handle both glibc and musl ioctl request types
- Remove dependency on vendored Linux kernel headers
- Simplify API: get_quote now returns Result<Vec<u8>>
This eliminates all C code from tdx-attest, making it easier to build
for different libc targets (glibc, musl) without header compatibility
issues.
The implementation supports:
- get_quote() via ConfigFS TSM interface
- get_report() via /dev/tdx_guest ioctl
- extend_rtmr() via /dev/tdx_guest ioctl
- get_supported_att_key_ids() returns Intel TDQE UUID
Note: VSock and TDVMCALL quote methods are not implemented as ConfigFS
is the recommended approach for Linux 6.7+. They can be added later if
needed for older kernel support.1 parent 7f82973 commit 504823b
7 files changed
Lines changed: 393 additions & 295 deletions
File tree
- tdx-attest-sys/csrc/linux
- tdx-attest
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 39 | | |
44 | 40 | | |
45 | | - | |
| 41 | + | |
46 | 42 | | |
47 | 43 | | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 48 | + | |
| 49 | + | |
56 | 50 | | |
57 | 51 | | |
| 52 | + | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
0 commit comments