After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705162 - NM goes crazy after choosing certificate to use for VPN connection
NM goes crazy after choosing certificate to use for VPN connection
Status: RESOLVED OBSOLETE
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
0.9.8
Other Linux
: Normal major
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-07-30 18:04 UTC by Baptiste Mille-Mathias
Modified: 2020-11-12 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for properties/auth_helpers.c (582 bytes, patch)
2014-09-18 14:25 UTC, fralken
none Details | Review

Description Baptiste Mille-Mathias 2013-07-30 18:04:57 UTC
I start creating a VPN connection based on openvpn, and when it comes to select the User certificate, I choose it in the file-selector, and right-away NM UI gets stuck (no refresh, and becomes all greyish).
it happens wether I use nm-connection-editor or the network item of control-center.

Name        : NetworkManager
Arch        : x86_64
Epoch       : 1
Version     : 0.9.8.2
Release     : 8.git20130709.fc19


Stacktrace:
[Thread 0x7fffe9de6700 (LWP 4392) exited]

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

(nm-connection-editor:4365): Gtk-CRITICAL **: gtk_file_chooser_select_filename: assertion `filename != NULL' failed

(nm-connection-editor:4365): Gtk-CRITICAL **: gtk_file_chooser_select_filename: assertion `filename != NULL' failed

....

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote

** (nm-connection-editor:4365): WARNING **: Invalid setting VPN: remote
^C
Program received signal SIGINT, Interrupt.

(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7fc5a00 (LWP 4680))

  • #0 shaCompress
    from /lib64/libfreebl3.so
  • #1 SHA1_End
    from /lib64/libfreebl3.so
  • #2 nsspkcs5_PKCS12PBE.isra.2
    from /lib64/libsoftokn3.so
  • #3 nsspkcs5_ComputeKeyAndIV
    from /lib64/libsoftokn3.so
  • #4 NSC_GenerateKey
    from /lib64/libsoftokn3.so
  • #5 PK11_KeyGenWithTemplate
    from /lib64/libnss3.so
  • #6 pk11_TokenKeyGenWithFlagsAndKeyType
    from /lib64/libnss3.so
  • #7 pk11_RawPBEKeyGenWithKeyType
    from /lib64/libnss3.so
  • #8 PK11_PBEKeyGen
    from /lib64/libnss3.so
  • #9 sec_pkcs12_decoder_get_decrypt_key
    from /lib64/libsmime3.so
  • #10 sec_pkcs7_decoder_start_decrypt
    from /lib64/libsmime3.so
  • #11 sec_pkcs7_decoder_notify
    from /lib64/libsmime3.so
  • #12 SEC_ASN1DecoderUpdate_Util
    from /lib64/libnssutil3.so
  • #13 SEC_PKCS7DecoderUpdate
    from /lib64/libsmime3.so
  • #14 SEC_ASN1DecoderUpdate_Util
    from /lib64/libnssutil3.so
  • #15 sec_pkcs12_decoder_asafes_callback
    from /lib64/libsmime3.so
  • #16 sec_pkcs7_decoder_work_data
    from /lib64/libsmime3.so
  • #17 SEC_ASN1DecoderUpdate_Util
    from /lib64/libnssutil3.so
  • #18 SEC_PKCS7DecoderUpdate
    from /lib64/libsmime3.so
  • #19 sec_pkcs12_decode_asafes_cinfo_update
    from /lib64/libsmime3.so
  • #20 SEC_ASN1DecoderUpdate_Util
    from /lib64/libnssutil3.so
  • #21 SEC_PKCS12DecoderUpdate
    from /lib64/libsmime3.so
  • #22 crypto_verify_pkcs12
    at crypto_nss.c line 511
  • #23 crypto_is_pkcs12_data
    at crypto.c line 695
  • #24 crypto_verify_private_key_data
    at crypto.c line 739
  • #25 crypto_verify_private_key
    at crypto.c line 781
  • #26 nm_setting_802_1x_set_private_key
    at nm-setting-8021x.c line 1635
  • #27 is_pkcs12
    at utils.c line 41
  • #28 tls_cert_changed_cb
    at auth-helpers.c line 120
  • #29 g_closure_invoke
    at gclosure.c line 777
  • #30 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #31 g_signal_emit_valist
    at gsignal.c line 3328
  • #32 g_signal_emit_by_name
    at gsignal.c line 3424
  • #33 emit_selection_changed_if_changing_selection
    at gtkfilechooserbutton.c line 596
  • #34 update_label_and_image
    at gtkfilechooserbutton.c line 2640
  • #35 unselect_current_file
    at gtkfilechooserbutton.c line 672
  • #36 gtk_file_chooser_button_unselect_all
    at gtkfilechooserbutton.c line 696
  • #37 gtk_file_chooser_set_filename
    at gtkfilechooser.c line 1119
  • #38 tls_cert_changed_cb
    at auth-helpers.c line 121
  • #39 g_closure_invoke
    at gclosure.c line 777
  • #40 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #41 g_signal_emit_valist
    at gsignal.c line 3328
  • #42 g_signal_emit_by_name
    at gsignal.c line 3424
  • #43 emit_selection_changed_if_changing_selection
    at gtkfilechooserbutton.c line 596
  • #44 update_label_and_image
    at gtkfilechooserbutton.c line 2640
  • #45 unselect_current_file
    at gtkfilechooserbutton.c line 672
  • #46 gtk_file_chooser_button_unselect_all
    at gtkfilechooserbutton.c line 696
  • #47 gtk_file_chooser_set_filename
    at gtkfilechooser.c line 1119
  • #48 tls_cert_changed_cb
    at auth-helpers.c line 108
  • #49 g_closure_invoke
    at gclosure.c line 777
  • #50 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #51 g_signal_emit_valist
    at gsignal.c line 3328
  • #52 g_signal_emit_by_name
    at gsignal.c line 3424
  • #53 emit_selection_changed_if_changing_selection
    at gtkfilechooserbutton.c line 596
  • #54 update_label_get_info_cb
    at gtkfilechooserbutton.c line 2533
  • #55 query_info_callback
    at gtkfilesystem.c line 678
  • #56 g_task_return_now
    at gtask.c line 1105
  • #57 complete_in_idle_cb
    at gtask.c line 1114
  • #58 g_main_dispatch
    at gmain.c line 3054
  • #59 g_main_context_dispatch
    at gmain.c line 3630
  • #60 g_main_context_iterate
    at gmain.c line 3701
  • #61 g_main_loop_run
    at gmain.c line 3895
  • #62 main
    at main.c line 423

