Skip to content

SE050Sim: optional object store persistence via SE050_SIM_STORE - #22

Open
mcamposv wants to merge 1 commit into
wolfSSL:mainfrom
shosoin:store-persistence-env
Open

mcamposv wants to merge 1 commit into
wolfSSL:mainfrom
shosoin:store-persistence-env

Conversation

@mcamposv

@mcamposv mcamposv commented Nov 1, 2026

Copy link
Copy Markdown

The SE050Sim TCP server always starts with an empty object store, although ObjectStore::with_persistence already
exists. This wires it to an environment variable: with SE050_SIM_STORE=/path/store.json the simulated chip keeps its
objects (keys, counters, curves, Platform SCP03 keys) across restarts, like a real SE05x. Unset, nothing changes.

We use it to keep a simulated SE05x running as a lab service (in a container, with a volume) behind a hardware I2C
bridge, so firmware under development finds its keys after the simulator restarts.

We drive the simulator from real microcontrollers over I2C through a small ESP32-S3 bridge, https://github.com/shosoin/se05x-lab-bridge, in case it is useful to others.

🤖 Generated with Claude Code

The TCP server always started with an empty store. With SE050_SIM_STORE=<path>
it uses ObjectStore::with_persistence, so a simulated chip keeps its objects
(keys, counters, Authentication Objects) across restarts, like a real one.
Unset, nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The optional object-store persistence change has no active review issues.

No open issues 🎉

What changed in this PR

Enables optional object-store persistence in the SE050Sim TCP server by connecting SE050_SIM_STORE to the existing persistence implementation.

Changes:

  • Loads a persistent store when SE050_SIM_STORE specifies a nonempty path, allowing simulated objects to survive restarts.
  • Preserves in-memory behavior when the variable is unset or empty.
File Description
SE050Sim/​se050-sim/​src/​bin/​tcp_server.rs Selects persistent or in-memory storage based on SE050_SIM_STORE and logs the configured persistence path.

Review effort: Balanced

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