summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Broder <evan@ebroder.net>2011-11-17 16:36:17 -0800
committerDan Williams <dcbw@redhat.com>2011-11-21 23:50:54 -0600
commitb08e2b8932ed6aa735b4ef4ed04fc173f275b16e (patch)
treedec00d8c903c944c484885afb3149b407df24020
parentdc92d1258dae7b8515c35b632115cf747afaa15d (diff)
supplicant: If password field is empty, check password-raw
-rw-r--r--src/supplicant-manager/nm-supplicant-config.c17
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 74455ee8ac..3889d5323c 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;