summaryrefslogtreecommitdiff
path: root/src/libwpactrl
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-12-15 23:33:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-12-15 23:33:48 +0000
commite2cb9de752149d6b5b61775c53534554cd57f75f (patch)
tree7e427c8d4a4dbfe4973ddceac97eba4580dde662 /src/libwpactrl
parentc3fa11b88d12c9f931ea0515f3051565d2ff915d (diff)
downloadbcnm-e2cb9de752149d6b5b61775c53534554cd57f75f.tar.xz
Try WPA-PSK-SHA256 when supported by wpa_supplicant
Diffstat (limited to 'src/libwpactrl')
-rw-r--r--src/libwpactrl/wpactrl_associate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libwpactrl/wpactrl_associate.c b/src/libwpactrl/wpactrl_associate.c
index 0f1bd2e..08f3656 100644
--- a/src/libwpactrl/wpactrl_associate.c
+++ b/src/libwpactrl/wpactrl_associate.c
@@ -17,8 +17,13 @@ int wpactrl_associate (wpactrl_t *a, char const *ssid, char const *psk, tain_t *
if (wpactrl_setnetworkoption(a, id, "ssid", ssid, stamp) != WPA_OK) goto err ;
if (psk)
{
- if (wpactrl_setnetworkoption(a, id, "key_mgmt", "WPA-PSK", stamp) != WPA_OK
- || wpactrl_setnetworkoption(a, id, "mem_only_psk", "1", stamp) != WPA_OK
+ wparesponse_t r = wpactrl_setnetworkoption(a, id, "key_mgmt", "WPA-PSK WPA-PSK-SHA256", stamp) ;
+ if (r != WPA_OK)
+ {
+ if (r != WPA_FAIL
+ || wpactrl_setnetworkoption(a, id, "key_mgmt", "WPA-PSK", stamp) != WPA_OK) goto err ;
+ }
+ if (wpactrl_setnetworkoption(a, id, "mem_only_psk", "1", stamp) != WPA_OK
|| wpactrl_setnetworkoption(a, id, "psk", psk, stamp) != WPA_OK) goto err ;
}
else