diff options
-rw-r--r-- | src/libwpactrl/wpactrl_associate.c | 9 |
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 |