aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2015-01-12 22:15:45 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-22 23:48:27 (GMT)
commit400de9b1fe403a1a3450a0cc9907a76954b9bd30 (patch)
tree44919c66588451e80f624cebaf61ae99feeb2b84 /src/radius
parentad905e4a794f9beb6b7e2a5b24234f722033c9ea (diff)
downloadhostap-400de9b1fe403a1a3450a0cc9907a76954b9bd30.zip
hostap-400de9b1fe403a1a3450a0cc9907a76954b9bd30.tar.gz
hostap-400de9b1fe403a1a3450a0cc9907a76954b9bd30.tar.bz2
hostapd: Debug messages for dodgy RADIUS servers
These were helpful when tracking down why hostapd did not work properly with a RADIUS server. Signed-hostap: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/radius/radius.c b/src/radius/radius.c
index 6eba2eb..8d878a4 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -993,13 +993,16 @@ static u8 * decrypt_ms_key(const u8 *key, size_t len,
/* key: 16-bit salt followed by encrypted key info */
- if (len < 2 + 16)
+ if (len < 2 + 16) {
+ wpa_printf(MSG_DEBUG, "RADIUS: %s: Len is too small: %d",
+ __func__, (int) len);
return NULL;
+ }
pos = key + 2;
left = len - 2;
if (left % 16) {
- wpa_printf(MSG_INFO, "Invalid ms key len %lu",
+ wpa_printf(MSG_INFO, "RADIUS: Invalid ms key len %lu",
(unsigned long) left);
return NULL;
}
@@ -1034,7 +1037,7 @@ static u8 * decrypt_ms_key(const u8 *key, size_t len,
}
if (plain[0] == 0 || plain[0] > plen - 1) {
- wpa_printf(MSG_INFO, "Failed to decrypt MPPE key");
+ wpa_printf(MSG_INFO, "RADIUS: Failed to decrypt MPPE key");
os_free(plain);
return NULL;
}
@@ -1123,6 +1126,10 @@ radius_msg_get_ms_keys(struct radius_msg *msg, struct radius_msg *sent_msg,
sent_msg->hdr->authenticator,
secret, secret_len,
&keys->send_len);
+ if (!keys->send) {
+ wpa_printf(MSG_DEBUG,
+ "RADIUS: Failed to decrypt send key");
+ }
os_free(key);
}
@@ -1134,6 +1141,10 @@ radius_msg_get_ms_keys(struct radius_msg *msg, struct radius_msg *sent_msg,
sent_msg->hdr->authenticator,
secret, secret_len,
&keys->recv_len);
+ if (!keys->recv) {
+ wpa_printf(MSG_DEBUG,
+ "RADIUS: Failed to decrypt recv key");
+ }
os_free(key);
}