Skip to content

Add simulator for STSAFE A120#2

Merged
dgarske merged 2 commits intowolfSSL:mainfrom
LinuxJedi:stsafe
Apr 30, 2026
Merged

Add simulator for STSAFE A120#2
dgarske merged 2 commits intowolfSSL:mainfrom
LinuxJedi:stsafe

Conversation

@LinuxJedi
Copy link
Copy Markdown
Member

Some minor patches needed for wolfCrypt, they will be addressed when integrating into wolfCrypt's CI

Copilot AI review requested due to automatic review settings April 30, 2026 07:28
@LinuxJedi LinuxJedi requested a review from dgarske April 30, 2026 07:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-sim Rust 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.

Comment thread STSAFEA120Sim/stsafe-a120-sim/src/handlers/sign.rs Outdated
Comment thread STSAFEA120Sim/stsafe-a120-sim/src/handlers/sign.rs Outdated
Comment thread STSAFEA120Sim/sdk-test/run_test.sh
Comment thread STSAFEA120Sim/stsafe-a120-sim/src/handlers/verify.rs Outdated
Comment thread STSAFEA120Sim/stsafe-a120-sim/src/handlers/verify.rs Outdated
Comment thread STSAFEA120Sim/stsafe-a120-sim/src/object_store/types.rs
Comment thread STSAFEA120Sim/wolfcrypt-test/main.c
Comment thread STSAFEA120Sim/wolfcrypt-test/main.c
Comment thread STSAFEA120Sim/wolfcrypt-test/run_test.sh
Comment thread STSAFEA120Sim/stsafe-a120-sim/src/bin/tcp_server.rs Outdated
Some minor patches needed for wolfCrypt, they will be addressed when
integrating into wolfCrypt's CI
@dgarske dgarske merged commit 7e4a50a into wolfSSL:main Apr 30, 2026
9 checks passed
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.

4 participants