mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-08 09:21:48 +08:00
Merge branch 'tmp-736' into 'master'
Fix calculation of avg_auth_time acros sec-mod instances Closes #736 See merge request openconnect/ocserv!560
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
* /ca.pem
|
* /ca.pem
|
||||||
* /ca.cer
|
* /ca.cer
|
||||||
- Fix incorrect local address when using PROXY protocol with IPv6 (#711).
|
- Fix incorrect local address when using PROXY protocol with IPv6 (#711).
|
||||||
|
- Fix calculation of avg_auth_time across sec-mod instances (#736)
|
||||||
|
- The bundled llhttp was updated to 9.4.1.
|
||||||
|
|
||||||
|
|
||||||
* Version 1.4.2 (released 2026-04-16)
|
* Version 1.4.2 (released 2026-04-16)
|
||||||
|
|||||||
@@ -316,6 +316,14 @@ void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void llhttp_set_lenient_header_value_relaxed(llhttp_t* parser, int enabled) {
|
||||||
|
if (enabled) {
|
||||||
|
parser->lenient_flags |= LENIENT_HEADER_VALUE_RELAXED;
|
||||||
|
} else {
|
||||||
|
parser->lenient_flags &= ~LENIENT_HEADER_VALUE_RELAXED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -353,6 +353,23 @@ void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled)
|
|||||||
LLHTTP_EXPORT
|
LLHTTP_EXPORT
|
||||||
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
|
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
|
||||||
|
|
||||||
|
/* Enables/disables relaxed handling of unusual characters in header values.
|
||||||
|
*
|
||||||
|
* RFC 9110 describes NULL, CR and LF as 'dangerous' and says they MUST be
|
||||||
|
* rejected, while other control characters are merely 'invalid' and discouraged,
|
||||||
|
* and are explicitly allowed by other standards (e.g. WHATWG Fetch) and
|
||||||
|
* in surprisingly common use on the web.
|
||||||
|
*
|
||||||
|
* This flag enables these 'invalid but common' characters, aiming to
|
||||||
|
* maximize compatibility without enabling any potentially dangerous scenarios.
|
||||||
|
*
|
||||||
|
* Unlike `llhttp_set_lenient_headers()`, this does NOT enable any other
|
||||||
|
* potentially unsafe behaviors (like accepting whitespace before colons
|
||||||
|
* or after the start line).
|
||||||
|
*/
|
||||||
|
LLHTTP_EXPORT
|
||||||
|
void llhttp_set_lenient_header_value_relaxed(llhttp_t* parser, int enabled);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+407
-241
File diff suppressed because it is too large
Load Diff
+20
-2
@@ -3,7 +3,7 @@
|
|||||||
#define INCLUDE_LLHTTP_H_
|
#define INCLUDE_LLHTTP_H_
|
||||||
|
|
||||||
#define LLHTTP_VERSION_MAJOR 9
|
#define LLHTTP_VERSION_MAJOR 9
|
||||||
#define LLHTTP_VERSION_MINOR 3
|
#define LLHTTP_VERSION_MINOR 4
|
||||||
#define LLHTTP_VERSION_PATCH 1
|
#define LLHTTP_VERSION_PATCH 1
|
||||||
|
|
||||||
#ifndef INCLUDE_LLHTTP_ITSELF_H_
|
#ifndef INCLUDE_LLHTTP_ITSELF_H_
|
||||||
@@ -118,7 +118,8 @@ enum llhttp_lenient_flags {
|
|||||||
LENIENT_OPTIONAL_LF_AFTER_CR = 0x40,
|
LENIENT_OPTIONAL_LF_AFTER_CR = 0x40,
|
||||||
LENIENT_OPTIONAL_CRLF_AFTER_CHUNK = 0x80,
|
LENIENT_OPTIONAL_CRLF_AFTER_CHUNK = 0x80,
|
||||||
LENIENT_OPTIONAL_CR_BEFORE_LF = 0x100,
|
LENIENT_OPTIONAL_CR_BEFORE_LF = 0x100,
|
||||||
LENIENT_SPACES_AFTER_CHUNK_SIZE = 0x200
|
LENIENT_SPACES_AFTER_CHUNK_SIZE = 0x200,
|
||||||
|
LENIENT_HEADER_VALUE_RELAXED = 0x400
|
||||||
};
|
};
|
||||||
typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
|
typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
|
||||||
|
|
||||||
@@ -898,6 +899,23 @@ void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled)
|
|||||||
LLHTTP_EXPORT
|
LLHTTP_EXPORT
|
||||||
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
|
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
|
||||||
|
|
||||||
|
/* Enables/disables relaxed handling of unusual characters in header values.
|
||||||
|
*
|
||||||
|
* RFC 9110 describes NULL, CR and LF as 'dangerous' and says they MUST be
|
||||||
|
* rejected, while other control characters are merely 'invalid' and discouraged,
|
||||||
|
* and are explicitly allowed by other standards (e.g. WHATWG Fetch) and
|
||||||
|
* in surprisingly common use on the web.
|
||||||
|
*
|
||||||
|
* This flag enables these 'invalid but common' characters, aiming to
|
||||||
|
* maximize compatibility without enabling any potentially dangerous scenarios.
|
||||||
|
*
|
||||||
|
* Unlike `llhttp_set_lenient_headers()`, this does NOT enable any other
|
||||||
|
* potentially unsafe behaviors (like accepting whitespace before colons
|
||||||
|
* or after the start line).
|
||||||
|
*/
|
||||||
|
LLHTTP_EXPORT
|
||||||
|
void llhttp_set_lenient_header_value_relaxed(llhttp_t* parser, int enabled);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -227,7 +227,7 @@ static void method_status(method_ctx *ctx, int cfd, uint8_t *msg,
|
|||||||
rep.max_auth_time =
|
rep.max_auth_time =
|
||||||
MAX(rep.max_auth_time,
|
MAX(rep.max_auth_time,
|
||||||
ctx->s->sec_mod_instances[i].max_auth_time);
|
ctx->s->sec_mod_instances[i].max_auth_time);
|
||||||
rep.avg_auth_time = ctx->s->sec_mod_instances[i].avg_auth_time;
|
rep.avg_auth_time += ctx->s->sec_mod_instances[i].avg_auth_time;
|
||||||
}
|
}
|
||||||
if (ctx->s->sec_mod_instance_count != 0) {
|
if (ctx->s->sec_mod_instance_count != 0) {
|
||||||
rep.avg_auth_time /= ctx->s->sec_mod_instance_count;
|
rep.avg_auth_time /= ctx->s->sec_mod_instance_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user