diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2013-05-08 10:42:09 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2013-05-08 10:42:09 -0700 |
commit | 51b6ea882f234c14cd1fe1332a3840cf61fafcca (patch) | |
tree | e2642a68bb15f521f2fb536771f0382fee8d7784 /src/ap | |
parent | 1cf4573e05a4e7ce02e0ccc46771a1da5f303411 (diff) | |
download | android_external_wpa_supplicant_8-51b6ea882f234c14cd1fe1332a3840cf61fafcca.tar.gz android_external_wpa_supplicant_8-51b6ea882f234c14cd1fe1332a3840cf61fafcca.tar.bz2 android_external_wpa_supplicant_8-51b6ea882f234c14cd1fe1332a3840cf61fafcca.zip |
Accumulative patch from commit 6ea1f4135b72199988393f34dd7f5ad8040b7a42
6ea1f41 Try to set WPA-None key after IBSS-joined event
66562e9 Use cached driver capabilities instead of new fetch for each operation
55293aa TDLS: Do not overwrite the reason code in the Tear Down Request
4aa8186 Add a configration parameter for sched_scan interval
03565bc Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
f11b72c TDLS: Move AID=1 workaround into driver_nl80211.c
7853369 TDLS: Pass peer's AID information to kernel
55a2df4 HS 2.0: Include HS 2.0 Indication element only for HS 2.0 association
ad0685e edit: Fix history processing on running old command
9be3714 wpa_cli: Fetch the current BSSID list when starting interactive mode
69aa334 wpa_cli: Add BSSID tab completion for set bssid_filter
2156587 wpa_cli: Replace set command help with completion routine
f1fb042 wpa_cli: Allow space in the set command value
f5ffc34 wpa_supplicant: Allow global scan frequencies configuration
abfc3ad Synchronize build config comments for wpa_supplicant
a01e10d Android: Enable WPS ER and NFC support in the build
11e5a49 WPS: Do not use void* in arithmetic
0f105f9 HS 2.0: Move Probe Request Indication IE addition to proper place
8543ed8 WPA: Print pairwise EAPOL-Key flag as a bool
7af092a hostapd: Add Key MIC in group EAPOL-Key frames corruption test option
b691dcb nl80211: Fix max_remain_on_chan capability reading
41b1a76 P2P: Clone beacon_int when initializing new group interface
741ed9f WPS: Remove duplicate networks after WPS
Change-Id: I9a2a0cb2acf87dfd7548318d2bda5f342b815884
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/ap')
-rw-r--r-- | src/ap/ap_config.c | 1 | ||||
-rw-r--r-- | src/ap/ap_config.h | 1 | ||||
-rw-r--r-- | src/ap/wpa_auth.c | 12 | ||||
-rw-r--r-- | src/ap/wpa_auth.h | 3 | ||||
-rw-r--r-- | src/ap/wpa_auth_glue.c | 9 |
5 files changed, 23 insertions, 3 deletions
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 70b26a6e..7ab86fca 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -168,6 +168,7 @@ struct hostapd_config * hostapd_config_defaults(void) conf->ignore_auth_probability = 0.0d; conf->ignore_assoc_probability = 0.0d; conf->ignore_reassoc_probability = 0.0d; + conf->corrupt_gtk_rekey_mic_probability = 0.0d; #endif /* CONFIG_TESTING_OPTIONS */ return conf; diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index f9629a2c..16134da9 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -526,6 +526,7 @@ struct hostapd_config { double ignore_auth_probability; double ignore_assoc_probability; double ignore_reassoc_probability; + double corrupt_gtk_rekey_mic_probability; #endif /* CONFIG_TESTING_OPTIONS */ }; diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 4f1f6fbc..18ae86c8 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -1232,7 +1232,7 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth, else version = WPA_KEY_INFO_TYPE_HMAC_MD5_RC4; - pairwise = key_info & WPA_KEY_INFO_KEY_TYPE; + pairwise = !!(key_info & WPA_KEY_INFO_KEY_TYPE); wpa_printf(MSG_DEBUG, "WPA: Send EAPOL(version=%d secure=%d mic=%d " "ack=%d install=%d pairwise=%d kde_len=%lu keyidx=%d " @@ -1347,6 +1347,16 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth, } wpa_eapol_key_mic(sm->PTK.kck, version, (u8 *) hdr, len, key->key_mic); +#ifdef CONFIG_TESTING_OPTIONS + if (!pairwise && + wpa_auth->conf.corrupt_gtk_rekey_mic_probability > 0.0d && + drand48() < + wpa_auth->conf.corrupt_gtk_rekey_mic_probability) { + wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO, + "Corrupting group EAPOL-Key Key MIC"); + key->key_mic[0]++; + } +#endif /* CONFIG_TESTING_OPTIONS */ } wpa_auth_set_eapol(sm->wpa_auth, sm->addr, WPA_EAPOL_inc_EapolFramesTx, diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h index 465eec6a..9126b90d 100644 --- a/src/ap/wpa_auth.h +++ b/src/ap/wpa_auth.h @@ -160,6 +160,9 @@ struct wpa_auth_config { #endif /* CONFIG_IEEE80211R */ int disable_gtk; int ap_mlme; +#ifdef CONFIG_TESTING_OPTIONS + double corrupt_gtk_rekey_mic_probability; +#endif /* CONFIG_TESTING_OPTIONS */ }; typedef enum { diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c index fdaaaff5..e2be1ea6 100644 --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c @@ -28,6 +28,7 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, + struct hostapd_config *iconf, struct wpa_auth_config *wconf) { os_memset(wconf, 0, sizeof(*wconf)); @@ -74,6 +75,10 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, #ifdef CONFIG_HS20 wconf->disable_gtk = conf->disable_dgaf; #endif /* CONFIG_HS20 */ +#ifdef CONFIG_TESTING_OPTIONS + wconf->corrupt_gtk_rekey_mic_probability = + iconf->corrupt_gtk_rekey_mic_probability; +#endif /* CONFIG_TESTING_OPTIONS */ } @@ -509,7 +514,7 @@ int hostapd_setup_wpa(struct hostapd_data *hapd) const u8 *wpa_ie; size_t wpa_ie_len; - hostapd_wpa_auth_conf(hapd->conf, &_conf); + hostapd_wpa_auth_conf(hapd->conf, hapd->iconf, &_conf); if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_EAPOL_TX_STATUS) _conf.tx_status = 1; if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_MLME) @@ -583,7 +588,7 @@ int hostapd_setup_wpa(struct hostapd_data *hapd) void hostapd_reconfig_wpa(struct hostapd_data *hapd) { struct wpa_auth_config wpa_auth_conf; - hostapd_wpa_auth_conf(hapd->conf, &wpa_auth_conf); + hostapd_wpa_auth_conf(hapd->conf, hapd->iconf, &wpa_auth_conf); wpa_reconfig(hapd->wpa_auth, &wpa_auth_conf); } |