mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 07:00:05 +01:00
merge: branch 'saemismatch-signal-handlers'
core: add handlers for SaePasswordMismatch signal Closes #904 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2293
This commit is contained in:
commit
7315e7e0ee
3 changed files with 51 additions and 0 deletions
|
|
@ -194,6 +194,9 @@ static void supplicant_iface_notify_p2p_available(NMSupplicantInterface *iface,
|
||||||
static void supplicant_iface_notify_wpa_psk_mismatch_cb(NMSupplicantInterface *iface,
|
static void supplicant_iface_notify_wpa_psk_mismatch_cb(NMSupplicantInterface *iface,
|
||||||
NMDeviceWifi *self);
|
NMDeviceWifi *self);
|
||||||
|
|
||||||
|
static void supplicant_iface_notify_wpa_sae_mismatch_cb(NMSupplicantInterface *iface,
|
||||||
|
NMDeviceWifi *self);
|
||||||
|
|
||||||
static void periodic_update(NMDeviceWifi *self);
|
static void periodic_update(NMDeviceWifi *self);
|
||||||
|
|
||||||
static void ap_add_remove(NMDeviceWifi *self,
|
static void ap_add_remove(NMDeviceWifi *self,
|
||||||
|
|
@ -631,6 +634,10 @@ supplicant_interface_acquire_cb(NMSupplicantManager *supplicant_manager,
|
||||||
NM_SUPPLICANT_INTERFACE_PSK_MISMATCH,
|
NM_SUPPLICANT_INTERFACE_PSK_MISMATCH,
|
||||||
G_CALLBACK(supplicant_iface_notify_wpa_psk_mismatch_cb),
|
G_CALLBACK(supplicant_iface_notify_wpa_psk_mismatch_cb),
|
||||||
self);
|
self);
|
||||||
|
g_signal_connect(priv->sup_iface,
|
||||||
|
NM_SUPPLICANT_INTERFACE_SAE_MISMATCH,
|
||||||
|
G_CALLBACK(supplicant_iface_notify_wpa_sae_mismatch_cb),
|
||||||
|
self);
|
||||||
|
|
||||||
_scan_notify_is_scanning(self);
|
_scan_notify_is_scanning(self);
|
||||||
|
|
||||||
|
|
@ -2879,6 +2886,34 @@ supplicant_iface_notify_wpa_psk_mismatch_cb(NMSupplicantInterface *iface, NMDevi
|
||||||
| NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
|
| NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
supplicant_iface_notify_wpa_sae_mismatch_cb(NMSupplicantInterface *iface, NMDeviceWifi *self)
|
||||||
|
{
|
||||||
|
NMDevice *device = NM_DEVICE(self);
|
||||||
|
NMActRequest *req;
|
||||||
|
const char *setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
|
||||||
|
|
||||||
|
if (nm_device_get_state(device) != NM_DEVICE_STATE_CONFIG)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_LOGI(LOGD_DEVICE | LOGD_WIFI,
|
||||||
|
"Activation: (wifi) SAE password mismatch reported by supplicant, asking for new key");
|
||||||
|
|
||||||
|
req = nm_device_get_act_request(NM_DEVICE(self));
|
||||||
|
g_return_if_fail(req != NULL);
|
||||||
|
|
||||||
|
nm_act_request_clear_secrets(req);
|
||||||
|
|
||||||
|
cleanup_association_attempt(self, TRUE);
|
||||||
|
nm_device_state_changed(device,
|
||||||
|
NM_DEVICE_STATE_NEED_AUTH,
|
||||||
|
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
|
||||||
|
wifi_secrets_get_secrets(self,
|
||||||
|
setting_name,
|
||||||
|
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION
|
||||||
|
| NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* supplicant_connection_timeout_cb
|
* supplicant_connection_timeout_cb
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ enum {
|
||||||
GROUP_STARTED, /* a new Group (interface) was created */
|
GROUP_STARTED, /* a new Group (interface) was created */
|
||||||
GROUP_FINISHED, /* a Group (interface) has been finished */
|
GROUP_FINISHED, /* a Group (interface) has been finished */
|
||||||
PSK_MISMATCH, /* supplicant reported incorrect PSK */
|
PSK_MISMATCH, /* supplicant reported incorrect PSK */
|
||||||
|
SAE_MISMATCH, /* supplicant reported incorrect SAE Password */
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3110,6 +3111,11 @@ _signal_handle(NMSupplicantInterface *self,
|
||||||
g_signal_emit(self, signals[PSK_MISMATCH], 0);
|
g_signal_emit(self, signals[PSK_MISMATCH], 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nm_streq(signal_name, "SaePasswordMismatch")) {
|
||||||
|
g_signal_emit(self, signals[SAE_MISMATCH], 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3752,4 +3758,13 @@ nm_supplicant_interface_class_init(NMSupplicantInterfaceClass *klass)
|
||||||
NULL,
|
NULL,
|
||||||
G_TYPE_NONE,
|
G_TYPE_NONE,
|
||||||
0);
|
0);
|
||||||
|
signals[SAE_MISMATCH] = g_signal_new(NM_SUPPLICANT_INTERFACE_SAE_MISMATCH,
|
||||||
|
G_OBJECT_CLASS_TYPE(object_class),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
G_TYPE_NONE,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ typedef enum {
|
||||||
#define NM_SUPPLICANT_INTERFACE_GROUP_STARTED "group-started"
|
#define NM_SUPPLICANT_INTERFACE_GROUP_STARTED "group-started"
|
||||||
#define NM_SUPPLICANT_INTERFACE_GROUP_FINISHED "group-finished"
|
#define NM_SUPPLICANT_INTERFACE_GROUP_FINISHED "group-finished"
|
||||||
#define NM_SUPPLICANT_INTERFACE_PSK_MISMATCH "wpa-psk-mismatch"
|
#define NM_SUPPLICANT_INTERFACE_PSK_MISMATCH "wpa-psk-mismatch"
|
||||||
|
#define NM_SUPPLICANT_INTERFACE_SAE_MISMATCH "wpa-sae-password-mismatch"
|
||||||
|
|
||||||
typedef struct _NMSupplicantInterfaceClass NMSupplicantInterfaceClass;
|
typedef struct _NMSupplicantInterfaceClass NMSupplicantInterfaceClass;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue