aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-02-03 19:36:45 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-03 19:36:45 (GMT)
commite9926d6366da771bdd2471d1464931fadd763a35 (patch)
tree730ba9f6992418cc9e9502aeac580dd6fc1f63b8
parente164de5e70d2cf6681a75968a655208813fec9ba (diff)
downloadhostap-history-e9926d6366da771bdd2471d1464931fadd763a35.zip
hostap-history-e9926d6366da771bdd2471d1464931fadd763a35.tar.gz
hostap-history-e9926d6366da771bdd2471d1464931fadd763a35.tar.bz2
Added more debug information for EAP keyData retrieval
-rw-r--r--src/eapol_supp/eapol_supp_sm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index 211f9d4..9647e03 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -1373,14 +1373,24 @@ int eapol_sm_get_key(struct eapol_sm *sm, u8 *key, size_t len)
const u8 *eap_key;
size_t eap_len;
- if (sm == NULL || !eap_key_available(sm->eap))
+ if (sm == NULL || !eap_key_available(sm->eap)) {
+ wpa_printf(MSG_DEBUG, "EAPOL: EAP key not available");
return -1;
+ }
eap_key = eap_get_eapKeyData(sm->eap, &eap_len);
- if (eap_key == NULL)
+ if (eap_key == NULL) {
+ wpa_printf(MSG_DEBUG, "EAPOL: Failed to get eapKeyData");
return -1;
- if (len > eap_len)
+ }
+ if (len > eap_len) {
+ wpa_printf(MSG_DEBUG, "EAPOL: Requested key length (%lu) not "
+ "available (len=%lu)",
+ (unsigned long) len, (unsigned long) eap_len);
return eap_len;
+ }
os_memcpy(key, eap_key, len);
+ wpa_printf(MSG_DEBUG, "EAPOL: Successfully fetched key (len=%lu)",
+ (unsigned long) len);
return 0;
}