aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-03-22 18:37:46 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-22 18:38:44 (GMT)
commit8854f90badc0ca16e1de381f35e9e3d99af452c9 (patch)
tree3b3d3d26245f3d0d9a915065c4214a7f62f79aa8
parent32d4fe9549436e20921fae79da30cdbe0d9bb853 (diff)
downloadhostap-8854f90badc0ca16e1de381f35e9e3d99af452c9.zip
hostap-8854f90badc0ca16e1de381f35e9e3d99af452c9.tar.gz
hostap-8854f90badc0ca16e1de381f35e9e3d99af452c9.tar.bz2
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>
-rw-r--r--src/ap/wpa_auth.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 779a40d..3587086 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -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);
}