Commit Graph

5001 Commits

Author SHA1 Message Date
Pauli
d15d5ea6a6 quic conformance: add comment about section 10.2.3 conformance
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:45 +10:00
Pauli
d11b901b0b trivial code nit
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:45 +10:00
Pauli
50e76846bf quic conformance: 10.2.1 rate limiting
Implement the two requirements about limiting closing transmission size to
no more than thrice the received size.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:45 +10:00
Pauli
afe4a7978d quic conformance: section 10.2.2 requirements
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Pauli
6b3b5f9d28 quic conformance: section 10.2.1 requirements
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Pauli
24ae2d79d5 quic: use the safe fused multiply divide instead of a safe multiply then a normal division
This should extend the range of possible results.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Pauli
a441d08b1b Add note about RFC 9000 10.2 persist time
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Pauli
b056e9fcf5 document RRFC9000 10.1 MUST requirement
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Pauli
73ef6e6f0f Note RFC 9000 19.19 requirement
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)
2023-08-04 11:55:34 +10:00
Frederik Wedel-Heinen
5ac7ee4d5a Resolves some magic values that has a hello_retry_request enum type.
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21636)
2023-08-04 11:40:37 +10:00
Matt Caswell
f219abef51 Ensure the QUIC TLS SSL object is marked as shutdown
If we shutdown the QUIC connection then we should mark the underlying
TLS SSL object as shutdown as well. Otherwise any sessions are considered
unusable for resumption.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21591)
2023-08-02 20:27:07 +01:00
Matt Caswell
829eec9f86 Add the ability for tserver to use a pre-existing SSL_CTX
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21591)
2023-08-02 20:27:07 +01:00
Matt Caswell
f85d343208 Keep doing ossl_quic_tls_tick() even after handshake completion
There may be post-handshake messages to process so make sure we keep
ticking things even if the handshake has finished. We do this simply by
calling SSL_read(). There should never be app data to read but we will
process any handshake records we encounter.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21591)
2023-08-02 20:26:54 +01:00
Matt Caswell
c31f06120f Ensure SSL_has_pending() always works even before a connection
s_client calls SSL_has_pending() even before the connection has been
established. We expect it to return 0 in this case and not put any errors
on the stack.

We change things so that SSL_has_pending() always returns 0 if there is
no stream available.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21578)
2023-08-02 15:07:07 +01:00
Matt Caswell
33f6ad1724 Still advance handshake even on an empty write
A call to SSL_write() with a zero length buffer should still advance the
handshake. Applications (including s_client) may rely on this.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21578)
2023-08-02 15:07:07 +01:00
Hugo Landau
63fac76c24 QUIC: Automatically drain non-concluded streams, bugfixes
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:42 +01:00
Hugo Landau
6d6b3a032d QUIC APL: Mask API operations when in shutdown flush
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:42 +01:00
Hugo Landau
8a2e9abac8 QUIC APL: Shutdown Stream Flush Functionality
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
553122cd7c QUIC TXP: Fix bug relating to STREAM FIN generation
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
cae02d2b0a QUIC APL: Ensure tick inhibition is not used during blocking
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
5904a0a71f QUIC TSERVER: Allow reading from a stream after connection termination
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
b864110a82 QUIC QSM: Infrastructure for tracking shutdown flush eligible streams
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
3415677eec QUIC APL: Add internal call to allow changing send buffer size
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Hugo Landau
03b3859501 QUIC CHANNEL: Allow ticking to be inhibited for testing purposes
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)
2023-07-31 14:03:25 +01:00
Frederik Wedel-Heinen
fbd23b9296 Removes unused parameter 'sending' from derive_secret_key_and_iv()
Fixes #21569

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21569)
2023-07-28 12:03:58 +01:00
John Kohl
7f14656e1c fix compile error (SIZE_MAX not found) on HP-UX
Fixes #21554

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21562)
2023-07-28 10:50:39 +10:00
Marco Abbadini
6cac1ce471 fix clang-6,7,8 strict build
CLA: trivial

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21501)
2023-07-24 09:22:55 +10:00
Tom Cosgrove
9c8d04dbec Fix build when configured with -DOPENSSL_USE_IPV6=0
Change-Id: I57723835b0a7d20609d8c4ed2988123f975a927d

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21495)
2023-07-21 15:19:13 +01:00
Hugo Landau
1e2e683aa2 QUIC TXP: Generate forced PINGs correctly
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21458)
2023-07-21 08:43:52 +02:00
Hugo Landau
c206f2aa62 QUIC TXP: Refactor TXP-related deadline handling into TXP
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21458)
2023-07-21 08:43:52 +02:00
Hugo Landau
faebafda9f QUIC TXP: Major refactor to handle padding correctly
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21458)
2023-07-21 08:43:52 +02:00
Hugo Landau
41d39984e9 QUIC QTX: Add ciphertext size calculation function
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21458)
2023-07-21 08:43:52 +02:00
Hugo Landau
178c104de6 QUIC TXP: Handle non-inflight-eligible packets correctly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
427a02ad0a QUIC ACKM: Don't record non-inflight packets in CC
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
d56b564b25 QUIC TXP: Do not generate full-size packets when sending CC-excess probes
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
76908b4582 QUIC ACKM: RFC 9000 s. 13.2.1: max_ack_delay taken as 0 in INITIAL/HANDSHAKE
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
f13868def2 QUIC CHANNEL: Initialise max_ack_delay values properly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
fd6c1476a0 QUIC ACKM: Clean up max_ack_delay tracking and separate TX and RX values
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Hugo Landau
79a80f8b58 QUIC STATM: Move max_ack_delay tracking out of STATM
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)
2023-07-19 13:03:11 +10:00
Tomas Mraz
2b8126d8a8 Raise SSL_R_QUIC_PROTOCOL_ERROR on any QUIC protocol error
QUIC error code, frame type and reason is in error data

Fixes #21337

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21476)
2023-07-18 20:37:52 +02:00
Matt Caswell
404fb9965e Fix ssl3_do_write() to correctly handle retries
A BIO is documented to return -1 on write retry - but sometimes they return
0. ssl3_do_write() was incorrectly handling a 0 response.

Fixes #21422

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21434)
2023-07-17 09:39:46 +10:00
atishkov
33ef5fc2c2 Remove unreachable code from SSL_use_certificate_file() as in SSL_CTX_use_certificate_file()
CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21394)
2023-07-17 08:52:30 +10:00
Hugo Landau
f36504cc39 Minor fixups
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
9ff3a99ea6 QUIC: Fix multistream test on macOS
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
1d547f8fc4 Minor updates 2
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
96b7df60b3 Minor updates
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
bac3f4da55 make update
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
5ed3a435d5 QUIC QSM: Get rid of recv_fin_retired in favour of recv_state
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:18:05 +10:00
Hugo Landau
b3695154b5 QUIC QSM: Update API documentation
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:17:58 +10:00
Hugo Landau
08d4b7eb7d QUIC CONFORMANCE/APL: Handle FIN/reset retirement correctly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
2023-07-17 08:17:58 +10:00