mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
report the compression algorithms to occtl
This commit is contained in:
@@ -40,6 +40,9 @@ message user_info_rep
|
||||
repeated string routes = 20;
|
||||
repeated string iroutes = 21;
|
||||
optional uint32 mtu = 22;
|
||||
|
||||
optional string cstp_compr = 23;
|
||||
optional string dtls_compr = 24;
|
||||
}
|
||||
|
||||
message user_list_rep
|
||||
|
||||
@@ -103,6 +103,8 @@ message session_info_msg
|
||||
required string tls_ciphersuite = 1;
|
||||
required string dtls_ciphersuite = 2;
|
||||
required string user_agent = 3;
|
||||
optional string cstp_compr = 4;
|
||||
optional string dtls_compr = 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -329,6 +329,9 @@ static int append_user_info(method_ctx *ctx,
|
||||
|
||||
rep->tls_ciphersuite = ctmp->tls_ciphersuite;
|
||||
rep->dtls_ciphersuite = ctmp->dtls_ciphersuite;
|
||||
|
||||
rep->cstp_compr = ctmp->cstp_compr;
|
||||
rep->dtls_compr = ctmp->dtls_compr;
|
||||
if (ctmp->mtu > 0) {
|
||||
rep->mtu = ctmp->mtu;
|
||||
rep->has_mtu = 1;
|
||||
|
||||
@@ -590,6 +590,12 @@ int handle_commands(main_server_st * s, struct proc_st *proc)
|
||||
if (tmsg->dtls_ciphersuite)
|
||||
strlcpy(proc->dtls_ciphersuite, tmsg->dtls_ciphersuite,
|
||||
sizeof(proc->dtls_ciphersuite));
|
||||
if (tmsg->cstp_compr)
|
||||
strlcpy(proc->cstp_compr, tmsg->cstp_compr,
|
||||
sizeof(proc->cstp_compr));
|
||||
if (tmsg->dtls_compr)
|
||||
strlcpy(proc->dtls_compr, tmsg->dtls_compr,
|
||||
sizeof(proc->dtls_compr));
|
||||
if (tmsg->user_agent)
|
||||
strlcpy(proc->user_agent, tmsg->user_agent,
|
||||
sizeof(proc->user_agent));
|
||||
|
||||
@@ -132,6 +132,8 @@ typedef struct proc_st {
|
||||
char user_agent[MAX_AGENT_NAME];
|
||||
char tls_ciphersuite[MAX_CIPHERSUITE_NAME];
|
||||
char dtls_ciphersuite[MAX_CIPHERSUITE_NAME];
|
||||
char cstp_compr[8];
|
||||
char dtls_compr[8];
|
||||
unsigned mtu;
|
||||
|
||||
/* pointer to the cookie used by this session */
|
||||
|
||||
@@ -639,6 +639,11 @@ int common_info_cmd(UserListRep * args)
|
||||
if (args->user[i]->dtls_ciphersuite != NULL && args->user[i]->dtls_ciphersuite[0] != 0)
|
||||
fprintf(out, "\tDTLS cipher: %s\n", args->user[i]->dtls_ciphersuite);
|
||||
|
||||
if (args->user[i]->cstp_compr && args->user[i]->cstp_compr[0] != 0)
|
||||
fprintf(out, "\tCSTP compression: %s\n", args->user[i]->cstp_compr);
|
||||
if (args->user[i]->dtls_compr != NULL && args->user[i]->dtls_compr[0] != 0)
|
||||
fprintf(out, "\tDTLS compression: %s\n", args->user[i]->dtls_compr);
|
||||
|
||||
/* user network info */
|
||||
fputs("\n", out);
|
||||
if (print_list_entries(out, "\tDNS:", args->user[i]->dns, args->user[i]->n_dns) < 0)
|
||||
|
||||
@@ -723,11 +723,15 @@ void session_info_send(worker_st * ws)
|
||||
|
||||
if (ws->session) {
|
||||
msg.tls_ciphersuite = gnutls_session_get_desc(ws->session);
|
||||
if (ws->cstp_selected_comp)
|
||||
msg.cstp_compr = (char*)ws->cstp_selected_comp->name;
|
||||
}
|
||||
|
||||
if (ws->udp_state != UP_DISABLED && ws->dtls_session) {
|
||||
msg.dtls_ciphersuite =
|
||||
gnutls_session_get_desc(ws->dtls_session);
|
||||
if (ws->dtls_selected_comp)
|
||||
msg.dtls_compr = (char*)ws->dtls_selected_comp->name;
|
||||
}
|
||||
|
||||
if (ws->req.user_agent[0] != 0) {
|
||||
|
||||
Reference in New Issue
Block a user