aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-01-15 14:57:08 (GMT)
committerJouni Malinen <j@w1.fi>2011-01-15 14:57:08 (GMT)
commitbc8318acbcd05b76201507e63e98d888ccc93405 (patch)
tree58a7ef15f15f6beb5fe85115919572cff7d8edfa /src
parent6c9a98a20dfc05b09cd2eace4173ba216cf60799 (diff)
downloadhostap-bc8318acbcd05b76201507e63e98d888ccc93405.zip
hostap-bc8318acbcd05b76201507e63e98d888ccc93405.tar.gz
hostap-bc8318acbcd05b76201507e63e98d888ccc93405.tar.bz2
WPA: Add more info for EAPOL-Key Nonce/MIC debugging
Diffstat (limited to 'src')
-rw-r--r--src/ap/wpa_auth.c7
-rw-r--r--src/common/wpa_common.c2
-rw-r--r--src/rsn_supp/wpa.c4
3 files changed, 13 insertions, 0 deletions
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index c3108f9..a5304eb 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -736,6 +736,11 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
}
}
+ wpa_hexdump(MSG_DEBUG, "WPA: Received Key Nonce", key->key_nonce,
+ WPA_NONCE_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPA: Received Replay Counter",
+ key->replay_counter, WPA_REPLAY_COUNTER_LEN);
+
/* FIX: verify that the EAPOL-Key frame was encrypted if pairwise keys
* are set */
@@ -1510,6 +1515,8 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
}
os_memcpy(sm->ANonce, sm->group->Counter, WPA_NONCE_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPA: Assign ANonce", sm->ANonce,
+ WPA_NONCE_LEN);
inc_byte_array(sm->group->Counter, WPA_NONCE_LEN);
sm->ReAuthenticationRequest = FALSE;
/* IEEE 802.11i does not clear TimeoutCtr here, but this is more
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 71b8599..eb2745e 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -126,6 +126,8 @@ void wpa_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const char *label,
wpa_printf(MSG_DEBUG, "WPA: PTK derivation - A1=" MACSTR " A2=" MACSTR,
MAC2STR(addr1), MAC2STR(addr2));
+ wpa_hexdump(MSG_DEBUG, "WPA: Nonce1", nonce1, WPA_NONCE_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPA: Nonce2", nonce2, WPA_NONCE_LEN);
wpa_hexdump_key(MSG_DEBUG, "WPA: PMK", pmk, pmk_len);
wpa_hexdump_key(MSG_DEBUG, "WPA: PTK", ptk, ptk_len);
}
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 8fa849d..b605a19 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -65,6 +65,8 @@ void wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck,
"version %d MIC", ver);
goto out;
}
+ wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", kck, 16);
+ wpa_hexdump(MSG_DEBUG, "WPA: Derived Key MIC", key_mic, 16);
wpa_hexdump(MSG_MSGDUMP, "WPA: TX EAPOL-Key", msg, msg_len);
wpa_sm_ether_send(sm, dest, proto, msg, msg_len);
eapol_sm_notify_tx_eapol_key(sm->eapol);
@@ -322,6 +324,8 @@ int wpa_supplicant_send_2_of_4(struct wpa_sm *sm, const unsigned char *dst,
os_memcpy(reply->key_length, key->key_length, 2);
os_memcpy(reply->replay_counter, key->replay_counter,
WPA_REPLAY_COUNTER_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPA: Replay Counter", reply->replay_counter,
+ WPA_REPLAY_COUNTER_LEN);
WPA_PUT_BE16(reply->key_data_length, wpa_ie_len);
os_memcpy(reply + 1, wpa_ie, wpa_ie_len);