summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-10ChaCha20 / Poly1305 initial support.Sergey Kandaurov1-0/+14
2020-03-10Using SSL cipher suite id to obtain cipher/digest, part 2.Sergey Kandaurov1-107/+114
Ciphers negotiation handling refactored into ngx_quic_ciphers().
2020-03-10Fixed nonce in short packet protection.Sergey Kandaurov1-1/+3
2020-03-10Generic payload handler for quic packets.Vladimir Homutov1-184/+367
- added basic parsing of ACK, PING and PADDING frames on input - added preliminary parsing of SHORT headers The ngx_quic_output() is now called after processing of each input packet. Frames are added into output queue according to their level: inital packets go ahead of handshake and application data, so they can be merged properly. The payload handler is called from both new, handshake and applicataion data handlers (latter is a stub).
2020-03-05Fixed header protection with negotiated cipher suite.Sergey Kandaurov1-29/+33
2020-03-05Initial packets are protected with AEAD_AES_128_GCM.Sergey Kandaurov1-9/+14
2020-03-05Fixed write secret logging in set_encryption_secrets callback.Sergey Kandaurov1-1/+1
2020-03-05Fixed format specifiers.Vladimir Homutov1-2/+2
2020-03-05Style.Vladimir Homutov1-8/+10
2020-03-05Added functions to decrypt long packets.Vladimir Homutov1-179/+264
2020-03-05Fixed ngx_quic_varint_len misuse in the previous change.Sergey Kandaurov1-1/+1
2020-03-04Macro for calculating size of varint.Vladimir Homutov1-6/+3
2020-03-05Fixed packet "input" debug log message.Sergey Kandaurov1-1/+1
2020-03-05Using SSL cipher suite id to obtain cipher/digest, part 1.Sergey Kandaurov1-33/+32
While here, log the negotiated cipher just once, - after handshake.
2020-03-05Using cached ssl_conn in ngx_quic_handshake_input(), NFC.Sergey Kandaurov1-10/+11
2020-03-04Adjusted transport parameters stub for active_connection_id_limit.Sergey Kandaurov1-1/+2
As was objserved with ngtcp2 client, Finished CRYPTO frame within Handshake packet may not be sent for some reason if there's nothing to append on 1-RTT. This results in unnecessary retransmit. To avoid this edge case, a non-zero active_connection_id_limit transport parameter is now used to append datagram with NEW_CONNECTION_ID 1-RTT frames.
2020-03-04Implemented improved version of quic_output().Vladimir Homutov1-95/+276
Now handshake generates frames, and they are queued in c->quic->frames. The ngx_quic_output() is called from ngx_quic_flush_flight() or manually, processes the queue and encrypts all frames according to required encryption level.
2020-03-03QUIC handshake final bits.Sergey Kandaurov1-9/+207
Added handling of client Finished, both feeding and acknowledgement. This includes sending NST in 1-RTT triggered by a handshake process.
2020-03-03Split frame and packet generation into separate steps.Vladimir Homutov1-90/+181
While there, a number of QUIC constants from spec defined and magic numbers were replaced.
2020-03-02Aded the "ngx_quic_hexdump" macro.Vladimir Homutov1-176/+69
ngx_quic_hexdump0(log, format, buffer, buffer_size); - logs hexdump of buffer to specified error log ngx_quic_hexdump0(c->log, "this is foo:", foo.data, foo.len); ngx_quic_hexdump(log, format, buffer, buffer_size, ...) - same as hexdump0, but more format/args possible: ngx_quic_hexdump(c->log, "a=%d b=%d, foo is:", foo.data, foo.len, a, b);
2020-02-28Moved all QUIC code into ngx_event_quic.cVladimir Homutov4-965/+1049
Introduced ngx_quic_input() and ngx_quic_output() as interface between nginx and protocol. They are the only functions that are exported. While there, added copyrights.
2020-02-28Introduced quic_version macro, uint16/uint32 routines ported.Sergey Kandaurov3-10/+50
2020-02-28Cleanup.Sergey Kandaurov5-211/+91
2020-02-26Generic function for HKDF expansion.Vladimir Homutov4-500/+166
2020-02-28QUIC header protection routines, introduced ngx_quic_tls_hp().Sergey Kandaurov4-56/+42
2020-02-28AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().Sergey Kandaurov4-376/+284
2020-02-28Transport parameters stub, to complete handshake.Sergey Kandaurov1-1/+11
2020-02-28Introduced ngx_quic_secret_t.Sergey Kandaurov3-147/+132
2020-02-28QUIC handshake handler, draft 24 bump.Sergey Kandaurov2-4/+354
2020-02-28Fixed indentation.Sergey Kandaurov1-199/+196
2020-02-28PN-aware AEAD nonce, feeding proper CRYPTO length.Sergey Kandaurov2-14/+62
2020-02-28OpenSSL compatibility.Sergey Kandaurov5-132/+664
2020-02-28QUIC add_handshake_data callback, varint routines.Sergey Kandaurov3-44/+151
2020-02-28QUIC set_encryption_secrets callback.Sergey Kandaurov3-21/+232
2020-02-28Server Initial Keys.Sergey Kandaurov2-4/+142
2020-02-28Initial QUIC support in http.Sergey Kandaurov12-26/+764
2020-02-28HTTP UDP layer, QUIC support autotest.Sergey Kandaurov4-1/+24
2020-02-28Added default overwrite in error_page 494.Maxim Dounin1-0/+1
We used to have default error_page overwrite for 495, 496, and 497, so a configuration like error_page 495 /error; will result in error 400, much like without any error_page configured. The 494 status code was introduced later (in 3848:de59ad6bf557, nginx 0.9.4), and relevant changes to ngx_http_core_error_page() were missed, resulting in inconsistent behaviour of "error_page 494" - with error_page configured it results in 494 being returned instead of 400. Reported by Frank Liu, http://mailman.nginx.org/pipermail/nginx/2020-February/058957.html.
2020-02-26Mp4: fixed possible chunk offset overflow.Roman Arutyunyan1-11/+64
In "co64" atom chunk start offset is a 64-bit unsigned integer. When trimming the "mdat" atom, chunk offsets are casted to off_t values which are typically 64-bit signed integers. A specially crafted mp4 file with huge chunk offsets may lead to off_t overflow and result in negative trim boundaries. The consequences of the overflow are: - Incorrect Content-Length header value in the response. - Negative left boundary of the response file buffer holding the trimmed "mdat". This leads to pread()/sendfile() errors followed by closing the client connection. On rare systems where off_t is a 32-bit integer, this scenario is also feasible with the "stco" atom. The fix is to add checks which make sure data chunks referenced by each track are within the mp4 file boundaries. Additionally a few more checks are added to ensure mp4 file consistency and log errors.
2020-02-27Disabled connection reuse while in SSL handshake.Sergey Kandaurov1-2/+2
During SSL handshake, the connection could be reused in the OCSP stapling callback, if configured, which subsequently leads to a segmentation fault.
2020-02-20Disabled duplicate "Host" headers (ticket #1724).Maxim Dounin1-2/+10
Duplicate "Host" headers were allowed in nginx 0.7.0 (revision b9de93d804ea) as a workaround for some broken Motorola phones which used to generate requests with two "Host" headers[1]. It is believed that this workaround is no longer relevant. [1] http://mailman.nginx.org/pipermail/nginx-ru/2008-May/017845.html
2020-02-20Removed "Transfer-Encoding: identity" support.Maxim Dounin1-4/+1
The "identity" transfer coding has been removed in RFC 7230. It is believed that it is not used in real life, and at the same time it provides a potential attack vector.
2020-02-20Disabled multiple Transfer-Encoding headers.Maxim Dounin1-1/+1
We anyway do not support more than one transfer encoding, so accepting requests with multiple Transfer-Encoding headers doesn't make sense. Further, we do not handle multiple headers, and ignore anything but the first header. Reported by Filippo Valsorda.
2020-02-11Made ngx_http_get_forwarded_addr_internal() non-recursive.Vladimir Homutov1-27/+25
2020-02-05HTTP/2: fixed socket leak with an incomplete HEADERS frame.Sergey Kandaurov1-2/+7
A connection could get stuck without timers if a client has partially sent the HEADERS frame such that it was split on the individual header boundary. In this case, it cannot be processed without the rest of the HEADERS frame. The fix is to call ngx_http_v2_state_headers_save() in this case. Normally, it would be called from the ngx_http_v2_state_header_block() handler on the next iteration, when there is not enough data to continue processing. This isn't the case if recv_buffer became empty and there's no more data to read.
2020-02-05Version bump.Sergey Kandaurov1-2/+2
2020-01-17gRPC: variables support in the "grpc_pass" directive.Vladimir Homutov1-38/+190
2020-01-14HTTP/2: removed ngx_debug_point() call.Daniil Bondarev1-4/+0
     With the recent change to prevent frames flood in d4448892a294, nginx will finalize the connection with NGX_HTTP_V2_INTERNAL_ERROR whenever flood is detected, causing nginx aborting or stopping if the debug_points directive is used in nginx config.
2019-12-27SSL: reworked posted next events again.Maxim Dounin4-14/+16
Previous change 1ce3f01a4355 incorrectly introduced processing of the ngx_posted_next_events queue at the end of operation, effectively making posted next events a nop, since at the end of an event loop iteration the queue is always empty. Correct approach is to move events to the ngx_posted_events queue at an iteration start, as it was done previously. Further, in some cases the c->read event might be already in the ngx_posted_events queue, and calling ngx_post_event() with the ngx_posted_next_events queue won't do anything. To make sure the event will be correctly placed into the ngx_posted_next_events queue we now check if it is already posted.
2019-12-27Version bump.Maxim Dounin1-2/+2