From b08e2b8932ed6aa735b4ef4ed04fc173f275b16e Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 17 Nov 2011 16:36:17 -0800 Subject: [PATCH] supplicant: If password field is empty, check password-raw --- src/supplicant-manager/nm-supplicant-config.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index 74455ee8a..3889d5323 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;