Draft
Conversation
Stored PSKs (~/.bw-remote/psk_*.hex) are loaded on every listener startup and accepted for incoming handshakes regardless of pairing mode. The new --psk-reusable [name] flag generates a persistent PSK for CI/automation use cases where the token must survive restarts. - Add Psk::id() (first 4 bytes of SHA-256) for keychain lookup - Add psk_id field to HandshakeInit for multi-PSK disambiguation - Change UserClient from single PSK to HashMap-based PSK keychain - Add PskStorage for persistent hex-encoded PSK files - Update enable_psk() to accept an explicit PSK parameter
- Extract shared ensure_storage_dir() in storage/mod.rs, used by both FileIdentityStorage and PskStorage (removes duplicated home dir + mkdir logic) - Psk::Debug now delegates to self.id() instead of duplicating SHA-256 - load_psks() takes impl IntoIterator<Item = Psk> instead of leaking the internal HashMap<[u8; 4], Psk> key format to callers - PskStorage::load_all() returns Vec<Psk> instead of HashMap
|
|
Great job! No new security vulnerabilities introduced in this pull request |
abergs
commented
Mar 9, 2026
| use sha2::{Digest, Sha256 as Sha256Hash}; | ||
| let hash = Sha256Hash::digest(self.0); | ||
| [hash[0], hash[1], hash[2], hash[3]] | ||
| } |
Member
Author
There was a problem hiding this comment.
is 4 bytes enough? I believe it is.
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.




🎟️ Tracking
📔 Objective
For use cases where the client is ephmeral, or lack proper storage for a noise tunnel, allow re-using a PSK.
This allows for use cases like Github Action.
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes