From 0376019c35cf32dbd5dd039eb65da7b1cd166711 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 8 May 2017 13:28:08 -0600 Subject: [PATCH] WPA associate: NSH was not setting the algorithm parameter. --- nshlib/Kconfig | 4 ++-- nshlib/nsh_associate.c | 1 + wireless/wapi/src/driver_wext.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 955d601c4..e3dd1fbae 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -1488,7 +1488,7 @@ config NSH_WAPI_AUTHWPA only valid values are 0x00000001, 0x00000002, and 0x00000004 config NSH_WAPI_CIPHERMODE - hex " IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values" + hex "IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values" default 0x00000008 range 0x00000001 0x00000010 ---help--- @@ -1498,7 +1498,7 @@ config NSH_WAPI_CIPHERMODE this is a bit-encoded field. The only valid values are 0x00000001, 0x00000002,0x00000004, ... 0x00000010 -config NSH_WAPI_ALG; +config NSH_WAPI_ALG int "Algorithm" default 3 range 0 13 diff --git a/nshlib/nsh_associate.c b/nshlib/nsh_associate.c index 61a0f75a8..63dabddfc 100644 --- a/nshlib/nsh_associate.c +++ b/nshlib/nsh_associate.c @@ -69,6 +69,7 @@ int nsh_associate(FAR const char *ifname) wconfig.sta_mode = CONFIG_NSH_WAPI_STAMODE; wconfig.auth_wpa = CONFIG_NSH_WAPI_AUTHWPA; wconfig.cipher_mode = CONFIG_NSH_WAPI_CIPHERMODE; + wconfig.alg = CONFIG_NSH_WAPI_ALG; wconfig.ifname = ifname; wconfig.ssid = (FAR const uint8_t *)ssid; wconfig.passphrase = (FAR const uint8_t *)passphrase; diff --git a/wireless/wapi/src/driver_wext.c b/wireless/wapi/src/driver_wext.c index 34ccc66c7..114b7160c 100644 --- a/wireless/wapi/src/driver_wext.c +++ b/wireless/wapi/src/driver_wext.c @@ -254,8 +254,8 @@ int wpa_driver_wext_associate(FAR struct wpa_wconfig_s *wconfig) DEBUGASSERT(wconfig != NULL); - ninfo("sta_mode=%u auth_wpa=%08x cipher_mode=%08x\n", - wconfig->sta_mode, wconfig->auth_wpa, wconfig->cipher_mode); + ninfo("sta_mode=%u auth_wpa=%08x cipher_mode=%08x alg=%d\n", + wconfig->sta_mode, wconfig->auth_wpa, wconfig->cipher_mode, wconfig->alg); ninfo("ifname=%s ssid[%u]=%s passphrase[%u]=%s\n", wconfig->ifname, wconfig->ssidlen, wconfig->ssid, wconfig->phraselen, wconfig->passphrase);