]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPA: Add more info for EAPOL-Key Nonce/MIC debugging
authorJouni Malinen <j@w1.fi>
Sat, 15 Jan 2011 14:57:08 +0000 (16:57 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Jan 2011 14:57:08 +0000 (16:57 +0200)
src/ap/wpa_auth.c
src/common/wpa_common.c
src/rsn_supp/wpa.c

index c3108f9ba912f9ff6147dd742d2a9e043975beaa..a5304eb6f6661dc9cb21e802eb4c8c632326559e 100644 (file)
@@ -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
index 71b8599b6fdc1d955692abbee445618e2fa23150..eb2745e4e69f12ec819ad326fa4df74c679472df 100644 (file)
@@ -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);
 }
index 8fa849d7732751fa354dd4059e54c55602827e3a..b605a193f9f3d0ba57807447fd78ffd9691b9520 100644 (file)
@@ -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);