From 962e2e8b2c0bdfac32a753af686963184ec2e22d Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 10 Feb 2016 13:20:46 -0600 Subject: [PATCH] wiphy: Use SHA256 AKM if available --- src/wiphy.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wiphy.c b/src/wiphy.c index 54c0ea52..f7b7badc 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1428,10 +1428,15 @@ static void mlme_associate_cmd(struct netdev *netdev) struct eapol_sm *sm = eapol_sm_new(); memset(&info, 0, sizeof(info)); - info.akm_suites = - (network->ssid_security == SCAN_SSID_SECURITY_PSK) ? - IE_RSN_AKM_SUITE_PSK : - IE_RSN_AKM_SUITE_8021X; + + if (network->ssid_security == SCAN_SSID_SECURITY_PSK) + info.akm_suites = + bss->sha256 ? IE_RSN_AKM_SUITE_PSK_SHA256 : + IE_RSN_AKM_SUITE_PSK; + else + info.akm_suites = + bss->sha256 ? IE_RSN_AKM_SUITE_8021X_SHA256 : + IE_RSN_AKM_SUITE_8021X; bss_get_supported_ciphers(bss, &pairwise_ciphers, &group_ciphers);