summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2020-03-19Fixed specifiers in "quic packet length" logging.Sergey Kandaurov1-2/+2
2020-03-19Fixed build.Sergey Kandaurov1-8/+13
2020-03-19The ngx_quic_frame_len() function is not really needed.Vladimir Homutov3-29/+1
2020-03-19Added boundaries checks into frame parser.Vladimir Homutov3-177/+448
The ngx_quic_parse_frame() functions now has new 'pkt' argument: the packet header of a currently processed frame. This allows to log errors/debug closer to reasons and perform additional checks regarding possible frame types. The handler only performs processing of good frames. A number of functions like read_uint32(), parse_int[_multi] probably should be implemented as a macro, but currently it is better to have them as functions for simpler debugging.
2020-03-19Send a FIN frame when QUIC stream is closed.Roman Arutyunyan1-0/+64
2020-03-19Fixed header creation for header_only responses in HTTP/3.Roman Arutyunyan2-24/+31
2020-03-18MAX_DATA frame parser/handler.Sergey Kandaurov3-0/+21
2020-03-19Added parsing of STREAMS BLOCKED frames.Vladimir Homutov3-1/+27
While there, added hex prefix for debug to avoid frame type confusion.
2020-03-18Implemented send_alert callback, CONNECTION_CLOSE writer.Sergey Kandaurov2-0/+50
The callback produces a CONNECTION_CLOSE frame, as per quic-tls-24#section-4.9.
2020-03-18Added copying addr_text to QUIC stream connections.Roman Arutyunyan1-0/+1
Now $remote_addr holds client address.
2020-03-18HTTP/3 $request_line variable.Roman Arutyunyan2-540/+37
2020-03-18Moved setting QUIC methods to runtime.Roman Arutyunyan5-45/+6
This allows listening to both https and http3 in the same server. Also, the change eliminates the ssl_quic directive.
2020-03-18Added parsing of RESET_STREAM and STOP_SENDING framesVladimir Homutov3-0/+43
2020-03-18Fixed pointer increment while parsing HTTP/3 header.Roman Arutyunyan1-3/+2
2020-03-18Implemented creation of server unidirectional streams.Vladimir Homutov1-59/+108
The ngx_quic_create_stream() function is a generic function extracted from the ngx_quic_handle_stream_frame() function.
2020-03-18Fixed HTTP/3 server stream creation.Roman Arutyunyan1-5/+5
2020-03-18Removed comment.Roman Arutyunyan1-1/+0
2020-03-18Refactored HTTP/3 parser.Roman Arutyunyan10-695/+1875
2020-03-18Style and handlers.Vladimir Homutov1-773/+812
Cleanup in ngx_event_quic.c: + reorderded functions, structures + added missing prototypes + added separate handlers for each frame type + numerous indentation/comments/TODO fixes + removed non-implemented qc->state and corresponding enum; this requires deep thinking, stub was unused. + streams inside quic connection are now in own structure
2020-03-18Extracted transport part of the code into separate file.Vladimir Homutov8-747/+813
All code dealing with serializing/deserializing is moved int srv/event/ngx_event_quic_transport.c/h file. All macros for dealing with data are internal to source file. The header file exposes frame types and error codes. The exported functions are currently packet header parsers and writers and frames parser/writer. The ngx_quic_header_t structure is updated with 'log' member. This avoids passing extra argument to parsing functions that need to report errors.
2020-03-17Firefox fixes.Vladimir Homutov2-8/+62
+ support for more than one initial packet + workaround for trailing zeroes in packet + ignore application data packet if no keys yet (issue in draft 27/ff nightly) + fixed PING frame parser + STREAM frames need to be acknowledged The following HTTP configuration is used for firefox (v74): http { ssl_certificate_key localhost.key; ssl_certificate localhost.crt; ssl_protocols TLSv1.2 TLSv1.3; server { listen 127.0.0.1:10368 reuseport http3; ssl_quic on; server_name localhost; location / { return 200 "This-is-QUICK\n"; } } server { listen 127.0.0.1:5555 ssl; # point the browser here server_name localhost; location / { add_header Alt-Svc 'h3-24=":10368";ma=100'; return 200 "ALT-SVC"; } } }
2020-03-16Fixed a typo with OpenSSL.Vladimir Homutov1-1/+1
2020-03-16Split transport and crypto parts into separate files.Vladimir Homutov6-1220/+1207
New files: src/event/ngx_event_quic_protection.h src/event/ngx_event_quic_protection.c The protection.h header provides interface to the crypto part of the QUIC: 2 functions to initialize corresponding secrets: ngx_quic_set_initial_secret() ngx_quic_set_encryption_secret() and 2 functions to deal with packet processing: ngx_quic_encrypt() ngx_quic_decrypt() Also, structures representing secrets are defined there. All functions require SSL connection and a pool, only crypto operations inside, no access to nginx connections or events. Currently pool->log is used for the logging (instead of original c->log).
2020-03-16Added processing of CONNECTION CLOSE frames.Vladimir Homutov1-5/+71
Contents is parsed and debug is output. No actions are taken.
2020-03-14Temporary fix for header null-termination in HTTP/3.Roman Arutyunyan2-2/+14
2020-03-14Fixed header protection application with pn length > 1.Sergey Kandaurov1-1/+4
2020-03-13Fixed sanitizer errors.Roman Arutyunyan2-10/+11
2020-03-13Added check for initialized c->ssl before calling SSL shutdown.Vladimir Homutov1-1/+3
2020-03-13HTTP/3.Roman Arutyunyan18-62/+3006
2020-03-13Fixed infinite loop in ngx_quic_stream_send_chain().Roman Arutyunyan1-3/+1
2020-03-13Implemented tracking offset in STREAM frames.Roman Arutyunyan1-2/+4
2020-03-13Implemented ngx_quic_stream_send_chain() method.Roman Arutyunyan1-1/+35
- just call send in a loop
2020-03-13Stream "connection" read/write methods.Vladimir Homutov2-9/+256
2020-03-13Auth basic: explicitly zero out password buffer.Ruslan Ermilov1-19/+18
2020-03-16Version bump.Ruslan Ermilov1-2/+2
2020-03-12Fix build.Sergey Kandaurov1-1/+2
2020-03-12Removed hardcoded CRYPTO and ACK frame sizes.Vladimir Homutov1-2/+18
2020-03-12HTTP/QUIC interface reworked.Vladimir Homutov5-96/+293
- events handling moved into src/event/ngx_event_quic.c - http invokes once ngx_quic_run() and passes stream callback (diff to original http_request.c is now minimal) - streams are stored in rbtree using ID as a key - when a new stream is registered, appropriate callback is called - ngx_quic_stream_t type represents STREAM and stored in c->qs
2020-03-11Initial parsing of STREAM frames.Vladimir Homutov1-1/+68
2020-03-12Added support of multiple QUIC packets in single datagram.Vladimir Homutov1-99/+170
- now NEW_CONNECTION_ID frames can be received and parsed The packet structure is created in ngx_quic_input() and passed to all handlers (initial, handshake and application data). The UDP datagram buffer is saved as pkt->raw; The QUIC packet is stored as pkt->data and pkt->len (instead of pkt->buf) (pkt->len is adjusted after parsing headers to actual length) The pkt->pos is removed, pkt->raw->pos is used instead.
2020-03-11Added more transport parameters.Vladimir Homutov1-3/+10
Needed for client to start sending streams.
2020-03-11Compatibility with BoringSSL revised QUIC encryption secret APIs.Sergey Kandaurov1-0/+147
See for details: https://boringssl.googlesource.com/boringssl/+/1e85905%5E!/
2020-03-10Chacha20 header protection support with BoringSSL.Sergey Kandaurov2-1/+15
BoringSSL lacks EVP for Chacha20. Here we use CRYPTO_chacha_20() instead.
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