[network-manager-applet] wireless-security: acually save the PKCS#11 PINs for certificates



commit d7e873d91310203726b6e2472da3a94b4c8aac9d
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Jun 22 12:39:42 2017 +0200

    wireless-security: acually save the PKCS#11 PINs for certificates

 src/wireless-security/eap-method-peap.c |    5 ++++-
 src/wireless-security/eap-method-tls.c  |   10 ++++++++--
 src/wireless-security/eap-method-ttls.c |    5 ++++-
 3 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index 81bd275..4be5376 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -174,7 +174,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
 #if LIBNM_BUILD
 /* libnm-glib doesn't support this. */
-       /* Save CA certificate PIN password flags to the connection */
+       /* Save CA certificate PIN and its flags to the connection */
        secret_flags = nma_cert_chooser_get_cert_password_flags (NMA_CERT_CHOOSER (method->ca_cert_chooser));
        nm_setting_set_secret_flags (NM_SETTING (s_8021x), NM_SETTING_802_1X_CA_CERT_PASSWORD,
                                     secret_flags, NULL);
@@ -183,6 +183,9 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                nma_cert_chooser_update_cert_password_storage (NMA_CERT_CHOOSER (method->ca_cert_chooser),
                                                               secret_flags, NM_SETTING (s_8021x),
                                                               NM_SETTING_802_1X_CA_CERT_PASSWORD);
+               g_object_set (s_8021x, NM_SETTING_802_1X_CA_CERT_PASSWORD,
+                             nma_cert_chooser_get_cert_password (NMA_CERT_CHOOSER (method->ca_cert_chooser)),
+                             NULL);
        }
 #endif
 
diff --git a/src/wireless-security/eap-method-tls.c b/src/wireless-security/eap-method-tls.c
index a740c11..0595fd0 100644
--- a/src/wireless-security/eap-method-tls.c
+++ b/src/wireless-security/eap-method-tls.c
@@ -160,7 +160,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
 #if LIBNM_BUILD
 /* libnm-glib doesn't support these. */
-       /* Save CA certificate PIN password flags to the connection */
+       /* Save CA certificate PIN and its flags to the connection */
        secret_flags = nma_cert_chooser_get_cert_password_flags (NMA_CERT_CHOOSER (method->ca_cert_chooser));
        nm_setting_set_secret_flags (NM_SETTING (s_8021x), method->ca_cert_password_flags_name,
                                     secret_flags, NULL);
@@ -169,9 +169,12 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                nma_cert_chooser_update_cert_password_storage (NMA_CERT_CHOOSER (method->ca_cert_chooser),
                                                               secret_flags, NM_SETTING (s_8021x),
                                                               method->ca_cert_password_flags_name);
+               g_object_set (s_8021x, method->ca_cert_password_flags_name,
+                             nma_cert_chooser_get_cert_password (NMA_CERT_CHOOSER (method->ca_cert_chooser)),
+                             NULL);
        }
 
-       /* Save user certificate PIN password flags to the connection */
+       /* Save user certificate PIN and its flags flags to the connection */
        secret_flags = nma_cert_chooser_get_cert_password_flags (NMA_CERT_CHOOSER 
(method->client_cert_chooser));
        nm_setting_set_secret_flags (NM_SETTING (s_8021x), method->client_cert_password_flags_name,
                                     secret_flags, NULL);
@@ -179,6 +182,9 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                nma_cert_chooser_update_cert_password_storage (NMA_CERT_CHOOSER (method->client_cert_chooser),
                                                               secret_flags, NM_SETTING (s_8021x),
                                                               method->client_cert_password_flags_name);
+               g_object_set (s_8021x, method->client_cert_password_flags_name,
+                             nma_cert_chooser_get_cert_password (NMA_CERT_CHOOSER 
(method->client_cert_chooser)),
+                             NULL);
        }
 #endif
 
diff --git a/src/wireless-security/eap-method-ttls.c b/src/wireless-security/eap-method-ttls.c
index 4e9201f..71bede9 100644
--- a/src/wireless-security/eap-method-ttls.c
+++ b/src/wireless-security/eap-method-ttls.c
@@ -170,7 +170,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
 #if LIBNM_BUILD
 /* libnm-glib doesn't support this. */
-       /* Save CA certificate PIN password flags to the connection */
+       /* Save CA certificate PIN and its flags to the connection */
        secret_flags = nma_cert_chooser_get_cert_password_flags (NMA_CERT_CHOOSER (method->ca_cert_chooser));
        nm_setting_set_secret_flags (NM_SETTING (s_8021x), NM_SETTING_802_1X_CA_CERT_PASSWORD,
                                     secret_flags, NULL);
@@ -179,6 +179,9 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                nma_cert_chooser_update_cert_password_storage (NMA_CERT_CHOOSER (method->ca_cert_chooser),
                                                               secret_flags, NM_SETTING (s_8021x),
                                                               NM_SETTING_802_1X_CA_CERT_PASSWORD);
+               g_object_set (s_8021x, NM_SETTING_802_1X_CA_CERT_PASSWORD,
+                             nma_cert_chooser_get_cert_password (NMA_CERT_CHOOSER (method->ca_cert_chooser)),
+                             NULL);
        }
 #endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]