Bug 1157817 - [RFE] Allow importing inline OpenVPN certificates (e.g. frootvpn.com)
Summary: [RFE] Allow importing inline OpenVPN certificates (e.g. frootvpn.com)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1267252 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-27 18:29 UTC by Mikhail
Modified: 2016-03-29 14:25 UTC (History)
7 users (show)

Fixed In Version: NetworkManager-1.0.10-2.fc23 NetworkManager-1.0.10-2.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-08 20:54:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot of NetworkManager (138.07 KB, image/png)
2014-10-27 18:29 UTC, Mikhail
no flags Details
frootvpn.ovpn (5.82 KB, text/plain)
2014-10-27 18:30 UTC, Mikhail
no flags Details

Description Mikhail 2014-10-27 18:29:18 UTC
Created attachment 951110 [details]
screenshot of NetworkManager

Description of problem:
NetworkManager couldn't import frootvpn.ovpn (add button is inactive)

https://www.frootvpn.com/

Comment 1 Mikhail 2014-10-27 18:30:12 UTC
Created attachment 951112 [details]
frootvpn.ovpn

Comment 2 Ward Wouts 2014-11-28 16:59:12 UTC
I see the exact same problem.

Comment 3 Fedora Admin XMLRPC Client 2015-08-18 14:57:40 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Jirka Klimes 2015-09-29 13:27:25 UTC
*** Bug 1267252 has been marked as a duplicate of this bug. ***

Comment 5 Jirka Klimes 2015-10-22 11:17:46 UTC
Implemented and pushed to upstream branch jk/rh1157817-import-inline-certs

Comment 6 Lubomir Rintel 2015-10-26 14:30:55 UTC
Looks fine in general.

I'm wondering why you're treating EEXIST specially? What if ~/.cert exists and is not a directory?

+       /* If the dir doesn't exist, create it */
+       if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
+               if (mkdir (dirname, 0755) < 0) {
+                       if (errno != EEXIST)
+                               goto finish;
+               }
+       }

Also, could you drop the start_tag and end_tag arguments? They're probably inferrable from key in the same way as you infer blob_mark_start and blob_mark_end.

+static gboolean
+handle_blob_item (const char **line,
+                  const char *start_tag,
+                  const char *end_tag,
+                  const char *key,
+                  NMSettingVPN *s_vpn,
+                  const char *name,
+                  GError **error)

Comment 7 Mikhail 2015-10-26 14:51:46 UTC
Can you also look into this:
https://bugzilla.redhat.com/show_bug.cgi?id=1074830
needed always place certificates in ~/.cert directory even when they stored separately.

Comment 8 Beniamino Galvani 2015-10-26 15:11:24 UTC
+       while (*p && strcmp (*p, blob_mark_end)) {
+               g_string_append (in_file, *p);
+               g_string_append_c (in_file, '\n');
+               p++;
+       }
+       p++;
+       if (strncmp (*p, end_tag, strlen (end_tag)))

If the file doesn't contain the end tag, *p becomes NULL then p is
incremented and dereferenced again. I think this is wrong.

+               if (handle_blob_item ((const char **)line, CA_BLOB_START_TAG, CA_BLOB_END_TAG,
+                                     NM_OPENVPN_KEY_CA, s_vpn, basename, NULL))
+                       continue;

Shouldn't we pass &line, so that the function can move the pointer
forward and the blob lines are not evaluated again?

Comment 9 Jirka Klimes 2015-10-27 13:08:45 UTC
(In reply to Lubomir Rintel from comment #6)
> Looks fine in general.
> 
> I'm wondering why you're treating EEXIST specially? What if ~/.cert exists
> and is not a directory?
> 
> +       /* If the dir doesn't exist, create it */
> +       if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
> +               if (mkdir (dirname, 0755) < 0) {
> +                       if (errno != EEXIST)
> +                               goto finish;
> +               }
> +       }
> 
You are right. Fixed that.

