+static connman_bool_t handle_4way_handshake_failure(GSupplicantInterface *interface,
+ struct connman_network *network,
+ struct wifi_data *wifi)
+{
+ if (wifi->state != G_SUPPLICANT_STATE_4WAY_HANDSHAKE)
+ return FALSE;
+
+ wifi->retries++;
+
+ if (wifi->retries < MAXIMUM_RETRIES)
+ return TRUE;
+
+ /* We disable the selected network, if not then
+ * wpa_supplicant will loop retrying */
+ if (g_supplicant_interface_enable_selected_network(interface,
+ FALSE) != 0)
+ DBG("Could not disables selected network");
+
+ connman_network_set_error(network, CONNMAN_NETWORK_ERROR_INVALID_KEY);
+
+ return FALSE;
+}
+