Commit Graph

1454 Commits

Author SHA1 Message Date
Dirkjan Ochtman 00181a46be message: remove trivial wrapper method 2021-04-24 14:02:38 +02:00
Dirkjan Ochtman 6b71c368f9 message: remove trivial wrapper method 2021-04-24 14:02:38 +02:00
Dirkjan Ochtman 29d1ec1871 Simplify alert processing interface 2021-04-24 14:02:38 +02:00
Dirkjan Ochtman 7128cee05a message: remove take_app_data_payload() method 2021-04-24 14:02:38 +02:00
Dirkjan Ochtman 32e482b04c Eliminate unwrapping to access application data 2021-04-24 14:02:38 +02:00
Dirkjan Ochtman 5a70992401 message: remove Message::typ field
This redundantly includes the variant of the MessagePayload, so removing
it removes the ability for these values to get out of sync.
2021-04-24 14:02:36 +02:00
Dirkjan Ochtman 0345102ab9 message: rename MessagePayload::Opaque to ApplicationData 2021-04-24 14:02:06 +02:00
Dirkjan Ochtman e4e1946cbc message: simplify error path for payload decoding
It looks like the error I'd previously observed from bogo was unrelated,
so we can make the error handling much simpler and robust.
2021-04-24 14:02:06 +02:00
Dirkjan Ochtman 0ef030aa8f message: replace Codec impl for OpaqueMessage with encode() method 2021-04-24 14:01:59 +02:00
Dirkjan Ochtman 10d2784ccc message: replace into_opaque() with From impl 2021-04-24 14:00:58 +02:00
Dirkjan Ochtman 7fa6a60cde cipher: rename buf bindings to payload 2021-04-24 14:00:02 +02:00
Dirkjan Ochtman 6365408700 message: split OpaqueMessage state out as a separate type 2021-04-24 13:59:37 +02:00
Dirkjan Ochtman d317db143f message: merge impl blocks 2021-04-24 10:35:41 +02:00
Dirkjan Ochtman 6ce614adde msgs: inline single-use take_payload() method 2021-04-24 10:35:41 +02:00
Joseph Birr-Pixton f0b7bc5830 Merge branch 'jbp-quic-error-handling' into main 2021-04-24 09:28:10 +01:00
Joseph Birr-Pixton 91d86a9364 Tidy up conn -> cx renaming 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 36ce2ddf67 quic: adhere to naming conventions 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 89300ba9f6 quic: fix clippy warnings in QUIC-only code 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 87f9714eed quic: add tests to cover QUIC error scenarios 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 70dd0aa9df quic: return error on invalid configuration instead of asserting 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 51a2f541ab quic: make sure we don't select TLS 1.2 for QUIC sessions 2021-04-24 09:28:00 +01:00
Dirkjan Ochtman 5519aa16b6 quic: return an error when starting QUIC sessions without TLS 1.3 support 2021-04-24 09:08:53 +01:00
Dirkjan Ochtman ded1604ce4 quic: clarify meaning of Protocol variants 2021-04-24 09:08:53 +01:00
Dirkjan Ochtman 0cad12f29d quic: add documentation about use of QUIC transport parameters 2021-04-24 09:08:53 +01:00
Dirkjan Ochtman eb10703264 quic: return error if QUIC params are missing
From draft-ietf-quic-tls-32#section-8.2:

   The quic_transport_parameters extension is carried in the ClientHello
   and the EncryptedExtensions messages during the handshake.  Endpoints
   MUST send the quic_transport_parameters extension; endpoints that
   receive ClientHello or EncryptedExtensions messages without the
   quic_transport_parameters extension MUST close the connection with an
   error of type 0x16d (equivalent to a fatal TLS missing_extension
   alert, see Section 4.8).
2021-04-24 09:08:53 +01:00
Dirkjan Ochtman 8bcabd9759 Deduplicate State bounds 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 6495e9ca65 Apply clippy suggestion 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 4f3e5e698f Inline simple single-use methods 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 25226e5384 Deduplicate process_new_packets() methods 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 597d5623e9 Deduplicate process_new_handshake_messages() methods 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman e5cf42df5c Deduplicate process_main_protocol() methods 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman d60c011790 client: simplify client connection initialization 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman eeb1a8e217 client: kill duplicate function definition 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 735dce8c55 client: rename conn arguments to cx 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 65ddc42c46 client: introduce new ClientContext type
This mutably borrows all the required fields from the ClientConnection,
with the advantage that it doesn't have to borrow the state itself.
2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 806b4d5ff3 client: pass minimal arguments 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 0a59ad199f client: move connection data into separate type 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 65873d20f4 server: rename conn arguments to cx 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 13cc5109da server: introduce new ServerContext type
This mutably borrows all the required fields from the ServerConnection,
with the advantage that it doesn't have to borrow the state itself.
2021-04-24 09:01:54 +01:00
Dirkjan Ochtman c15537ef29 server: pass minimal arguments 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 7e9d96a23f server: move get_sni() into ServerConnectionData 2021-04-24 09:01:54 +01:00
Dirkjan Ochtman 7ab2d0f3da server: move connection data into separate type 2021-04-24 09:01:54 +01:00
Brian Smith b376831dce Eliminate one allocation and one copy in handshake message deframing. 2021-04-22 19:54:53 +02:00
Brian Smith 667b453824 Rename `Tls12CipherSuite::scs` to `Tls12CipherSuite::supported_cipher_suite`. 2021-04-22 07:04:02 +02:00
Brian Smith c9c76c6fc6 `fixed_iv_len` is a TLS-1.2-only parameter of a cipher suite. 2021-04-22 07:04:02 +02:00
Brian Smith ee17a3d69f Clarify that `kx` is only relevant for TLS 1.2 cipher suites. 2021-04-22 07:04:02 +02:00
Brian Smith f63a2730cc Clarify that `explicit_nonce_len` is only relevant for TLS 1.2. 2021-04-22 07:04:02 +02:00
Brian Smith 5d64af8fdb Hold optional TLS-1.2-only fields of `SupportedCipherSuite` to a single `Option`.
Refactor the cipher suite state for TLS 1.2 so that it is clear that the given
cipher suite is compatible with TLS 1.2 throughout the handshake.

Merge multiple `Option` fields of `SupportedCipherSuite` into a single `Option` that
is `Some` only for TLS 1.2 cipher suites.
2021-04-22 07:04:02 +02:00
Brian Smith d7f533fbc1 Remove redundant `hash` field of `SupportedCipherSuite`. 2021-04-22 07:04:02 +02:00
Brian Smith a691ec79cf Ticketer: Use non-panicking alternatives; eliminate redundant tag length check. 2021-04-20 09:28:50 +02:00