aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ibss_rsn.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-04 20:55:28 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-04 20:55:28 (GMT)
commita486c0c72a2856161f421e1d4c98e424508be18e (patch)
tree3d52f8e66692fc37b070f29a529a3dfa7c61709c /wpa_supplicant/ibss_rsn.c
parenta95795ad612a32eb9b15aaa6470b419ac4d0a228 (diff)
downloadhostap-a486c0c72a2856161f421e1d4c98e424508be18e.zip
hostap-a486c0c72a2856161f421e1d4c98e424508be18e.tar.gz
hostap-a486c0c72a2856161f421e1d4c98e424508be18e.tar.bz2
IBSS RSN: Add more verbose debug info for key setup
Diffstat (limited to 'wpa_supplicant/ibss_rsn.c')
-rw-r--r--wpa_supplicant/ibss_rsn.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index e0e0f3b..a9f49d9 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -107,22 +107,24 @@ static int supp_set_key(void *ctx, wpa_alg alg,
{
struct ibss_rsn_peer *peer = ctx;
+ wpa_printf(MSG_DEBUG, "SUPP: %s(alg=%d addr=" MACSTR " key_idx=%d "
+ "set_tx=%d)",
+ __func__, alg, MAC2STR(addr), key_idx, set_tx);
+ wpa_hexdump(MSG_DEBUG, "SUPP: set_key - seq", seq, seq_len);
+ wpa_hexdump_key(MSG_DEBUG, "SUPP: set_key - key", key, key_len);
+
if (key_idx == 0) {
/*
* In IBSS RSN, the pairwise key from the 4-way handshake
* initiated by the peer with highest MAC address is used.
*/
if (os_memcmp(peer->ibss_rsn->wpa_s->own_addr, peer->addr,
- ETH_ALEN) > 0)
+ ETH_ALEN) > 0) {
+ wpa_printf(MSG_DEBUG, "SUPP: Do not use this PTK");
return 0;
+ }
}
- wpa_printf(MSG_DEBUG, "SUPP: %s(alg=%d addr=" MACSTR " key_idx=%d "
- "set_tx=%d)",
- __func__, alg, MAC2STR(addr), key_idx, set_tx);
- wpa_hexdump(MSG_DEBUG, "SUPP: set_key - seq", seq, seq_len);
- wpa_hexdump_key(MSG_DEBUG, "SUPP: set_key - key", key, key_len);
-
return wpa_drv_set_key(peer->ibss_rsn->wpa_s, alg, addr, key_idx,
set_tx, seq, seq_len, key, key_len);
}
@@ -243,13 +245,26 @@ static int auth_set_key(void *ctx, int vlan_id, wpa_alg alg, const u8 *addr,
u8 seq[6];
os_memset(seq, 0, sizeof(seq));
+
+ if (addr) {
+ wpa_printf(MSG_DEBUG, "AUTH: %s(alg=%d addr=" MACSTR
+ " key_idx=%d)",
+ __func__, alg, MAC2STR(addr), idx);
+ } else {
+ wpa_printf(MSG_DEBUG, "AUTH: %s(alg=%d key_idx=%d)",
+ __func__, alg, idx);
+ }
+ wpa_hexdump_key(MSG_DEBUG, "AUTH: set_key - key", key, key_len);
+
if (idx == 0) {
/*
* In IBSS RSN, the pairwise key from the 4-way handshake
* initiated by the peer with highest MAC address is used.
*/
- if (os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0)
+ if (os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0) {
+ wpa_printf(MSG_DEBUG, "AUTH: Do not use this PTK");
return 0;
+ }
}
return wpa_drv_set_key(ibss_rsn->wpa_s, alg, addr, idx,