diff options
author | Vladimir Khomutov <vl@inspert.ru> | 2023-09-22 19:23:57 +0400 |
---|---|---|
committer | Vladimir Khomutov <vl@inspert.ru> | 2023-09-22 19:23:57 +0400 |
commit | c37fdcdd1e1527d2c98cc68a978cf928589c7330 (patch) | |
tree | f827aa2fb59c50e82481a11722e04b95c5bfb319 | |
parent | 027b68168867514665751a65780f050952bc48ec (diff) | |
download | nginx-c37fdcdd1e1527d2c98cc68a978cf928589c7330.tar.gz nginx-c37fdcdd1e1527d2c98cc68a978cf928589c7330.zip |
QUIC: handle callback errors in compat.
The error may be triggered in add_handhshake_data() by incorrect transport
parameter sent by client. The expected behaviour in this case is to close
connection complaining about incorrect parameter. Currently the connection
just times out.
-rw-r--r-- | src/event/quic/ngx_event_quic_openssl_compat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/event/quic/ngx_event_quic_openssl_compat.c b/src/event/quic/ngx_event_quic_openssl_compat.c index e970cfb9b..cc6b95d48 100644 --- a/src/event/quic/ngx_event_quic_openssl_compat.c +++ b/src/event/quic/ngx_event_quic_openssl_compat.c @@ -408,7 +408,9 @@ ngx_quic_compat_message_callback(int write_p, int version, int content_type, "quic compat tx %s len:%uz ", ngx_quic_level_name(level), len); - (void) com->method->add_handshake_data(ssl, level, buf, len); + if (com->method->add_handshake_data(ssl, level, buf, len) != 1) { + goto failed; + } break; @@ -420,11 +422,19 @@ ngx_quic_compat_message_callback(int write_p, int version, int content_type, "quic compat %s alert:%ui len:%uz ", ngx_quic_level_name(level), alert, len); - (void) com->method->send_alert(ssl, level, alert); + if (com->method->send_alert(ssl, level, alert) != 1) { + goto failed; + } } break; } + + return; + +failed: + + ngx_post_event(&qc->close, &ngx_posted_events); } |