supplicant: If password field is empty, check password-raw

This commit is contained in:
Evan Broder
2011-11-17 16:36:17 -08:00
committed by Dan Williams
parent dc92d1258d
commit b08e2b8932

View File

@@ -728,8 +728,21 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
g_return_val_if_fail (connection_uid != NULL, FALSE); g_return_val_if_fail (connection_uid != NULL, FALSE);
value = nm_setting_802_1x_get_password (setting); value = nm_setting_802_1x_get_password (setting);
if (!add_string_val (self, value, "password", FALSE, TRUE)) if (value) {
return FALSE; 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); value = nm_setting_802_1x_get_pin (setting);
if (!add_string_val (self, value, "pin", FALSE, TRUE)) if (!add_string_val (self, value, "pin", FALSE, TRUE))
return FALSE; return FALSE;