Skip to content
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

wireguard: T5413: Blocked adding the peer with the router's public key #2122

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

aapostoliuk
Copy link
Contributor

Change Summary

Disabeled adding the peer with the same public key as the router has.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

wireguard

Proposed changes

Disabeled adding the peer with the same public key as the router has.

How to test

Key pair generation

vyos@vyos:~$ generate pki wireguard key-pair
Private key: oA2mjnxYxccfIFxnNfOZSrcJJiRl7kr9Qee999qywnY=
Public key: vu1n32sZC39x97i5wXRWb62KBCsj+UGVigwdmr4uhzg=

Configuration:

set interfaces wireguard wg1 address '10.0.0.1/24'
set interfaces wireguard wg1 peer TEST address '192.168.139.20'
set interfaces wireguard wg1 peer TEST allowed-ips '10.0.1.0/24'
set interfaces wireguard wg1 peer TEST port '51569'
set interfaces wireguard wg1 peer TEST public-key 'vu1n32sZC39x97i5wXRWb62KBCsj+UGVigwdmr4uhzg='
set interfaces wireguard wg1 private-key 'oA2mjnxYxccfIFxnNfOZSrcJJiRl7kr9Qee999qywnY='

Before changes:

vyos@vyos# commit
vyos@vyos:~$ sudo wg show

interface: wg1
  public key: vu1n32sZC39x97i5wXRWb62KBCsj+UGVigwdmr4uhzg=
  private key: (hidden)
  listening port: 57089

After changes:

vyos@vyos# commit

Peer "TEST" has the same public key as the router"

[[interfaces wireguard wg1]] failed
Commit failed
[edit]

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team July 31, 2023 14:03
src/conf_mode/interfaces-wireguard.py Outdated Show resolved Hide resolved
src/migration-scripts/interfaces/29-to-30 Outdated Show resolved Hide resolved
src/conf_mode/interfaces-wireguard.py Outdated Show resolved Hide resolved
@c-po
Copy link
Member

c-po commented Jul 31, 2023

Other then my small change request its a very good addition!

Oh, and can you please also provide a smoketest testing this scenario?

Disabeled adding the peer with the same public key as the router has.
Added smoketest
@c-po c-po merged commit ea30c03 into vyos:current Aug 2, 2023
5 of 6 checks passed
aapostoliuk added a commit to aapostoliuk/vyos-1x that referenced this pull request Nov 24, 2023
Disabeled adding the peer with the same public key as the router has.
Backport from current
vyos#2122
aapostoliuk added a commit to aapostoliuk/vyos-1x that referenced this pull request Nov 24, 2023
Disabled adding the peer with the same public key as the router has.
Backport from current
vyos#2122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants