mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-13 18:12:03 +08:00
Allow TUN_MTU command only in authenticated state
This commit is contained in:
+7
-3
@@ -516,6 +516,13 @@ int handle_commands(main_server_st * s, struct proc_st *proc)
|
|||||||
case CMD_TUN_MTU:{
|
case CMD_TUN_MTU:{
|
||||||
TunMtuMsg *tmsg;
|
TunMtuMsg *tmsg;
|
||||||
|
|
||||||
|
if (proc->status != PS_AUTH_COMPLETED) {
|
||||||
|
mslog(s, proc, LOG_ERR,
|
||||||
|
"received TUN MTU in unauthenticated state.");
|
||||||
|
ret = ERR_BAD_COMMAND;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
tmsg = tun_mtu_msg__unpack(NULL, raw_len, raw);
|
tmsg = tun_mtu_msg__unpack(NULL, raw_len, raw);
|
||||||
if (tmsg == NULL) {
|
if (tmsg == NULL) {
|
||||||
mslog(s, proc, LOG_ERR, "error unpacking data");
|
mslog(s, proc, LOG_ERR, "error unpacking data");
|
||||||
@@ -526,7 +533,6 @@ int handle_commands(main_server_st * s, struct proc_st *proc)
|
|||||||
set_tun_mtu(s, proc, tmsg->mtu);
|
set_tun_mtu(s, proc, tmsg->mtu);
|
||||||
|
|
||||||
tun_mtu_msg__free_unpacked(tmsg, NULL);
|
tun_mtu_msg__free_unpacked(tmsg, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -578,7 +584,6 @@ int handle_commands(main_server_st * s, struct proc_st *proc)
|
|||||||
mslog(s, proc, LOG_DEBUG,
|
mslog(s, proc, LOG_DEBUG,
|
||||||
"could not store resumption data");
|
"could not store resumption data");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -753,7 +758,6 @@ int handle_commands(main_server_st * s, struct proc_st *proc)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AUTH_COOKIE_REQ:
|
case AUTH_COOKIE_REQ:
|
||||||
|
|
||||||
if (proc->status != PS_AUTH_INACTIVE) {
|
if (proc->status != PS_AUTH_INACTIVE) {
|
||||||
mslog(s, proc, LOG_ERR,
|
mslog(s, proc, LOG_ERR,
|
||||||
"received unexpected cookie authentication.");
|
"received unexpected cookie authentication.");
|
||||||
|
|||||||
Reference in New Issue
Block a user