Question

I have a problem connecting to using AES only. I can successfully connect using WPA2 (TKIP) but not (CCMP). If I comment out the two TKIP lines at the end I can't connect any longer. I wonder if CCMP is implemented in Android at all?

private WifiConfiguration getWifiConfiguration(ScanResult result, String password) {
  WifiConfiguration config = new WifiConfiguration();

  config.allowedAuthAlgorithms.clear();
  config.allowedGroupCiphers.clear();
  config.allowedKeyManagement.clear();
  config.allowedPairwiseCiphers.clear();
  config.allowedProtocols.clear();

  config.SSID = "\"" + result.SSID + "\"";
  config.BSSID = result.BSSID;
  config.preSharedKey = "\"" + password + "\"";
  config.status = WifiConfiguration.Status.ENABLED;
  config.hiddenSSID = false;

  config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
  config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
  config.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
  config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
  config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
  config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
  config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
  return config;
}
Was it helpful?

Solution

Ok, one can't support AES exclusively. One need to support both CCMP and TKIP for AES to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top