Skip to content

Instantly share code, notes, and snippets.

@halfvector
Created March 16, 2016 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfvector/a85b43e262dc37602ecc to your computer and use it in GitHub Desktop.
Save halfvector/a85b43e262dc37602ecc to your computer and use it in GitHub Desktop.
Flattened Android Wifi model with Enterprise configuration extensions (EAP)
/**
* All fields are allowed to be null.
*/
class WifiConfig {
/**
* The network's SSID. Can either be an ASCII string, which must be enclosed in double quotation marks
* (e.g., "MyNetwork"), or a string of hex digits,which are not enclosed in quotes (e.g., 01a243f405).
*/
String SSID;
/**
* When set, this network configuration entry should only be used when associating with the AP having the specified BSSID.
* The value is a string in the format of an Ethernet MAC address, e.g., XX:XX:XX:XX:XX:XX where each X is a hex digit.
*/
String BSSID;
/**
* This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.
*/
Boolean hiddenSSID;
/**
* Priority determines the preference given to a network by wpa_supplicant when choosing an access point with which to associate.
*/
Integer priority;
/**
* Pre-shared key for use with WPA-PSK.
*/
String preSharedKey;
/**
* Up to four WEP keys.
* Either an ASCII string enclosed in double quotation marks (e.g., "abcdef" or a string of hex digits (e.g., 0102030405).
*/
String[] wepKeys;
/**
* Default WEP key index, ranging from 0 to 3.
*/
Integer wepTxKeyIndex;
/**
* LEAP = LEAP/Network EAP (only used with LEAP)
* OPEN = Open System authentication (required for WPA/WPA2)
* SHARED = Shared Key authentication (requires static WEP keys)
*/
String[] allowedAuthAlgorithms;
/**
* CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
* TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
* WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
* WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key (original 802.11)
*/
String[] allowedGroupCiphers;
/**
* IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically generated WEP keys.
* NONE = WPA is not used; plaintext or static WEP could be used.
* WPA_EAP = WPA using EAP authentication.
* WPA_PSK = WPA pre-shared key (requires preSharedKey to be specified).
*/
String[] allowedKeyManagement;
/**
* CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
* NONE = Use only Group keys (deprecated)
* TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
*/
String[] allowedPairwiseCiphers;
/**
* RSN = WPA2/IEEE 802.11i
* WPA = WPA/IEEE 802.11i/D3.0
*/
String[] allowedProtocols;
/**
* The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP.
*
* Set these fields when using WPA/802.1X with EAP
* Available on API 18+ (we are backporting to API 15+)
*
* Currently missing Certificates, keys, and anonymous identity.
*/
/**
* Username
*/
String identity;
/**
* Password
*/
String password;
/**
* Choose one:
*
* AKA = EAP-Authentication and Key Agreement (API 21)
* AKA_PRIME = EAP-Authentication and Key Agreement Prime (API 23)
* NONE = No EAP method used.
* PEAP = Protected EAP
* PWD = EAP-Password
* SIM = EAP-Subscriber Identity Module (API 21)
* TLS = EAP-Transport Layer Security
* TTLS = EAP-Tunneled Transport Layer Security
*/
String eapMethod;
/**
* Choose one:
*
* GTC = Generic Token Card
* MSCHAP = Microsoft Challenge Handshake Authentication Protocol
* MSCHAPV2 = Microsoft Challenge Handshake Authentication Protocol v2
* NONE
* PAP = Password Authentication Protocol
*/
String phase2Method;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment