mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
Ensure that any messages are being forwarded even on success packet
This commit is contained in:
@@ -123,6 +123,10 @@ int send_sec_auth_reply(int cfd, sec_mod_st * sec, client_entry_st * entry, AUTH
|
|||||||
|
|
||||||
msg.user_name = entry->username;
|
msg.user_name = entry->username;
|
||||||
|
|
||||||
|
if (entry->msg_str[0] != 0) {
|
||||||
|
msg.msg = entry->msg_str;
|
||||||
|
}
|
||||||
|
|
||||||
msg.has_sid = 1;
|
msg.has_sid = 1;
|
||||||
msg.sid.data = entry->sid;
|
msg.sid.data = entry->sid;
|
||||||
msg.sid.len = sizeof(entry->sid);
|
msg.sid.len = sizeof(entry->sid);
|
||||||
|
|||||||
+5
-1
@@ -713,6 +713,8 @@ static int recv_auth_reply(worker_st * ws, int sd, char *txt,
|
|||||||
oclog(ws, LOG_DEBUG, "received auth reply message (value: %u)",
|
oclog(ws, LOG_DEBUG, "received auth reply message (value: %u)",
|
||||||
(unsigned)msg->reply);
|
(unsigned)msg->reply);
|
||||||
|
|
||||||
|
if (txt) txt[0] = 0;
|
||||||
|
|
||||||
switch (msg->reply) {
|
switch (msg->reply) {
|
||||||
case AUTH__REP__MSG:
|
case AUTH__REP__MSG:
|
||||||
if (txt == NULL || msg->msg == NULL) {
|
if (txt == NULL || msg->msg == NULL) {
|
||||||
@@ -759,6 +761,9 @@ static int recv_auth_reply(worker_st * ws, int sd, char *txt,
|
|||||||
memcpy(ws->session_id, msg->dtls_session_id.data,
|
memcpy(ws->session_id, msg->dtls_session_id.data,
|
||||||
msg->dtls_session_id.len);
|
msg->dtls_session_id.len);
|
||||||
|
|
||||||
|
if (msg->msg && txt)
|
||||||
|
strlcpy(txt, msg->msg, max_txt_size);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case AUTH__REP__FAILED:
|
case AUTH__REP__FAILED:
|
||||||
default:
|
default:
|
||||||
@@ -1323,7 +1328,6 @@ int post_auth_handler(worker_st * ws, unsigned http_ver)
|
|||||||
goto auth_fail;
|
goto auth_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg[0] = 0;
|
|
||||||
ret = recv_auth_reply(ws, sd, msg, sizeof(msg));
|
ret = recv_auth_reply(ws, sd, msg, sizeof(msg));
|
||||||
if (sd != -1) {
|
if (sd != -1) {
|
||||||
close(sd);
|
close(sd);
|
||||||
|
|||||||
Reference in New Issue
Block a user