Comment 1 Jiri Klimes 2013-07-31 08:34:18 UTC
There is a problem with decoding the certificate.

Is the file correct/not corrupted?
What type of the certificate is it?
Does the certificate password contain any special characters?

To debug further we would need more information. It would be good if you install NetworkManager-debuginfo and reproduce again so that we have a backtrace with more details.

Do you happen to have a Big Endian machine (PowerPC)?
Comment 2 Baptiste Mille-Mathias 2013-07-31 09:03:33 UTC
Is the file correct/not corrupted?
- likely not, as I downloaded it on two different machines and tested on those two machines with the same result; however I'll try again.

What type of the certificate is it?
- PKCS#12

Does the certificate password contain any special characters?
- no

NetworkManager-debuginfo was IIRC installed because I did the backtrace twice, as the first time gdb suggest me to install this package, however I can try again.

Do you happen to have a Big Endian machine (PowerPC)?
- I don't have such machine.
Comment 3 Baptiste Mille-Mathias 2013-08-01 17:22:54 UTC
I confirm the answers above.
Comment 4 Baptiste Mille-Mathias 2013-08-06 09:02:41 UTC
Is there something I can do (new information, ...) to make this bug solved ?
Comment 5 Dan Winship 2013-08-06 13:23:17 UTC
(In reply to comment #4)
> Is there something I can do (new information, ...) to make this bug solved ?

send us the certificate file and password? :-)

it really looks like an NSS bug though.

Well... I guess you could interrupt it like above, and then see if  SEC_PKCS12DecoderUpdate() ever returns. If it doesn't, then it's (probably) NSS's fault. If it does return, then continue and see if you end up in the same place again; if so, then there's some bug in NM that's causing it to reload the certificate over and over in an infinite loop for some reason.
Comment 6 digger 2014-05-09 17:59:04 UTC
I have the exact same issue too.  I have had it for awhile, the workaround is that I use is to use the openvpn cli.


┌(linux-rocks)─(0)─(10:48 AM Fri May 09)
└─(~)─(7 files, 588Kb)─> cat /etc/os-release 
NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"


┌(linux-rocks)─(0)─(10:48 AM Fri May 09)
└─(~)─(7 files, 588Kb)─> uname -r
3.14.2-1-ARCH

┌(linux-rocks)─(0)─(10:15 AM Fri May 09)
└─(~)─(7 files, 588Kb)─> NetworkManager --version
0.9.8.10

Reference:
https://bbs.archlinux.org/viewtopic.php?id=177811

Since the update to the latest NetworkManager the output has changed, note the forum post.


May 09 10:52:58 linux-rocks gnome-control-center.desktop[4245]: (gnome-control-center:4245): network-cc-panel-WARNING **: Error connecting to ModemManager: Error calling StartServiceByName for org.freedesktop.ModemManager1: GDBus.Error:org.freedesktop.systemd1.LoadFailed: Unit dbus-org.freedesktop.ModemManager1.service failed to load: No such file or directory.
May 09 10:53:28 linux-rocks gnome-session[736]: Window manager warning: last_focus_time (9243686) is greater than comparison timestamp (9243685).  This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW.  Trying to work around...

I have two different VPN cert one is a new one and the other is a few years old and I know that it works in OpenSuSE and Fedora.  I have not tried the new cert in other distributions but it does work if I use the OpenVPN cli.
Comment 7 digger 2014-05-14 00:01:37 UTC
Okay, I figured out the issue.

For what ever reason the NetworkManager did not like the cert but I was able to us the openvpn cli just fine with it.  I am using the OpenVPN server packaged with Pfsense and when I download the certs through the web interface and use them in NetworkManager editor it acts all buggy.

But if I scp the cert from the Pfsense system it all works great!
Comment 8 fralken 2014-09-18 14:25:59 UTC
Created attachment 286503 [details] [review]
patch for properties/auth_helpers.c
Comment 9 fralken 2014-09-18 14:27:12 UTC
The problem is not related to the certificate, but it is simply how the dialog UI manages fields "user", "cert", "key" to be sure that either all of them contain the same pkcs12 file path or none of them contain it. This is implemented with event handlers triggered when field selections change.
Unfortunately this handlers are triggered in such a way that an endless loop occurs.

The affected library is /usr/lib/NetworkManager/libnm-openvpn-properties.so of package NetworkManager-openvpn-0.9.8.2

A patch is attached for the source properties/auth-helpers.c
Comment 10 André Klapper 2020-11-12 14:31:37 UTC
bugzilla.gnome.org is being shut down in favor of a GitLab instance. 
We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).