> Also, could you drop the start_tag and end_tag arguments? They're probably
> inferrable from key in the same way as you infer blob_mark_start and
> blob_mark_end.
> 
> +static gboolean
> +handle_blob_item (const char **line,
> +                  const char *start_tag,
> +                  const char *end_tag,
> +                  const char *key,
> +                  NMSettingVPN *s_vpn,
> +                  const char *name,
> +                  GError **error)
Done.


(In reply to Beniamino Galvani from comment #8)
> +       while (*p && strcmp (*p, blob_mark_end)) {
> +               g_string_append (in_file, *p);
> +               g_string_append_c (in_file, '\n');
> +               p++;
> +       }
> +       p++;
> +       if (strncmp (*p, end_tag, strlen (end_tag)))
> 
> If the file doesn't contain the end tag, *p becomes NULL then p is
> incremented and dereferenced again. I think this is wrong.
> 
Fixed.

> +               if (handle_blob_item ((const char **)line,
> CA_BLOB_START_TAG, CA_BLOB_END_TAG,
> +                                     NM_OPENVPN_KEY_CA, s_vpn, basename,
> NULL))
> +                       continue;
> 
> Shouldn't we pass &line, so that the function can move the pointer
> forward and the blob lines are not evaluated again?
Done.

Comment 10 Lubomir Rintel 2015-10-27 14:35:53 UTC
Fine with me now.

Comment 11 Jirka Klimes 2015-10-30 11:10:19 UTC
Committed upstream:
master: 4a9d93a import: allow importing configurations with inline certificates (rh #1157817)
nm-1-0: dcf7f4d import: allow importing configurations with inline certificates (rh #1157817)

Comment 12 Fedora End Of Life 2015-11-04 15:49:56 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora Update System 2015-11-24 11:19:13 UTC
NetworkManager-vpnc-1.0.8-1.fc23 NetworkManager-openconnect-1.0.8-1.fc23 NetworkManager-openvpn-1.0.8-1.fc23 NetworkManager-openswan-1.0.8-1.fc23 NetworkManager-fortisslvpn-1.0.8-1.fc23 NetworkManager-1.0.8-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 14 Fedora Update System 2015-11-24 11:23:06 UTC
NetworkManager-vpnc-1.0.8-1.fc22 NetworkManager-openconnect-1.0.8-1.fc22 NetworkManager-openvpn-1.0.8-1.fc22 NetworkManager-openswan-1.0.8-1.fc22 NetworkManager-fortisslvpn-1.0.8-1.fc22 NetworkManager-1.0.8-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 15 Fedora Update System 2015-11-25 02:53:48 UTC
NetworkManager-1.0.8-1.fc23, NetworkManager-fortisslvpn-1.0.8-1.fc23, NetworkManager-openconnect-1.0.8-1.fc23, NetworkManager-openswan-1.0.8-1.fc23, NetworkManager-openvpn-1.0.8-1.fc23, NetworkManager-vpnc-1.0.8-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update NetworkManager NetworkManager-fortisslvpn NetworkManager-openswan NetworkManager-openvpn NetworkManager-openconnect NetworkManager-vpnc'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 16 Fedora Update System 2015-11-26 02:26:44 UTC
NetworkManager-1.0.8-1.fc22, NetworkManager-fortisslvpn-1.0.8-1.fc22, NetworkManager-openconnect-1.0.8-1.fc22, NetworkManager-openswan-1.0.8-1.fc22, NetworkManager-openvpn-1.0.8-1.fc22, NetworkManager-vpnc-1.0.8-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update NetworkManager NetworkManager-fortisslvpn NetworkManager-openswan NetworkManager-openvpn NetworkManager-openconnect NetworkManager-vpnc'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 17 Fedora Update System 2015-12-23 15:09:49 UTC
NetworkManager-1.0.10-1.fc23 NetworkManager-fortisslvpn-1.0.8-1.fc23 NetworkManager-openconnect-1.0.8-1.fc23 NetworkManager-openswan-1.0.8-1.fc23 NetworkManager-openvpn-1.0.8-1.fc23 NetworkManager-vpnc-1.0.8-1.fc23 network-manager-applet-1.0.10-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 18 Fedora Update System 2015-12-23 15:10:29 UTC
NetworkManager-fortisslvpn-1.0.8-1.fc22 NetworkManager-openconnect-1.0.8-1.fc22 NetworkManager-openswan-1.0.8-1.fc22 NetworkManager-openvpn-1.0.8-1.fc22 NetworkManager-vpnc-1.0.8-1.fc22 network-manager-applet-1.0.10-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 19 Fedora Update System 2015-12-25 01:58:52 UTC
NetworkManager-1.0.10-1.fc23, NetworkManager-fortisslvpn-1.0.8-1.fc23, NetworkManager-openconnect-1.0.8-1.fc23, NetworkManager-openswan-1.0.8-1.fc23, NetworkManager-openvpn-1.0.8-1.fc23, NetworkManager-vpnc-1.0.8-1.fc23, network-manager-applet-1.0.10-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 20 Fedora Update System 2015-12-30 20:58:14 UTC
NetworkManager-1.0.10-1.fc22, NetworkManager-fortisslvpn-1.0.8-1.fc22, NetworkManager-openconnect-1.0.8-1.fc22, NetworkManager-openswan-1.0.8-1.fc22, NetworkManager-openvpn-1.0.8-1.fc22, NetworkManager-vpnc-1.0.8-1.fc22, network-manager-applet-1.0.10-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 21 Fedora Update System 2016-01-05 14:06:10 UTC
NetworkManager-1.0.10-2.fc23 NetworkManager-fortisslvpn-1.0.8-1.fc23 NetworkManager-openconnect-1.0.8-1.fc23 NetworkManager-openswan-1.0.8-1.fc23 NetworkManager-openvpn-1.0.8-1.fc23 NetworkManager-vpnc-1.0.8-1.fc23 network-manager-applet-1.0.10-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 22 Fedora Update System 2016-01-05 14:16:40 UTC
NetworkManager-1.0.10-2.fc22 NetworkManager-fortisslvpn-1.0.8-1.fc22 NetworkManager-openconnect-1.0.8-1.fc22 NetworkManager-openswan-1.0.8-1.fc22 NetworkManager-openvpn-1.0.8-1.fc22 NetworkManager-vpnc-1.0.8-1.fc22 network-manager-applet-1.0.10-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 23 Fedora Update System 2016-01-06 00:25:49 UTC
NetworkManager-1.0.10-2.fc22, NetworkManager-fortisslvpn-1.0.8-1.fc22, NetworkManager-openconnect-1.0.8-1.fc22, NetworkManager-openswan-1.0.8-1.fc22, NetworkManager-openvpn-1.0.8-1.fc22, NetworkManager-vpnc-1.0.8-1.fc22, network-manager-applet-1.0.10-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-efc06edc85

Comment 24 Fedora Update System 2016-01-06 00:30:23 UTC
NetworkManager-1.0.10-2.fc23, NetworkManager-fortisslvpn-1.0.8-1.fc23, NetworkManager-openconnect-1.0.8-1.fc23, NetworkManager-openswan-1.0.8-1.fc23, NetworkManager-openvpn-1.0.8-1.fc23, NetworkManager-vpnc-1.0.8-1.fc23, network-manager-applet-1.0.10-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2ae867c402

Comment 25 Fedora Update System 2016-01-08 20:53:57 UTC
NetworkManager-1.0.10-2.fc23, NetworkManager-fortisslvpn-1.0.8-1.fc23, NetworkManager-openconnect-1.0.8-1.fc23, NetworkManager-openswan-1.0.8-1.fc23, NetworkManager-openvpn-1.0.8-1.fc23, NetworkManager-vpnc-1.0.8-1.fc23, network-manager-applet-1.0.10-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2016-01-21 04:49:36 UTC
NetworkManager-1.0.10-2.fc22, NetworkManager-fortisslvpn-1.0.8-1.fc22, NetworkManager-openconnect-1.0.8-1.fc22, NetworkManager-openswan-1.0.8-1.fc22, NetworkManager-openvpn-1.0.8-1.fc22, NetworkManager-vpnc-1.0.8-1.fc22, network-manager-applet-1.0.10-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.