Skip to content

src/nma-file-cert-chooser.c: Fixup handing of the cert/key_changed_cb

Eivind Næss requested to merge (removed):en/certificate-input into master

Closes: #6 (closed)

One issue is with libgtk3 calling 'unselect_all()' prior to selecting the file. That issue was fixed here:

https://gitlab.gnome.org/GNOME/gtk/issues/2497

However, seeking an improved fix that will work independently of the gtk3 issue(s). This change will fix the following:

  1. Do not clear the password from key_changed_cb()
  2. Fixup the set_uri() functions for key and certificate

One of the key differences is that the unselect_all() function will fire off a "changed" signal immediately and the logic in e.g. key_changed_cb() encounters an empty key value and ignores the rest of the logic to properly detect pkcs12 certificate, etc. This is the reason for 2).

Having corrected 2), the 'changed' signal processing was firing much less frequently and thus the NM plugins can now initialize themselves by setting cert, key, and password as normal. The 'changed' processing is then driven from the main-loop instead of in-place. This caused a problem for 1), as the NM plugin will set all the values; then the key_changed_cb would fire, and clear the password that was just set.

Edited by Eivind Næss

Merge request reports

Loading