mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
better definition names.
This commit is contained in:
@@ -95,7 +95,7 @@ struct proc_st {
|
||||
* who re-uses it when it performs authentication in multiple
|
||||
* sessions.
|
||||
*/
|
||||
uint8_t sid[MAX_SID_SIZE];
|
||||
uint8_t sid[SID_SIZE];
|
||||
unsigned sid_size; /* acts as a flag if sid is set */
|
||||
|
||||
/* The DTLS session ID associated with the TLS session
|
||||
@@ -110,7 +110,9 @@ struct proc_st {
|
||||
char hostname[MAX_HOSTNAME_SIZE]; /* the requested hostname */
|
||||
uint8_t cookie[COOKIE_SIZE]; /* the cookie associated with the session */
|
||||
|
||||
char user_agent[MAX_AGENT_SIZE];
|
||||
/* the following are copied here from the worker process for reporting
|
||||
* purposes (from main-ctl-handler). */
|
||||
char user_agent[MAX_AGENT_NAME];
|
||||
char tls_ciphersuite[MAX_CIPHERSUITE_NAME];
|
||||
char dtls_ciphersuite[MAX_DTLS_CIPHERSUITE_NAME];
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ extern int syslog_open;
|
||||
#define MAX_CIPHERSUITE_NAME 64
|
||||
#define MAX_DTLS_CIPHERSUITE_NAME 24
|
||||
#define MAX_MSG_SIZE 256
|
||||
#define MAX_SID_SIZE 12
|
||||
#define SID_SIZE 12
|
||||
|
||||
#define MAX_ZOMBIE_SECS 240
|
||||
|
||||
@@ -233,7 +233,7 @@ struct main_server_st;
|
||||
|
||||
#define MAX_BANNER_SIZE 256
|
||||
#define MAX_USERNAME_SIZE 64
|
||||
#define MAX_AGENT_SIZE 32
|
||||
#define MAX_AGENT_NAME 32
|
||||
#define MAX_PASSWORD_SIZE 64
|
||||
#define TLS_MASTER_SIZE 48
|
||||
#define MAX_HOSTNAME_SIZE MAX_USERNAME_SIZE
|
||||
|
||||
@@ -93,7 +93,7 @@ int get_auth_handler2(worker_st * ws, unsigned http_ver, const char *pmsg)
|
||||
return -1;
|
||||
|
||||
if (req->sid_cookie_set == 0) {
|
||||
char context[BASE64_LENGTH(MAX_SID_SIZE)+1];
|
||||
char context[BASE64_LENGTH(SID_SIZE)+1];
|
||||
size_t csize = sizeof(context);
|
||||
|
||||
base64_encode((char*)ws->sid, sizeof(ws->sid), (char*)context, csize);
|
||||
|
||||
@@ -223,7 +223,7 @@ static void value_check(struct worker_st *ws, struct http_req_st *req)
|
||||
req->hostname[req->value.length] = 0;
|
||||
break;
|
||||
case HEADER_USER_AGENT:
|
||||
if (req->value.length + 1 > MAX_AGENT_SIZE) {
|
||||
if (req->value.length + 1 > MAX_AGENT_NAME) {
|
||||
req->user_agent[0] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ struct http_req_st {
|
||||
unsigned int header_state;
|
||||
|
||||
char hostname[MAX_HOSTNAME_SIZE];
|
||||
char user_agent[MAX_AGENT_SIZE];
|
||||
char user_agent[MAX_AGENT_NAME];
|
||||
unsigned int next_header;
|
||||
unsigned char cookie[COOKIE_SIZE];
|
||||
unsigned int cookie_set;
|
||||
@@ -108,7 +108,7 @@ typedef struct worker_st {
|
||||
gnutls_session_t dtls_session;
|
||||
|
||||
/* inique session identifier */
|
||||
uint8_t sid[MAX_SID_SIZE];
|
||||
uint8_t sid[SID_SIZE];
|
||||
|
||||
int cmd_fd;
|
||||
int conn_fd;
|
||||
|
||||
Reference in New Issue
Block a user