applications: nrf5340_audio: Automatic SIRK generation#27992
applications: nrf5340_audio: Automatic SIRK generation#27992alexsven wants to merge 1 commit intonrfconnect:mainfrom
Conversation
alexsven
commented
Apr 9, 2026
- Generate SIRK based on username when using buildprog
- OCT-3666
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:more detailsGithub labels
List of changed files detected by CI (0)Outputs:ToolchainVersion: Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
| ------------- | ||
|
|
||
| |no_changes_yet_note| | ||
| * Added SIRK generation based on the username when using the :file:`buildprog.py` Python script for the nRF5340 Audio unicast client sample. |
There was a problem hiding this comment.
Please remove the entry from here and add a comment on PR #27915, if this is part of the 3.3.0 release.
|
You can find the documentation preview for this PR here. |
| """ | ||
|
|
||
| user_name = getpass.getuser() | ||
| # encrypt username using sha256 to get a unique but consistent SIRK across runs |
There was a problem hiding this comment.
Do a try: catch: here to check that the user name is not 0 len / empty
|
|
||
| |no_changes_yet_note| | ||
| * Added SIRK generation based on the username when using the :file:`buildprog.py` Python script for the nRF5340 Audio unicast client sample. | ||
| The SIRK is generated using the SHA-256 hash of the username, ensuring a unique but consistent SIRK across runs for the same username. |
There was a problem hiding this comment.
| The SIRK is generated using the SHA-256 hash of the username, ensuring a unique but consistent SIRK across runs for the same username. | |
| The SIRK is generated using parts of the SHA-256 hash of the username, aiming to obtain a unique but consistent SIRK across runs for the same username. |
| |no_changes_yet_note| | ||
| * Added SIRK generation based on the username when using the :file:`buildprog.py` Python script for the nRF5340 Audio unicast client sample. | ||
| The SIRK is generated using the SHA-256 hash of the username, ensuring a unique but consistent SIRK across runs for the same username. | ||
| This change allows users to have a unique SIRK without needing to manually generate and input it, simplifying the setup process for the unicast client sample. |
There was a problem hiding this comment.
This change is good, but please also add a note on this in the user guide.
| This is the same every time this script is run, but unique across different machines | ||
| """ | ||
|
|
||
| user_name = getpass.getuser() |
There was a problem hiding this comment.
This is may be troubling as getuser can be of very low entropy.
Would like to have someone with more experience to have a look.
Alternatively, we can add a field to the .json file which is read out. If this is default, buildprog stops.
There was a problem hiding this comment.
Pull request overview
This PR adds automatic generation of a CSIP SIRK when using the nRF5340 Audio buildprog.py script, aiming to avoid manual SIRK setup and keep the generated value consistent per user.
Changes:
- Add SHA-256(username)-based SIRK generation to
buildprog.py. - Inject the generated SIRK into the west build via
CONFIG_BT_SET_IDENTITY_RESOLVING_KEYfor the unicast headset/server build. - Update nRF5340 Audio release notes to mention the new behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst | Adds a release note entry describing automatic SIRK generation in the build script. |
| applications/nrf5340_audio/tools/buildprog/buildprog.py | Generates a deterministic SIRK from the local username and passes it as a Kconfig define during build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
1d92cba to
5927d83
Compare
- Generate SIRK based on username when using buildprog - OCT-3666 Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
5927d83 to
230e336
Compare