Skip to content

refactor(core): move session keys to platform secure storage#67

Open
Grolleau-Benjamin wants to merge 2 commits intoSTMicroelectronics:mainfrom
Grolleau-Benjamin:refactor-key-management
Open

refactor(core): move session keys to platform secure storage#67
Grolleau-Benjamin wants to merge 2 commits intoSTMicroelectronics:mainfrom
Grolleau-Benjamin:refactor-key-management

Conversation

@Grolleau-Benjamin
Copy link
Contributor

Summary

Session keys are no longer kept in RAM. It is now up to the user to decide where they are stored, referencing them via a uint32_t key index.

This improves security, enables backend-agnostic key management, and allows integration with PSA and TrustZone Secure Storage.

Changes

  • Add secure session key storage via stse_platform_store_session_key
  • Session now tracks Host_MAC_key_idx and Host_cipher_key_idx
  • Wipe plaintext session keys from RAM after storage
  • Use key indices for AES ECB / CBC / CMAC operations

Security

  • Session keys no longer persist in RAM
  • Enables hardware-backed key protection

Note

STSELib remains backend-agnostic (no PSA assumption). The platform decides how keys are stored and used.

@TofMassilia13320
Copy link
Contributor

Branch is out-of-date with the base branch.
Please rebase!
Tx for your contribution.

@Grolleau-Benjamin
Copy link
Contributor Author

@TofMassilia13320
This should be fine, I’ve just rebased.

Maybe we should add a Discussions section to this repository, or create a Discord server to discuss this kind of change. It could also be useful to maintain a changelog. Your last change introduced a regression that could have been flagged through a proper changelog process (and I also introduced a huge regression in this PR).

Signed-off-by: Benjamin Grolleau <benjamin.grolleau@outlook.com>
Signed-off-by: Benjamin Grolleau <benjamin.grolleau@outlook.com>
@Grolleau-Benjamin Grolleau-Benjamin force-pushed the refactor-key-management branch from 4de1a70 to 99f3889 Compare March 5, 2026 09:16
@Grolleau-Benjamin
Copy link
Contributor Author

Hi @TofMassilia13320,

I've just rebased my branch on prepare v1.1.7.

I also discovered the release notes (doc/resources/Markdown/02_RELEASE_NOTE/release_note.md) by reviewing the commit you just added. Since it currently lists the raw commit history, I was wondering if we could switch to a more user-centric format? Grouping updates by "Added", "Changed", "Fixed", and "Breaking Changes" is usually much easier for users to digest than reading through Git commit messages.

Additionally, it might make more sense to maintain a classic CHANGELOG.md directly at the root of the repository. It's the standard location most developers and users instinctively look for, making it much easier to track the project's evolution at a glance. Furthermore, this location permit to easily add the content to the release note using GitHub CI/CD.

Let me know what your thoughts are on this!

@Grolleau-Benjamin
Copy link
Contributor Author

Looking at the commits, I also believe that @Grom- would be interested in this discussion.

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