Bug 302451 - Import of openvpn config file doesn't set up cipher and tls-remote correctly.
Summary: Import of openvpn config file doesn't set up cipher and tls-remote correctly.
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Unmaintained
Component: OpenVPN (show other bugs)
Version: 0.9
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Lamarque V. Souza
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-24 16:35 UTC by Andreas Petzold
Modified: 2012-06-24 21:20 UTC (History)
0 users

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 Andreas Petzold 2012-06-24 16:35:47 UTC
When I import the openvpn config of my institution, the cipher type and "TLS subject match" field (tls-remote) are left empty, even though both values are specified in the config file.

I had a look at the relevant lines of code in openvpn.cpp and indeed the import of the tls-remote breaks the cipher type because of a copy&paste error. Here's a patch that cures the problem:

--- networkmanagement-0.9.0.2/vpnplugins/openvpn/openvpn.cpp    2012-05-07 18:16:57.000000000 +0200
+++ networkmanagement-0.9.0.2/vpnplugins/openvpn/myopenvpn.cpp  2012-06-24 13:55:01.990813867 +0200
@@ -411,7 +411,7 @@
         }
         if (key_value[0] == TLS_REMOTE_TAG) {
             if (!unQuote(key_value[1], fileName).isEmpty()) {
-                dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CIPHER), key_value[1]);
+                dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TLS_REMOTE), key_value[1]);
             }
             else {
                 KMessageBox::information(0, i18n("Unknown option: %1", line));






Reproducible: Always

Steps to Reproduce:
1. in the connection manager import a file with the config data of a VPN connection 
2.
3.
Actual Results:  
After the import, cipher and tls-remote fields are empty

Expected Results:  
After the import, cipher and tls-remote fields are filled with the values from the openvpn file
Comment 1 Lamarque V. Souza 2012-06-24 20:45:40 UTC
Git commit 27756ff4084615f2688d599ba3e48f9b24c1adbf by Lamarque V. Souza.
Committed on 24/06/2012 at 22:44.
Pushed by lvsouza into branch 'master'.

Fix import of openvpn configuration files.

M  +1    -1    plasma_nm_version.h
M  +1    -1    vpnplugins/openvpn/openvpn.cpp

http://commits.kde.org/networkmanagement/27756ff4084615f2688d599ba3e48f9b24c1adbf
Comment 2 Lamarque V. Souza 2012-06-24 21:20:25 UTC
Git commit 3710bd9c811c538263e3c5f3d4e8999b6f71343f by Lamarque V. Souza.
Committed on 24/06/2012 at 22:44.
Pushed by lvsouza into branch 'nm09'.

Fix import of openvpn configuration files.

M  +1    -1    plasma_nm_version.h
M  +1    -1    vpnplugins/openvpn/openvpn.cpp

http://commits.kde.org/networkmanagement/3710bd9c811c538263e3c5f3d4e8999b6f71343f