[PATCH 4/5] supplicant: If password field is empty, check password-bytes
- From: Evan Broder <evan ebroder net>
- To: networkmanager-list gnome org
- Subject: [PATCH 4/5] supplicant: If password field is empty, check password-bytes
- Date: Thu, 17 Nov 2011 16:36:17 -0800
---
src/supplicant-manager/nm-supplicant-config.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c
index 74455ee..2bd64ce 100644
--- a/src/supplicant-manager/nm-supplicant-config.c
+++ b/src/supplicant-manager/nm-supplicant-config.c
@@ -728,8 +728,21 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
g_return_val_if_fail (connection_uid != NULL, FALSE);
value = nm_setting_802_1x_get_password (setting);
- if (!add_string_val (self, value, "password", FALSE, TRUE))
- return FALSE;
+ if (value) {
+ if (!add_string_val (self, value, "password", FALSE, TRUE))
+ return FALSE;
+ } else {
+ array = nm_setting_802_1x_get_password_raw (setting);
+ success = nm_supplicant_config_add_option (self,
+ "password",
+ (const char *)array->data,
+ array->len,
+ TRUE);
+ if (!success) {
+ nm_log_warn (LOGD_SUPPLICANT, "Error adding password-raw to supplicant config.");
+ return FALSE;
+ }
+ }
value = nm_setting_802_1x_get_pin (setting);
if (!add_string_val (self, value, "pin", FALSE, TRUE))
return FALSE;
--
1.7.5.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]