Skip to content

[client] Fix Rosenpass permissive mode handling #3689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

pappz
Copy link
Contributor

@pappz pappz commented Apr 16, 2025

Describe your changes

Between two agents, if both have enabled Rosenpass but only one side is set to permissive mode, the WireGuard handshake never occurs.

Figure out the proper preshared key setting for WrieGuard after the connection, based on the offer-answer signaling messages.

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@pappz pappz marked this pull request as ready for review April 16, 2025 10:30
@Copilot Copilot AI review requested due to automatic review settings April 16, 2025 10:30
Copy link
Contributor

@Copilot 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

This PR fixes the Rosenpass preshared key handling to enable successful WireGuard handshakes when one side is in permissive mode. Key changes include:

  • Updating field accesses from RosenpassPubKey/RosenpassAddr to RosenpassConfig.PubKey/RosenpassConfig.Addr.
  • Modifying the preshared key computation logic to account for permissive mode.
  • Revising peer configuration in the Engine to use the new RosenpassConfig struct.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
client/internal/peer/handshaker.go Updated offer/answer messages to use RosenpassConfig fields.
client/internal/peer/conn_test.go Added tests for various Rosenpass permissive/enabled scenarios.
client/internal/peer/conn.go Modified connection configuration and preshared key logic.
client/internal/engine.go Updated peer connection creation to use RosenpassConfig.
Comments suppressed due to low confidence (1)

client/internal/peer/conn.go:815

  • [nitpick] Consider renaming function 'rosenpassDetermKey' to 'rosenpassDetermineKey' for improved clarity.
func (conn *Conn) rosenpassDetermKey() (*wgtypes.Key, error) {

@mlsmaycon mlsmaycon merged commit c38e07d into main Apr 16, 2025
4 checks passed
@mlsmaycon mlsmaycon deleted the fix/rosenpass-permissive branch April 16, 2025 14:04
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.

3 participants