Lines Matching refs:sess
357 struct radius_session *sess = client->sessions;
359 while (sess) {
360 if (sess->sess_id == sess_id) {
363 sess = sess->next;
366 return sess;
371 struct radius_session *sess)
373 eloop_cancel_timeout(radius_server_session_timeout, data, sess);
374 eloop_cancel_timeout(radius_server_session_remove_timeout, data, sess);
375 eap_server_sm_deinit(sess->eap);
376 radius_msg_free(sess->last_msg);
377 os_free(sess->last_from_addr);
378 radius_msg_free(sess->last_reply);
379 os_free(sess);
385 struct radius_session *sess)
387 struct radius_client *client = sess->client;
390 eloop_cancel_timeout(radius_server_session_remove_timeout, data, sess);
395 if (session == sess) {
397 client->sessions = sess->next;
399 prev->next = sess->next;
401 radius_server_session_free(data, sess);
414 struct radius_session *sess = timeout_ctx;
415 RADIUS_DEBUG("Removing completed session 0x%x", sess->sess_id);
416 radius_server_session_remove(data, sess);
423 struct radius_session *sess = timeout_ctx;
425 RADIUS_DEBUG("Timing out authentication session 0x%x", sess->sess_id);
426 radius_server_session_remove(data, sess);
434 struct radius_session *sess;
442 sess = os_zalloc(sizeof(*sess));
443 if (sess == NULL)
446 sess->server = data;
447 sess->client = client;
448 sess->sess_id = data->next_sess_id++;
449 sess->next = client->sessions;
450 client->sessions = sess;
452 radius_server_session_timeout, data, sess);
454 return sess;
466 struct radius_session *sess;
489 sess = radius_server_new_session(data, client);
490 if (sess == NULL) {
516 sess->eap = eap_server_sm_init(sess, &radius_server_eapol_cb,
518 if (sess->eap == NULL) {
521 radius_server_session_free(data, sess);
524 sess->eap_if = eap_get_interface(sess->eap);
525 sess->eap_if->eapRestart = TRUE;
526 sess->eap_if->portEnabled = TRUE;
528 RADIUS_DEBUG("New session 0x%x initialized", sess->sess_id);
530 return sess;
537 struct radius_session *sess,
545 if (sess->eap_if->eapFail) {
546 sess->eap_if->eapFail = FALSE;
548 } else if (sess->eap_if->eapSuccess) {
549 sess->eap_if->eapSuccess = FALSE;
552 sess->eap_if->eapReq = FALSE;
562 sess_id = htonl(sess->sess_id);
569 if (sess->eap_if->eapReqData &&
570 !radius_msg_add_eap(msg, wpabuf_head(sess->eap_if->eapReqData),
571 wpabuf_len(sess->eap_if->eapReqData))) {
575 if (code == RADIUS_CODE_ACCESS_ACCEPT && sess->eap_if->eapKeyData) {
577 if (sess->eap_if->eapKeyDataLen > 64) {
580 len = sess->eap_if->eapKeyDataLen / 2;
585 sess->eap_if->eapKeyData + len,
586 len, sess->eap_if->eapKeyData,
681 struct radius_session *sess;
686 sess = force_sess;
693 sess = radius_server_get_session(client, state);
695 sess = NULL;
699 if (sess) {
700 RADIUS_DEBUG("Request for session 0x%x", sess->sess_id);
707 sess = radius_server_get_new_session(data, client, msg);
708 if (sess == NULL) {
716 if (sess->last_from_port == from_port &&
717 sess->last_identifier == radius_msg_get_hdr(msg)->identifier &&
718 os_memcmp(sess->last_authenticator,
724 if (sess->last_reply) {
726 buf = radius_msg_get_buf(sess->last_reply);
759 wpabuf_free(sess->eap_if->eapRespData);
760 sess->eap_if->eapRespData = wpabuf_alloc_ext_data(eap, eap_len);
761 if (sess->eap_if->eapRespData == NULL)
764 sess->eap_if->eapResp = TRUE;
765 eap_server_sm_step(sess->eap);
767 if ((sess->eap_if->eapReq || sess->eap_if->eapSuccess ||
768 sess->eap_if->eapFail) && sess->eap_if->eapReqData) {
770 wpabuf_head(sess->eap_if->eapReqData),
771 wpabuf_len(sess->eap_if->eapReqData));
772 } else if (sess->eap_if->eapFail) {
775 } else if (eap_sm_method_pending(sess->eap)) {
776 radius_msg_free(sess->last_msg);
777 sess->last_msg = msg;
778 sess->last_from_port = from_port;
779 os_free(sess->last_from_addr);
780 sess->last_from_addr = os_strdup(from_addr);
781 sess->last_fromlen = fromlen;
782 os_memcpy(&sess->last_from, from, fromlen);
793 if (sess->eap_if->eapSuccess || sess->eap_if->eapFail)
796 reply = radius_server_encapsulate_eap(data, client, sess, msg);
828 radius_msg_free(sess->last_reply);
829 sess->last_reply = reply;
830 sess->last_from_port = from_port;
832 sess->last_identifier = hdr->identifier;
833 os_memcpy(sess->last_authenticator, hdr->authenticator, 16);
841 sess->sess_id);
843 data, sess);
846 data, sess);
1457 struct radius_session *sess = ctx;
1458 struct radius_server_data *data = sess->server;
1467 struct radius_session *sess = ctx;
1468 struct radius_server_data *data = sess->server;
1492 struct radius_session *s, *sess = NULL;
1501 sess = s;
1504 if (sess)
1507 if (sess)
1511 if (sess == NULL) {
1516 msg = sess->last_msg;
1517 sess->last_msg = NULL;
1518 eap_sm_pending_cb(sess->eap);
1520 (struct sockaddr *) &sess->last_from,
1521 sess->last_fromlen, cli,
1522 sess->last_from_addr,
1523 sess->last_from_port, sess) == -2)