summaryrefslogtreecommitdiff
path: root/src/wireless-security
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-06-27 19:31:33 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-07-26 13:27:21 +0200
commit04fe9aa3c84b616497f40bcbf63df83f2b56c1e5 (patch)
treee6b55739542c5945f904cb2e589fb22aaac1c35f /src/wireless-security
parentf5fabcf30feb4df0b9b082e9063a6a8cb18e7736 (diff)
downloadnetwork-manager-applet-04fe9aa3c84b616497f40bcbf63df83f2b56c1e5.tar.gz
wireless-security: avoid passing NULL to nma_cert_chooser_set_*_password()
This never worked for the file picker, since it tripped an assertion on setting NULL to the GtkEntry. Don't do that and guard the PKCS#11 picker too.
Diffstat (limited to 'src/wireless-security')
-rw-r--r--src/wireless-security/eap-method.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c
index 0b11443d..2e9daa23 100644
--- a/src/wireless-security/eap-method.c
+++ b/src/wireless-security/eap-method.c
@@ -391,6 +391,7 @@ eap_method_setup_cert_chooser (NMACertChooser *cert_chooser,
{
NMSetting8021xCKScheme scheme = NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
const char *value = NULL;
+ const char *password = NULL;
if (s_8021x && cert_path_func && cert_uri_func && cert_scheme_func) {
@@ -403,8 +404,9 @@ eap_method_setup_cert_chooser (NMACertChooser *cert_chooser,
/* Not available in libnm-glib */
case NM_SETTING_802_1X_CK_SCHEME_PKCS11:
value = cert_uri_func (s_8021x);
- if (cert_password_func)
- nma_cert_chooser_set_cert_password (cert_chooser, cert_password_func (s_8021x));
+ password = cert_password_func ? cert_password_func (s_8021x) : NULL;
+ if (password)
+ nma_cert_chooser_set_cert_password (cert_chooser, password);
break;
#endif
case NM_SETTING_802_1X_CK_SCHEME_UNKNOWN:
@@ -439,6 +441,7 @@ eap_method_setup_cert_chooser (NMACertChooser *cert_chooser,
nma_cert_chooser_set_key (cert_chooser, value, scheme);
}
- if (s_8021x && key_password_func)
+ password = s_8021x && key_password_func ? key_password_func (s_8021x) : NULL;
+ if (password)
nma_cert_chooser_set_key_password (cert_chooser, key_password_func (s_8021x));
}