]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add debug prints on PMK configuration in WPA supplicant
authorJouni Malinen <j@w1.fi>
Sun, 8 Oct 2017 09:21:21 +0000 (12:21 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 15 Oct 2017 23:03:47 +0000 (02:03 +0300)
This makes it easier to understand the cases where PMK gets configured
based on information from upper layer call (e.g., a PSK).

Signed-off-by: Jouni Malinen <j@w1.fi>
src/rsn_supp/wpa.c

index efa06c3e338f4f4a47fd376e284d35a2a6543751..f8449084e53ad66dba9ddc7da02ae806d9775fef 100644 (file)
@@ -2620,6 +2620,8 @@ void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len,
        if (sm == NULL)
                return;
 
+       wpa_hexdump_key(MSG_DEBUG, "WPA: Set PMK based on external data",
+                       pmk, pmk_len);
        sm->pmk_len = pmk_len;
        os_memcpy(sm->pmk, pmk, pmk_len);
 
@@ -2650,9 +2652,13 @@ void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm)
                return;
 
        if (sm->cur_pmksa) {
+               wpa_hexdump_key(MSG_DEBUG,
+                               "WPA: Set PMK based on current PMKSA",
+                               sm->cur_pmksa->pmk, sm->cur_pmksa->pmk_len);
                sm->pmk_len = sm->cur_pmksa->pmk_len;
                os_memcpy(sm->pmk, sm->cur_pmksa->pmk, sm->pmk_len);
        } else {
+               wpa_printf(MSG_DEBUG, "WPA: No current PMKSA - clear PMK");
                sm->pmk_len = PMK_LEN;
                os_memset(sm->pmk, 0, PMK_LEN);
        }