Bug 423973 - Adding Wireguard .conf file does not save pre-shared key
Summary: Adding Wireguard .conf file does not save pre-shared key
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Networking in general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Jan Grulich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-07 18:06 UTC by Thiago Sueto
Modified: 2024-12-23 18:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2020-07-07 18:06:09 UTC
SUMMARY
After adding a Wireguard .conf file to plasma-nm to add a new Wireguard VPN connection, the pre-shared key must be added manually before the VPN can connect. plasma-nm doesn't save it.

STEPS TO REPRODUCE
1. Have a WG server
2. Add peer and generate a .conf file for the client (easy to do with dsnet)
3. Add .conf file to client's plasma-nm
4. Ping server

OBSERVED RESULT
* plasma-nm shows a blank space in its pre-shared key text field
* Ping results in 100% package loss a.k.a. server unaccessible

EXPECTED RESULT
* plasma-nm shows the (hidden) pre-shared key in its text field
* Ping is successful and server is accessible

ADDITIONAL INFORMATION
Persistent Keepalive also shows a blank space and it does not save the provided value, but that's likely a different bug.
Comment 1 soshial 2021-04-17 06:57:12 UTC
Hey, Thiago. Thank you for submitting your wireguard plasma bug. May I ask you to have a look at my bug on the screensrecord: https://bugs.kde.org/show_bug.cgi?id=435603#c2

Do you think my bug is related to yours?
Comment 2 Thiago Sueto 2021-04-19 12:57:55 UTC
(In reply to soshial from comment #1)
> Hey, Thiago. Thank you for submitting your wireguard plasma bug. May I ask
> you to have a look at my bug on the screensrecord:
> https://bugs.kde.org/show_bug.cgi?id=435603#c2
> 
> Do you think my bug is related to yours?

Hello soshial. I don't think so. I believe I have experienced your bug as well, except the secrets part.
After I manually add the pre-shared key, the connection works fine, but I can experience your bug as well, so those two don't seem related.
Comment 3 eduardoreyesdpm 2022-06-06 16:29:20 UTC
I had the exact same problem with the pre-shared key...
For some reason I had to change the net mask from
255.255.255.255
To 
255.255.255.0

I don't know why it made the net mask
255.255.255.255 by default I wonder if that's a bug as well
Comment 4 james 2022-06-12 16:46:38 UTC
Experiencing this too. As a workaround you can import wireguard config files from the command line which works fine:

sudo nmcli connection import type wireguard file my-wireguard-config.conf
Comment 5 Alexander 2022-11-24 16:00:07 UTC
The same problem.
Importing wireguard config file with PresharedKey  parameter works fine, but if I import  same file via nm gui (Import VPN connection ...) the Preshared key field appears empty.
Comment 6 Bug Janitor Service 2023-04-12 16:23:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/242
Comment 7 Nicolas Fella 2023-04-29 14:46:15 UTC
Git commit 70e3d1e8a7ac87b23f313833985fd8d5e40ff885 by Nicolas Fella.
Committed on 29/04/2023 at 14:43.
Pushed by nicolasfella into branch 'master'.

Use nm_conn_wireguard_import to import WireGuard files

This is more robust than our hand-rolled implementation
Related: bug 420066, bug 468365, bug 452952, bug 427222

M  +12   -0    kcm/kcm.cpp

https://invent.kde.org/plasma/plasma-nm/commit/70e3d1e8a7ac87b23f313833985fd8d5e40ff885
Comment 8 Nicolas Fella 2023-04-29 14:46:59 UTC
Git commit 0237be91fd8a714efa3ef9d88c7ac157fcff488b by Nicolas Fella.
Committed on 29/04/2023 at 14:46.
Pushed by nicolasfella into branch 'Plasma/5.27'.

Use nm_conn_wireguard_import to import WireGuard files

This is more robust than our hand-rolled implementation
Related: bug 420066, bug 468365, bug 452952, bug 427222
(cherry picked from commit 70e3d1e8a7ac87b23f313833985fd8d5e40ff885)

M  +12   -0    kcm/kcm.cpp

https://invent.kde.org/plasma/plasma-nm/commit/0237be91fd8a714efa3ef9d88c7ac157fcff488b
Comment 9 Ben Cooksley 2024-12-23 18:23:39 UTC
Bulk transfer as requested in T17796