mirror of
https://github.com/nginx/nginx.git
synced 2025-08-01 02:56:15 +08:00
QUIC: fixed parsing of unknown frame types.
The ngx_quic_frame_allowed() function only expects known frame types.
This commit is contained in:
parent
17eebfea99
commit
db4c8fe45f
@ -742,6 +742,13 @@ ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end,
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (varint > NGX_QUIC_FT_LAST) {
|
||||||
|
pkt->error = NGX_QUIC_ERR_FRAME_ENCODING_ERROR;
|
||||||
|
ngx_log_error(NGX_LOG_INFO, pkt->log, 0,
|
||||||
|
"quic unknown frame type 0x%xL", varint);
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
f->type = varint;
|
f->type = varint;
|
||||||
|
|
||||||
if (ngx_quic_frame_allowed(pkt, f->type) != NGX_OK) {
|
if (ngx_quic_frame_allowed(pkt, f->type) != NGX_OK) {
|
||||||
|
@ -83,6 +83,8 @@
|
|||||||
#define NGX_QUIC_FT_CONNECTION_CLOSE_APP 0x1D
|
#define NGX_QUIC_FT_CONNECTION_CLOSE_APP 0x1D
|
||||||
#define NGX_QUIC_FT_HANDSHAKE_DONE 0x1E
|
#define NGX_QUIC_FT_HANDSHAKE_DONE 0x1E
|
||||||
|
|
||||||
|
#define NGX_QUIC_FT_LAST NGX_QUIC_FT_HANDSHAKE_DONE
|
||||||
|
|
||||||
/* 22.4. QUIC Transport Error Codes Registry */
|
/* 22.4. QUIC Transport Error Codes Registry */
|
||||||
/* Keep in sync with ngx_quic_errors[] */
|
/* Keep in sync with ngx_quic_errors[] */
|
||||||
#define NGX_QUIC_ERR_NO_ERROR 0x00
|
#define NGX_QUIC_ERR_NO_ERROR 0x00
|
||||||
|
Loading…
Reference in New Issue
Block a user