Add simulator for STSAFE A120#2
Merged
dgarske merged 2 commits intowolfSSL:mainfrom Apr 30, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new STSAFE-A120 secure-element simulator (Rust) plus end-to-end integration test harnesses (STSELib/OpenSSL and wolfCrypt) and CI workflows so the STSAFE-A120 path can be regression-tested without hardware.
Changes:
- Introduces
stsafe-a120-simRust crate implementing STSAFE-A framing, CRC, dispatch, and handlers (RNG/ECDSA/ECDH/read/query/echo) with an optional persisted object store and a TCP server binary. - Adds STSELib “PAL over TCP” + OpenSSL cross-verification smoke tests and a wolfCrypt-focused smoke test program, each runnable via Docker.
- Adds GitHub Actions workflows to run
cargo test, SDK tests, and wolfCrypt integration tests in CI.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| STSAFEA120Sim/wolfcrypt-test/run_test.sh | Runner script to start simulator and execute wolfCrypt smoke test |
| STSAFEA120Sim/wolfcrypt-test/main.c | wolfCrypt + STSAFE-A120 simulator smoke test (RNG/ECDSA/ECDH) |
| STSAFEA120Sim/stsafe-a120-sim/tests/tcp.rs | TCP end-to-end tests against tcp_server binary |
| STSAFEA120Sim/stsafe-a120-sim/tests/dispatch.rs | Byte-level dispatch/handler tests covering opcodes and framing behavior |
| STSAFEA120Sim/stsafe-a120-sim/src/session.rs | Per-connection volatile session state |
| STSAFEA120Sim/stsafe-a120-sim/src/object_store/types.rs | Persisted device model types (slots/zones/curve kinds) |
| STSAFEA120Sim/stsafe-a120-sim/src/object_store/mod.rs | Store load/init, persistence, and fresh provisioning (serial/key/cert) |
| STSAFEA120Sim/stsafe-a120-sim/src/lib.rs | Crate module exports and public API surface |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/verify.rs | Verify-signature command handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/sign.rs | Generate-signature command handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/read.rs | Data-zone read handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/random.rs | Random-bytes handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/query.rs | Minimal Query(PRODUCT_DATA) handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/mod.rs | Handler module wiring + constants (curve id, point repr) |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/keypair.rs | Generate key-pair handler and slot provisioning |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/echo.rs | Echo handler |
| STSAFEA120Sim/stsafe-a120-sim/src/handlers/ecdh.rs | Establish-key (ECDH) handler |
| STSAFEA120Sim/stsafe-a120-sim/src/frame.rs | Command parsing + response/command building + framing rules |
| STSAFEA120Sim/stsafe-a120-sim/src/dispatch.rs | Opcode dispatch and error mapping |
| STSAFEA120Sim/stsafe-a120-sim/src/crc.rs | CRC-16/X-25 implementation with tests |
| STSAFEA120Sim/stsafe-a120-sim/src/bin/tcp_server.rs | TCP server front-end for simulator dispatch + store persistence |
| STSAFEA120Sim/stsafe-a120-sim/Cargo.toml | Rust crate metadata and dependencies |
| STSAFEA120Sim/sdk-test/test_stsafe.c | STSELib API-level smoke tests with OpenSSL cross-checks |
| STSAFEA120Sim/sdk-test/test_helpers.h | Assertion macros used by sdk-test binary |
| STSAFEA120Sim/sdk-test/stse_platform_generic.h | STSELib platform typedefs for Linux builds |
| STSAFEA120Sim/sdk-test/stse_conf.h | STSELib feature config for simulator build |
| STSAFEA120Sim/sdk-test/run_test.sh | Runner script to start simulator and execute STSELib/OpenSSL tests |
| STSAFEA120Sim/sdk-test/pal_tcp.h | PAL TCP transport header and env var docs |
| STSAFEA120Sim/sdk-test/pal_tcp.c | PAL implementation tunneling STSELib I2C surface over TCP |
| STSAFEA120Sim/README.md | Documentation for features, protocol, env vars, and Docker usage |
| STSAFEA120Sim/LICENSE | GPLv3 license text |
| STSAFEA120Sim/Dockerfile.wolfcrypt | Docker build for simulator + STSELib + wolfSSL + wolfCrypt smoke test |
| STSAFEA120Sim/Dockerfile.sdk-test | Docker build for simulator + STSELib + OpenSSL sdk-test binary |
| STSAFEA120Sim/Dockerfile | Docker build for running Rust unit/integration tests |
| STSAFEA120Sim/.gitignore | Ignore Rust build outputs and persisted store file |
| .github/workflows/stsafe-a120-wolfcrypt-test.yml | CI workflow running wolfCrypt integration via Docker |
| .github/workflows/stsafe-a120-test-suite.yml | CI workflow running cargo test |
| .github/workflows/stsafe-a120-sdk-test.yml | CI workflow running SDK/OpenSSL cross-verification via Docker |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Some minor patches needed for wolfCrypt, they will be addressed when integrating into wolfCrypt's CI
dgarske
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some minor patches needed for wolfCrypt, they will be addressed when integrating into wolfCrypt's CI