EAP peer: Add check before calling getSessionId method
We should not call getSessionID method if it's not provided. This fixes
a regression from commit 950c563076
where
EAP methods that did not implement getSessionId resulted in NULL pointer
dereference when deriving the key.
Signed-off-by: Shijie Zhang <shijiez@qca.qualcomm.com>
This commit is contained in:
parent
dd57970477
commit
d78d3c6190
1 changed files with 5 additions and 3 deletions
|
@ -406,9 +406,11 @@ SM_STATE(EAP, METHOD)
|
|||
sm->eapKeyData = sm->m->getKey(sm, sm->eap_method_priv,
|
||||
&sm->eapKeyDataLen);
|
||||
os_free(sm->eapSessionId);
|
||||
sm->eapSessionId = sm->m->getSessionId(sm, sm->eap_method_priv,
|
||||
sm->eapSessionId = NULL;
|
||||
if (sm->m->getSessionId) {
|
||||
sm->eapSessionId = sm->m->getSessionId(
|
||||
sm, sm->eap_method_priv,
|
||||
&sm->eapSessionIdLen);
|
||||
if (sm->eapSessionId) {
|
||||
wpa_hexdump(MSG_DEBUG, "EAP: Session-Id",
|
||||
sm->eapSessionId, sm->eapSessionIdLen);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue