aboutsummaryrefslogtreecommitdiffstats
path: root/src/eapol_auth/eapol_auth_sm.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-02-06 14:27:52 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-06 15:19:35 (GMT)
commit1fc63fe2998c6d4218b503e90d6c6fe4075f05ba (patch)
tree485cc55b19550c04092b7724c213c443b66cb246 /src/eapol_auth/eapol_auth_sm.c
parent2cbc6ffb3a996192b03d6af90b8558daba376768 (diff)
downloadhostap-1fc63fe2998c6d4218b503e90d6c6fe4075f05ba.zip
hostap-1fc63fe2998c6d4218b503e90d6c6fe4075f05ba.tar.gz
hostap-1fc63fe2998c6d4218b503e90d6c6fe4075f05ba.tar.bz2
RADIUS: Share a single function for generating session IDs
There is no need to maintain three copies of this functionality even if it is currently implemented as a single function call. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eapol_auth/eapol_auth_sm.c')
-rw-r--r--src/eapol_auth/eapol_auth_sm.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/eapol_auth/eapol_auth_sm.c b/src/eapol_auth/eapol_auth_sm.c
index 62db368..ff673bb 100644
--- a/src/eapol_auth/eapol_auth_sm.c
+++ b/src/eapol_auth/eapol_auth_sm.c
@@ -866,16 +866,13 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
sm->radius_cui = wpabuf_alloc_copy(radius_cui,
os_strlen(radius_cui));
- /*
- * Acct-Multi-Session-Id should be globally and temporarily unique.
- * A high quality random number is required therefore.
- * This could be be improved by switching to a GUID.
- */
- if (os_get_random((u8 *) &sm->acct_multi_session_id,
- sizeof(sm->acct_multi_session_id)) < 0) {
+#ifndef CONFIG_NO_RADIUS
+ if (radius_gen_session_id((u8 *) &sm->acct_multi_session_id,
+ sizeof(sm->acct_multi_session_id)) < 0) {
eapol_auth_free(sm);
return NULL;
}
+#endif /* CONFIG_NO_RADIUS */
return sm;
}