mesh: Simplify wpa_auth_pmksa_set_to_sm()

pmksa->pmk or pmksa->pmkid cannot be NULL since they are arrays. Remove
the unnecessary NULL checks and use the provided pmksa pointer directly
to simplify the implementation. (CID 138519)

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2016-03-22 20:37:46 +02:00
parent 32d4fe9549
commit 8854f90bad

View File

@ -3393,13 +3393,9 @@ void wpa_auth_pmksa_set_to_sm(struct rsn_pmksa_cache_entry *pmksa,
return;
sm->pmksa = pmksa;
if (sm->pmksa->pmk)
os_memcpy(pmk, sm->pmksa->pmk, PMK_LEN);
if (sm->pmksa->pmkid) {
os_memcpy(pmkid, sm->pmksa->pmkid, PMKID_LEN);
os_memcpy(wpa_auth->dot11RSNAPMKIDUsed,
sm->pmksa->pmkid, PMKID_LEN);
}
os_memcpy(pmk, pmksa->pmk, PMK_LEN);
os_memcpy(pmkid, pmksa->pmkid, PMKID_LEN);
os_memcpy(wpa_auth->dot11RSNAPMKIDUsed, pmksa->pmkid, PMKID_LEN);
}