Skip to content
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d56bdf8
Add .gitignore, remove lockfile
embediver Dec 9, 2025
6a23daf
Remove unused feature flags, move test/example deps to dev-dependencies
embediver Dec 9, 2025
a88c785
Implement spdm-emu NONE and TCP transports
leongross Dec 16, 2025
5339046
Refactor Version command
embediver Dec 17, 2025
4646943
Refactor Capabilities command
embediver Dec 17, 2025
3df72a0
Add check is_request/is_response check
embediver Dec 17, 2025
ac42fed
Add capabilities response handler
embediver Dec 17, 2025
5d56e69
Fix clippy warning for is_response check
embediver Dec 18, 2025
0a4554a
Implement VERSION response processing function
embediver Jan 7, 2026
8bc95ba
example/requester: add version and capability handling
leongross Jan 8, 2026
6492abd
add prelim AUTH generation (no response parsing)
leongross Jan 9, 2026
3e4077a
Debug example requester VCA stage
leongross Jan 15, 2026
08a93b0
Implement SpdmContext mock scaffold for tests
embediver Jan 23, 2026
047e55c
Happy path test for VERSION response handling
embediver Jan 26, 2026
88ec884
Add further tests for (GET_)VERSION request handling
embediver Jan 27, 2026
8e4f166
Happy path test for CAPABILITIES response handling
embediver Jan 27, 2026
96481c8
Improve CAPABILITIES response handling
embediver Jan 27, 2026
3b70297
Add test for CAPABILITY response error case handling
embediver Jan 28, 2026
0738c3b
Fix test/spdm_validator_host build
embediver Jan 28, 2026
72c5f37
wip
leongross Jan 15, 2026
0918f6d
update context transcript and state machine
leongross Feb 5, 2026
3c945f2
Apply cargo fmt fixes
embediver Feb 10, 2026
af2d7ff
Fix all warnings in lib code
embediver Feb 10, 2026
3c6fd5b
spdm: add digests
leongross Feb 5, 2026
360753f
Refactor CERTIFICATE command
embediver Feb 10, 2026
aef7a40
Implement GET_CERTIFICATE request generator
embediver Feb 10, 2026
a97de15
Implement minimal CERTIFICATE response handling
embediver Feb 11, 2026
93b87d8
Add peer cert. store and cert. retrieval state
embediver Feb 12, 2026
5d2fac1
v1.3 & v1.4 compatible cert. chain header
embediver Feb 12, 2026
a895f1d
Fix spelling mistakes
embediver Feb 12, 2026
86cd3a6
digests: add context peer slot tracking
leongross Feb 12, 2026
24f7077
Remove unused imports
embediver Feb 16, 2026
887c1fc
Fix build for all examples
embediver Feb 11, 2026
08e7334
Fix all warnings when building examples
embediver Feb 16, 2026
0b13847
Fix tests
embediver Feb 16, 2026
4a7638e
Add CI/CD jobs for tests and license check
embediver Jan 28, 2026
9d9a753
Add licenserc.yaml
embediver Feb 16, 2026
b403b9b
Implement missing functionality for ExamplePeerCertStore
embediver Feb 17, 2026
881ede4
Requester example: Parse x.509 cert chain
embediver Feb 17, 2026
f280e3e
Add basic cert chain verification to example requester
embediver Feb 17, 2026
eccfdbe
Fix oversight in example cert chain verification
embediver Feb 19, 2026
d5b0a29
Remove example/test_static_certs
embediver Feb 24, 2026
ff8e396
Remove superfluous `crypto` feature flag, update compilation readme
embediver Feb 24, 2026
e5c4b46
add challenge
leongross Feb 13, 2026
013bba5
Fix transcript generation and challenge_auth verification
embediver Feb 24, 2026
c8b2128
Fix all warnings
embediver Feb 24, 2026
bcaff51
ci: add dummy build-emu.yml
leongross Feb 26, 2026
627003b
add mctp binding for platform transport
leongross Feb 26, 2026
18cd5a2
add transport type flag to cli and restructure to use clap
leongross Feb 26, 2026
c1805db
abstract header generation to TransportType
leongross Feb 26, 2026
1f290b5
Fix: Uncomment `no_std` attribure for spdm-lib
embediver Feb 26, 2026
27fdf91
ci: add dummy build-emu.yml
leongross Feb 26, 2026
dfa4e3f
ci: add requester integration test with spdm_emu
leongross Feb 26, 2026
51c89ce
ci: make paths absolute with workspace base for emulator builds
leongross Feb 26, 2026
21666a4
Add verification workflow with spdm-emu caching
embediver Feb 27, 2026
e4d5d89
Add steps for requester example build and verification run
embediver Feb 27, 2026
b2d8d82
Add matrix for SPMD versions and transports
embediver Feb 27, 2026
3b24fb9
Rename transport values to upper case for clap
embediver Feb 27, 2026
369f81f
Run spdm-emu in build directory for relative cert lookup
embediver Feb 27, 2026
4545d50
Don't fail fast for matrix strategy
embediver Feb 27, 2026
3ab4e6e
Point rust cache to correct workspace directory
embediver Feb 27, 2026
3cd80a5
Add examples round trip test, delete unneeded emulator build workflow
embediver Feb 27, 2026
3abf5a2
Refactor capabilities requester
embediver Feb 18, 2026
3e2e53b
Cleanup of commented-out code
embediver Mar 9, 2026
9f82ddc
Use challenge-auth signature context string only when version >= v1.2
embediver Mar 9, 2026
ec97c8e
Fix challenge parsing for version <= v1.2
embediver Mar 9, 2026
7659fdf
Only parse supported_slots_mask for version >= v1.3
embediver Mar 9, 2026
946a48d
Implement < v1.3 compatibility for challenge command
embediver Mar 10, 2026
2766d12
Cleanup logging in requester example
embediver Mar 10, 2026
58fb82b
fix: use prehashed signature verification for SPDM v1.1
leongross Mar 12, 2026
3308936
add missing license headers
leongross Feb 28, 2026
bd7b43f
fix minimum required length check for responder
leongross Mar 13, 2026
fadd05c
fix NEGOTIATE_ALGORITHMS size
leongross Mar 13, 2026
36a5f63
fix signature generation and verification
leongross Mar 13, 2026
dcd0f23
Remove duplicate ca-cert from example folder
embediver Mar 16, 2026
bea922e
Refactor measurements command
embediver Feb 18, 2026
41ee519
Implement GET_MEASUREMENTS request generation
embediver Feb 26, 2026
8b0d0c5
Add MEASUREMENTS response handler stub, add doc
embediver Feb 26, 2026
e174fae
Implement MEASUREMENTS response parsing
embediver Feb 26, 2026
8f19a6a
Reset M1/M2 transcript when a GET_MEASUREMENTS request is generated
embediver Mar 17, 2026
9b3a7aa
Add functionality to parse and iterate measurements from response
embediver Mar 24, 2026
f214e6a
Fix L1/L2 transcript generation, check L1/L2 signature in example
embediver Mar 25, 2026
c488af2
Only parse MEASUREMENTS requester context when conn. ver. is > v1.2
embediver Mar 25, 2026
eeb9dbb
Fix bug: Correctly resize buffer for transcript signature exclusion
embediver Mar 25, 2026
e01b0b9
Fix some linter warnings
embediver Mar 26, 2026
029a5a4
Minor cleanups of example cert store
embediver Apr 14, 2026
3a126d1
Merge pull request #46 from 9elements/cleanup/example-cert-store
embediver Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Lint, Build and Test

on:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (stable) with components
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@v2
- name: rustfmt check
run: cargo fmt --all -- --check
- name: clippy (deny warnings)
run: |
cargo clippy --all-targets --all-features --workspace -- -D warnings

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (stable) with components
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@v2
- name: Cargo Build
run: cargo build --all-targets --workspace --verbose

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (stable) with components
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --all-features --verbose --workspace
roundtrip-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@v2
- name: Build examples
run: cargo build --examples
- name: Run tests
run: |
cargo run --example spdm_responder -- --port 2323 &
(sleep 1; cargo run --example spdm_requester -- --port 2323 )


11 changes: 11 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: License Check

on: pull_request

jobs:
license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: License Eye Header
uses: apache/skywalking-eyes@v0.8.0
70 changes: 70 additions & 0 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Verification with SPDM Emulator

on:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

env:
CARGO_TERM_COLOR: always
SPDM_EMU_REF: fe4cdc53b3f0e8300d16519467588001525e84f3 # spdm-emu main (27.02.2026)
CACHE_INVALIDATOR: 20ba74fb3b2bc121 # change to invalidate caches

jobs:
requester-verification:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
spdm_version: ["1.1", "1.2", "1.3"]
transport: [NONE, MCTP]
steps:
- name: Cache spdm-emu build output
id: cache-spdm-emu
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/spdm-emu/build
key: spdm_emu-${{ env.SPDM_EMU_REF }}-${{ runner.os }}-${{ env.CACHE_INVALIDATOR }}

- name: Checkout DMTF spdm-emu
if: ${{ steps.cache-spdm-emu.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
repository: DMTF/spdm-emu
ref: ${{ env.SPDM_EMU_REF }}
submodules: recursive
path: spdm-emu

- name: Install build dependecies
if: ${{ steps.cache-spdm-emu.outputs.cache-hit != 'true' }}
run: |
sudo apt install -y build-essential

- name: Build spdm-emu
if: ${{ steps.cache-spdm-emu.outputs.cache-hit != 'true' }}
run: |
cd "$GITHUB_WORKSPACE"/spdm-emu
git submodule update
mkdir build -p && cd build
cmake -DARCH=x64 -DTOOLCHAIN=GCC -DTARGET=Debug -DCRYPTO=openssl ..
make copy_sample_key
make -j

- uses: actions/checkout@v4
with:
path: spdm-lib
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@v2
with:
workspaces: "spdm-lib"
- name: Cargo Build
run: |
cd spdm-lib
cargo build --example spdm_requester
- name: Run verification flow
run: |
cd spdm-lib
(cd "$GITHUB_WORKSPACE"/spdm-emu/build/bin/; ./spdm_responder_emu --trans ${{ matrix.transport }} --ver ${{ matrix.spdm_version }} --slot_id 0 --slot_count 1 --req_slot_id 0) &
(sleep 1; cargo run --example spdm_requester -- --transport-type ${{ matrix.transport }} --port 2323 --verbose)

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Cargo.lock
12 changes: 12 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
header:
license:
spdx-id: Apache-2.0
# No copyright owner until this has been clarified
# copyright-owner: OpenPRoT a Series of LF Projects, LLC
copyright-year: 2025
software-name: spdm-lib

paths:
- '**/*.rs'

comment: on-failure
65 changes: 15 additions & 50 deletions COMPILATION_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,25 @@ spdm-lib/
### Build the Library

```bash
cargo build --features std,crypto
cargo build
```

### Build Examples

Build the main SPDM responder:
```bash
cargo build --example spdm_responder --features std,crypto
```

Build the certificate test:
```bash
cargo build --example test_static_certs --features std
cargo build --example spdm_responder
```

Build all examples:
```bash
cargo build --examples --features std,crypto
cargo build --examples
```

### Release Build (Optimized)

```bash
cargo build --release --example spdm_responder --features std,crypto
cargo build --release --example spdm_responder
```

## Running Tests
Expand All @@ -84,36 +79,7 @@ cargo build --release --example spdm_responder --features std,crypto

Run all library unit tests:
```bash
cargo test --features std,crypto
```

### Static Certificate Verification

Test that the static certificates are properly formatted:
```bash
cargo run --example test_static_certs --features std
```

Expected output:
```
Static Certificate Test
=======================
Root CA Certificate: 419 bytes
Attestation Certificate: 453 bytes
Certificate Chain: 872 bytes
✓ Certificate chain length matches individual certificates
✓ Certificate chain starts with root CA
✓ Certificate chain ends with attestation certificate
✓ Both certificates have proper X.509 DER format (SEQUENCE tag)

Static certificates are ready for use!
```

### Integration Tests

Run integration tests:
```bash
cargo test --test integration --features std,crypto
cargo test
```

## Running the SPDM Responder
Expand All @@ -122,25 +88,25 @@ cargo test --test integration --features std,crypto

Start the SPDM responder on default port 2323:
```bash
cargo run --example spdm_responder --features std,crypto
cargo run --example spdm_responder
```

### With Custom Port

```bash
cargo run --example spdm_responder --features std,crypto -- --port 8080
cargo run --example spdm_responder -- --port 8080
```

### With Verbose Logging

```bash
cargo run --example spdm_responder --features std,crypto -- --verbose
cargo run --example spdm_responder -- --verbose
```

### All Options

```bash
cargo run --example spdm_responder --features std,crypto -- \
cargo run --example spdm_responder -- \
--port 2323 \
--cert device_cert.pem \
--key device_key.pem \
Expand All @@ -165,7 +131,7 @@ The responder is compatible with the DMTF SPDM device validator:

1. **Start the responder:**
```bash
cargo run --example spdm_responder --features std,crypto -- --verbose
cargo run --example spdm_responder -- --verbose
```

2. **In another terminal, test with nc (netcat):**
Expand Down Expand Up @@ -200,7 +166,7 @@ openssl verify -CAfile root_ca.pem attestation.pem

1. Create a new file in `examples/`
2. Add necessary dependencies to `Cargo.toml` if needed
3. Build with: `cargo build --example your_example --features std,crypto`
3. Build with: `cargo build --example your_example`

### Modifying Certificates

Expand All @@ -210,7 +176,7 @@ The static certificates are in `examples/platform/certs.rs`. They were generated

Enable verbose logging to see detailed SPDM message processing:
```bash
RUST_LOG=debug cargo run --example spdm_responder --features std,crypto -- --verbose
RUST_LOG=debug cargo run --example spdm_responder -- --verbose
```

## Troubleshooting
Expand All @@ -221,7 +187,6 @@ If you encounter build errors:

1. **Update Rust**: `rustup update`
2. **Clean build**: `cargo clean && cargo build`
3. **Check features**: Ensure you're using `--features std,crypto`

### Connection Issues

Expand All @@ -235,7 +200,7 @@ If the responder doesn't accept connections:

If certificate-related errors occur:

1. **Run certificate test**: `cargo run --example test_static_certs --features std`
1. **Run certificate test**: `cargo run --example test_static_certs`
2. **Check certificate format**: Certificates are in DER format, not PEM
3. **Static certificates**: The responder uses hardcoded certificates, not files

Expand All @@ -249,7 +214,7 @@ Licensed under the Apache-2.0 license. See LICENSE file for details.
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Run `cargo test --features std,crypto`
5. Run `cargo test`
6. Submit a pull request

## Support
Expand All @@ -259,4 +224,4 @@ For issues and questions:
1. Check the troubleshooting section above
2. Run tests to verify your setup
3. Enable verbose logging for debugging
4. Check that certificates pass verification tests
4. Check that certificates pass verification tests
Loading
Loading