]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
5 months agoFix SSL_read error handling in http3 demo server
Neil Horman [Sat, 14 Dec 2024 14:06:11 +0000 (09:06 -0500)] 
Fix SSL_read error handling in http3 demo server

The SSL_read error handling misses the ZERO_RETURN clause which is
non-fatal, correct that.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26180)

5 months agoCorrect copying of the url value
Neil Horman [Fri, 13 Dec 2024 13:54:49 +0000 (08:54 -0500)] 
Correct copying of the url value

When setting up the url value we copy data from memory regions that
overlap, it leads to bogus output, correct that.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26180)

5 months agoPreserve fileprefix accross reuse in http3 demo server
Neil Horman [Fri, 13 Dec 2024 00:02:54 +0000 (19:02 -0500)] 
Preserve fileprefix accross reuse in http3 demo server

The fileprefix that we serve content from needs to be preserved accross
h3ssl reuse.  Make sure we restore it after zeroing the struct.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26180)

5 months agoAdd http3 test to the interop container
Neil Horman [Wed, 4 Dec 2024 20:27:00 +0000 (15:27 -0500)] 
Add http3 test to the interop container

Set fileprefix for interop container on http3 server test

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26180)

5 months agoEncrypt the address validation token
Andrew Dinh [Thu, 12 Dec 2024 15:28:52 +0000 (09:28 -0600)] 
Encrypt the address validation token

Store an EVP_CIPHER_CTX context with an ephemeral key set in port
and use it to encrypt/decrypt the validation token.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26165)

5 months agoremoving debug code from quic_impl
Neil Horman [Mon, 16 Dec 2024 17:08:08 +0000 (12:08 -0500)] 
removing debug code from quic_impl

I had experimented with starting the ssl handshake during accept, and
forgot to remove it

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agoFix typo
Neil Horman [Mon, 16 Dec 2024 14:11:05 +0000 (09:11 -0500)] 
Fix typo

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agoaugment CI to run ampilficationlimit tests
Neil Horman [Thu, 12 Dec 2024 14:43:27 +0000 (09:43 -0500)] 
augment CI to run ampilficationlimit tests

NOTE: Do this for the server test as well after rebase when http3
commits get merged

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agomodify docker endpoint to not do address validation on transfer test
Neil Horman [Thu, 12 Dec 2024 14:40:29 +0000 (09:40 -0500)] 
modify docker endpoint to not do address validation on transfer test

quic interop uses the transfer test as part of the amplificationlimit
test, and as such we can't do address validation with retry frames
there, as the test requires it

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agoAdd tracking of receive credit for unvalidated connections
Neil Horman [Mon, 9 Dec 2024 15:21:54 +0000 (10:21 -0500)] 
Add tracking of receive credit for unvalidated connections

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agoAdd unvalidated credit tracking to packetizer
Neil Horman [Mon, 9 Dec 2024 13:58:28 +0000 (08:58 -0500)] 
Add unvalidated credit tracking to packetizer

Add data to track how much unvalidated credit we are sending and
receiving until such time as we are validated.  Validated conditions
are:

1) A retry token is sent, received, and validated
2) a handshake is completed on the connection

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26178)

5 months agoAdd a warning that disabling server validation is not recommended
Neil Horman [Fri, 6 Dec 2024 16:28:02 +0000 (11:28 -0500)] 
Add a warning that disabling server validation is not recommended

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoClarify that this validation only relates to retry packets
Neil Horman [Wed, 4 Dec 2024 21:12:02 +0000 (16:12 -0500)] 
Clarify that this validation only relates to retry packets

Disabling server address validation here only relates to new connections
that arrive without a token.  Future connections using tokens provided
by the server via NEW_TOKEN frames will still be validated

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoDisable server address validation on interop handshake test
Neil Horman [Wed, 4 Dec 2024 14:33:30 +0000 (09:33 -0500)] 
Disable server address validation on interop handshake test

The handshake test in the interop suite requires that no server address
validation be preformed, so disable it for this test

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoAdd a public flag to disable address validation on listeners
Neil Horman [Wed, 4 Dec 2024 14:25:12 +0000 (09:25 -0500)] 
Add a public flag to disable address validation on listeners

Now that we have the infrastructure to skip address validation, add a
public flag to SSL_new_listener and SSL_new_listener_from to allow the
skipping of address validation on selected quic listener SSL objects

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoAdd quic port flag to turn off address validation
Neil Horman [Tue, 3 Dec 2024 21:52:55 +0000 (16:52 -0500)] 
Add quic port flag to turn off address validation

Give us the infrastrucute to skip addr validation on the server

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoEnhance port binding to allow connections without odcid
Neil Horman [Tue, 3 Dec 2024 21:44:28 +0000 (16:44 -0500)] 
Enhance port binding to allow connections without odcid

If we opt not to do server address validation, we have no odcid
and therefore never reserved a local cid

We need to follow the initial code path to generate one

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26114)

5 months agoSSL_free() does check for != NULL (thanks Sashan)
Jean-Frederic Clere [Tue, 10 Dec 2024 09:08:11 +0000 (10:08 +0100)] 
SSL_free() does check for != NULL (thanks Sashan)

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoFixes according Sashan review.
Jean-Frederic Clere [Mon, 9 Dec 2024 14:50:02 +0000 (15:50 +0100)] 
Fixes according Sashan review.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoport the 2 improvement suggested by @nhorman to help to run the
Jean-Frederic Clere [Mon, 9 Dec 2024 13:32:28 +0000 (14:32 +0100)] 
port the 2 improvement suggested by @nhorman to help to run the
quic-interop-runner.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoArrange the code following the reviews.
Jean-Frederic Clere [Thu, 5 Dec 2024 14:48:25 +0000 (15:48 +0100)] 
Arrange the code following the reviews.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoFix small things from the review.
Jean-Frederic Clere [Wed, 4 Dec 2024 09:12:15 +0000 (10:12 +0100)] 
Fix small things from the review.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoAdd <sys/socket.h> for OpenBSD.
Jean-Frederic Clere [Tue, 3 Dec 2024 15:43:59 +0000 (16:43 +0100)] 
Add <sys/socket.h> for OpenBSD.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agotypo in comment.
Jean-Frederic Clere [Tue, 3 Dec 2024 15:35:50 +0000 (16:35 +0100)] 
typo in comment.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoArrange the remove_id() logic to be able to remove multiple stream.
Jean-Frederic Clere [Tue, 3 Dec 2024 15:18:03 +0000 (16:18 +0100)] 
Arrange the  remove_id() logic to be able to remove multiple stream.
create a new h3conn in read_from_ssl_ids() when we have a new
connection.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoArrange macox errors.
Jean-Frederic Clere [Wed, 6 Nov 2024 09:59:57 +0000 (10:59 +0100)] 
Arrange macox errors.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agomake check style happy.
Jean-Frederic Clere [Mon, 4 Nov 2024 14:34:37 +0000 (15:34 +0100)] 
make check style happy.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoArrange the logic:
Jean-Frederic Clere [Mon, 4 Nov 2024 10:17:35 +0000 (11:17 +0100)] 
Arrange the logic:
SSL_poll() without SSL_POLL_FLAG_NO_HANDLE_EVENT ticks for each stream
we have in SSL_poll() that prevents the server logic to get all events
Use SSL_poll() with SSL_POLL_FLAG_NO_HANDLE_EVENT and
SSL_handle_events() prevents the problem.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoread_from_ssl_ids() before wait_for_activity if something was received
Jean-Frederic Clere [Wed, 30 Oct 2024 17:06:07 +0000 (18:06 +0100)] 
read_from_ssl_ids() before wait_for_activity if something was received
before and the first time we are in the loop.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoArrange poll logic and get it working with chrome.
Jean-Frederic Clere [Mon, 28 Oct 2024 17:29:36 +0000 (18:29 +0100)] 
Arrange poll logic and get it working with chrome.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoAllow to send some files to test with browsers.
Jean-Frederic Clere [Mon, 28 Oct 2024 09:37:31 +0000 (10:37 +0100)] 
Allow to send some files to test with browsers.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoUse something like wait_for_activity() from demos/quic-server-non-block.c
Jean-Frederic Clere [Fri, 25 Oct 2024 14:23:35 +0000 (16:23 +0200)] 
Use something like wait_for_activity() from demos/quic-server-non-block.c

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25859)

5 months agoAugment RETRY validation token
Andrew Dinh [Wed, 27 Nov 2024 20:35:16 +0000 (12:35 -0800)] 
Augment RETRY validation token

Adds fields to the QUIC RETRY packet validation token:
timestamp, remote_addr, odcid, & rscid.

Also adds functionality to validate the token once returned by the client.

Note that this does not encrypt the token yet.

Also check that the RSCID stored in the RETRY validation
token matches the DCID in the header.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26048)

5 months agoDetermine which packet to drop for retry
Neil Horman [Thu, 28 Nov 2024 12:50:22 +0000 (07:50 -0500)] 
Determine which packet to drop for retry

When doing a retry after a version negotiation, we actually need to drop
packet 1 rather than 0 to get a retransmit of the initial packet

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26000)

5 months agoFix length check for datagram size in quic
Neil Horman [Thu, 28 Nov 2024 12:42:56 +0000 (07:42 -0500)] 
Fix length check for datagram size in quic

RFC says we should only accept datagrams of at least 1200 bytes, so the
check should discard anything under that, not over that

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26000)

5 months agoAugment quic interop harness to support server side interop tests
Neil Horman [Mon, 11 Nov 2024 22:12:19 +0000 (17:12 -0500)] 
Augment quic interop harness to support server side interop tests

the quic-interop-runner that we use for interop testing currently only
supports openssl client testing, as we had previously not had a server
to test with.

This PR rectifies that by doing the following:
1) Adding a quic-hq-interop-server.c file in demos/guide
2) Augmenting our interop Dockerfile and entrypoint to support our
   interop containter running in a server role

With these changes we are able to do server side interop testing

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26000)

5 months agoAdd documentation for BIO_dgram_set0_local_addr()
Matt Caswell [Tue, 26 Nov 2024 12:46:00 +0000 (12:46 +0000)] 
Add documentation for BIO_dgram_set0_local_addr()

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26066)

5 months agoAdd the ablity to set a local address for BIO_dgram_pair
Matt Caswell [Tue, 26 Nov 2024 12:36:52 +0000 (12:36 +0000)] 
Add the ablity to set a local address for BIO_dgram_pair

BIOs created from a BIO_dgram_pair don't normally have a local BIO_ADDR
associated with them. This allows us to set one.

Fixes openssl/project#933

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26066)

5 months agoMake version negotiation packets use network byte order
Neil Horman [Thu, 21 Nov 2024 14:18:53 +0000 (09:18 -0500)] 
Make version negotiation packets use network byte order

@t8m pointed out that versino negotiation packets weren't guaranteeing
network byte ordering in the array of supported versions.

Convert the client to use network byte order on send and receipt.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoFixup tests to properly check version negotiation
Neil Horman [Fri, 15 Nov 2024 19:32:56 +0000 (14:32 -0500)] 
Fixup tests to properly check version negotiation

Currently the quic_multistream_test tests version negotiation..sort of.

It uses a packet injector to force the tserver to send a version
negotiation packet back to the client.  Thats no longer needed as the
server will respond to an invalid version properly.

So alter script_74 to, instead of using the injector, use a quic channel
mutator to invalidate the version provided in the initial packet.  Then
we attempt to connect.  If the server responds with a version
negotiation packet and the client restarts with the proper version, then
the test passes, as the connection is extablished.

Also, while we're in here, update the gen_version_neg function to
properly insert a 0 version into the packet header for script_75, as
version negotiation packets require that to be set, otherwise script_75
will fail now when the server notices this discrepancy.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoHandle the receipt of version negotiation packets
Neil Horman [Fri, 15 Nov 2024 19:31:36 +0000 (14:31 -0500)] 
Handle the receipt of version negotiation packets

On the client side, when we get a version negotiation packet, we need to
interrogate the supported version list from the server, and either:
1) drop the connection if we don't see a version we can work with

2) select a supported version and try the negotiation again

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoAdd port version negotiation response from server
Neil Horman [Fri, 15 Nov 2024 19:09:16 +0000 (14:09 -0500)] 
Add port version negotiation response from server

If the server receives an Initial packet with a version number we don't
support (currently a fixed check for QUIC_VERSION_1), instead of
dropping it, respond with a version negotiation packet to the peer

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoAllow packetizer to accept an arg to set protocol version
Neil Horman [Fri, 15 Nov 2024 18:55:05 +0000 (13:55 -0500)] 
Allow packetizer to accept an arg to set protocol version

In preparation for doing version negotiation, expose the ability to have
the packetiser for QUIC set a configured protocol version.  We only set
it to QUIC_VERSION_1 for now, but it allows for us to set different
protocols in the future.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoAugment ossl_quic_wire_decode_pkt_hdr
Neil Horman [Fri, 15 Nov 2024 18:34:37 +0000 (13:34 -0500)] 
Augment ossl_quic_wire_decode_pkt_hdr

In preparation for supporting the handling of version negotiation, we
need to be able to detect why the decoding of quic header failed.
Specifically, ossl_quic_wire_decode_pkt_hdr fails if the version
provided in the header isn't QUIC_VERSION_1.  We want to keep that, as
we don't support anything else, but the server code needs to
differentiate when we fail decode because of a version problem, vs some
other more fatal malforming issue.

So add a uint64_t *fail_cause pointer that gets filled out with a
failure cause.  We only use VERSION failures right now, but we can
expand this later if needed

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25968)

5 months agoSSL_inject_net_dgram() should return result of ossl_quic_demux_inject()
sashan [Thu, 10 Oct 2024 08:48:07 +0000 (10:48 +0200)] 
SSL_inject_net_dgram() should return result of ossl_quic_demux_inject()

This got introduced by #595288251bb (QUIC APL: Ensure APL
functions use correct prologue)

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25659)

5 months agoInclude RETRY_CID transport parameter when handling retried connection
Neil Horman [Thu, 7 Nov 2024 14:34:29 +0000 (09:34 -0500)] 
Include RETRY_CID transport parameter when handling retried connection

After sending a retry frame from a server, the subsequent server hello
record must include the RETRY_SCID transport parameter, as per RFC 9000:
https://datatracker.ietf.org/doc/html/rfc9000#section-7.3

Implement the encoding of said retry_source_connection_id transport
param, and fix up tests to address the impact of that change.  Test
changes amount to:
1) quicapitest needs to have its tparam test augmented such that it
   doesn't inject the retry_scid on its own, as the quic stack does it
   for the test now
2) quicapitest needs to have the ssl_trace test adjusted so the expected
   record values are reflected.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25890)

5 months agoSelect proper ORIG_DCID when sending server hello over quic
Neil Horman [Wed, 6 Nov 2024 13:47:04 +0000 (08:47 -0500)] 
Select proper ORIG_DCID when sending server hello over quic

When establishing a connection over quic, if the channel is established
in response to a retry request from the server, the ORIG_DCID transport
parameter must reflect the original dcid sent from the client in the
first inital packet that the server sent the retry request in response
to.

As opposed to establishing a connection without the retry request, when
address validation isn't in use, where the ORIG_DCID parameter just
represents the the dcid that the client sent.

Augment the channel creation code to select the 'right' DCID when
encoding server side transport parameters

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25890)

5 months agoGenerate initial packet keys based on new dcid for addr validation
Neil Horman [Tue, 5 Nov 2024 21:25:25 +0000 (16:25 -0500)] 
Generate initial packet keys based on new dcid for addr validation

When using retry packets in QUIC to implement address validation, the
2nd inital packet that arrives after the server sends the retry frame
will have its CRYPTO packet encrypted using keys derived from the new
dcid, rather than the dcid in the 1st initial packet.  Update the
channel creation code to update those keys on the server so that the
CRYPTO packet is decrypted successfully

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25890)

5 months agoImplement Server Address validation using retry packets
Saša Nedvědický [Tue, 5 Nov 2024 21:15:55 +0000 (16:15 -0500)] 
Implement Server Address validation using retry packets

RFC 9000 describes a method for preforming server address validation on
QUIC using retry packets.  Based on:
https://datatracker.ietf.org/doc/html/rfc9000#section-17.2.5.2

We do the following:
1) Client sends an Initial packet without a retry token
2) Server abandons the initial packet and responds with a retry frame
   which includes a retry token and integrity tag and new SCID
3) Client send the initial packet again, updating the encryption keys
   for the connection based on the SCID sent in (2), using it as the new
   DCID, including the retry token/tag provided in (2).
4) Server validates the token in (3) and creates a new connection using
   the updated DCID from the client to generate its encryption keys

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25890)

5 months agoUpdate QUIC related man7 pages for the added server functionality
Andrew Dinh [Thu, 31 Oct 2024 05:18:11 +0000 (22:18 -0700)] 
Update QUIC related man7 pages for the added server functionality

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25834)

5 months agoRemove extra FD_SET
Andrew Dinh [Thu, 17 Oct 2024 19:48:17 +0000 (12:48 -0700)] 
Remove extra FD_SET

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25532)

5 months agoAdd a guide for demo QUIC non-blocking server
Andrew Dinh [Mon, 16 Sep 2024 18:59:23 +0000 (02:59 +0800)] 
Add a guide for demo QUIC non-blocking server

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25532)

5 months agoSSL_poll(): Handle blocking with no poll items
Tomas Mraz [Mon, 14 Oct 2024 11:26:07 +0000 (13:26 +0200)] 
SSL_poll(): Handle blocking with no poll items

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agopoll_builder.c: Minor fixes and optimizations
Tomas Mraz [Thu, 10 Oct 2024 13:49:29 +0000 (15:49 +0200)] 
poll_builder.c: Minor fixes and optimizations

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoAdd quic_lock() calls for functions called from poll_translate_ssl_quic()
Tomas Mraz [Wed, 11 Sep 2024 14:02:50 +0000 (16:02 +0200)] 
Add quic_lock() calls for functions called from poll_translate_ssl_quic()

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoEnsure WSAStartup() before calling WSASocketA()
Tomas Mraz [Wed, 11 Sep 2024 09:45:10 +0000 (11:45 +0200)] 
Ensure WSAStartup() before calling WSASocketA()

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoossl_rio_notifier_init(): Add error messages
Tomas Mraz [Tue, 10 Sep 2024 17:11:56 +0000 (19:11 +0200)] 
ossl_rio_notifier_init(): Add error messages

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoSSL_poll(): Report result_count for failed events
Tomas Mraz [Tue, 10 Sep 2024 07:10:53 +0000 (09:10 +0200)] 
SSL_poll(): Report result_count for failed events

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC: Immediate-Mode Polling various fixups
Tomas Mraz [Tue, 10 Sep 2024 06:53:20 +0000 (08:53 +0200)] 
QUIC: Immediate-Mode Polling various fixups

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC: Update SSL_poll documentation
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC: Update SSL_poll documentation

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC: Glossary updates
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC: Glossary updates

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC RADIX: Use enhanced blocking support when testing
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC RADIX: Use enhanced blocking support when testing

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC RADIX: Test listener polling support
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC RADIX: Test listener polling support

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC RADIX: Test new SSL_poll functionality
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC RADIX: Test new SSL_poll functionality

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC MULTISTREAM TEST: Remove test that blocking SSL_poll doesn't work
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC MULTISTREAM TEST: Remove test that blocking SSL_poll doesn't work

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoRIO: Amend SSL_poll code to correctly register blocking operations for inter-thread...
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
RIO: Amend SSL_poll code to correctly register blocking operations for inter-thread notification

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC POLLING: Add support for polling listeners
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC POLLING: Add support for polling listeners

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoRIO: Amend SSL_poll to support blocking on QUIC objects
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
RIO: Amend SSL_poll to support blocking on QUIC objects

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoRIO: Add poll builder to support immediate-mode polling API
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
RIO: Add poll builder to support immediate-mode polling API

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC APL: Add support for registering blocking operations to support polling code
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC APL: Add support for registering blocking operations to support polling code

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC REACTOR: Add utility for tracking recursive blocking operations
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC REACTOR: Add utility for tracking recursive blocking operations

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoQUIC REACTOR: Add support for external registration of blocking operations
Hugo Landau [Mon, 13 May 2024 19:20:23 +0000 (20:20 +0100)] 
QUIC REACTOR: Add support for external registration of blocking operations

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

5 months agoAdd demo QUIC non-blocking server
Andrew Dinh [Wed, 11 Sep 2024 10:54:53 +0000 (17:54 +0700)] 
Add demo QUIC non-blocking server

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25431)

5 months agoUse the reactor from ctx.obj for net read/write desired implementations
Matt Caswell [Wed, 9 Oct 2024 10:31:46 +0000 (11:31 +0100)] 
Use the reactor from ctx.obj for net read/write desired implementations

The ossl_quic_get_net_write_desired() and
ossl_quic_reactor_net_read_desired() implementations can be used by
listeners. But in that case there is no ctx.qc object present. Instead we
should use the reactor from ctx.obj which will work also for a listener.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25642)

5 months agoAdd a test for early ticking
Matt Caswell [Thu, 12 Sep 2024 14:15:46 +0000 (15:15 +0100)] 
Add a test for early ticking

Ensure that we don't inadvertently start the connection if we call
SSL_handle_events(), or SSL_get_event_timeout() early.

This adds a test for #25054, which was originally fixed by #25069 to
ensure we haven't broken anything by the changes in the previous commit.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25452)

5 months agoAlways tick the QUIC_ENGINE regardless of the state of a connection
Matt Caswell [Thu, 12 Sep 2024 14:05:59 +0000 (15:05 +0100)] 
Always tick the QUIC_ENGINE regardless of the state of a connection

Just because one connection has not started yet, it does not mean that
we should not tick the QUIC_ENGINE. There may be other connections that do
need ticking.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25452)

5 months agoAdd a guide for demo QUIC blocking server
Andrew Dinh [Mon, 23 Sep 2024 06:25:24 +0000 (23:25 -0700)] 
Add a guide for demo QUIC blocking server

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25361)

5 months agoAdds a new demo blocking QUIC server for use with the existing demo QUIC clients
Andrew Dinh [Sun, 15 Sep 2024 19:26:47 +0000 (03:26 +0800)] 
Adds a new demo blocking QUIC server for use with the existing demo QUIC clients

Remove util/quicserver.c

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25465)

5 months agoRemove an obsolete comment
Matt Caswell [Fri, 13 Sep 2024 15:25:46 +0000 (16:25 +0100)] 
Remove an obsolete comment

The comment is no longer accurance so it can be removed

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25457)

5 months agoSimplify the QUIC time override handling
Matt Caswell [Fri, 13 Sep 2024 15:00:22 +0000 (16:00 +0100)] 
Simplify the QUIC time override handling

Centralise the storage of the override in the QUIC_ENGINE rather than in
the QUIC_CONNECTION. We can now set the override on any type of QUIC SSL
object as needed.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25457)

5 months agoHandle a couple of NULL QUIC ctx.qc values
Viktor Dukhovni [Wed, 11 Sep 2024 09:44:43 +0000 (19:44 +1000)] 
Handle a couple of NULL QUIC ctx.qc values

Now that we also QUIC server (listener) handles, we may have a NULL quic
connection (ctx.qc), and so need to either return early or handle the
NULL `qc` gracefully.

Reviewed-by: Sasa Nedvedicky <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25432)

5 months agoQUIC Concurrency API: Various minor fixes
Alexandr Nedvedicky [Fri, 19 Jul 2024 21:48:30 +0000 (23:48 +0200)] 
QUIC Concurrency API: Various minor fixes

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoMinor fix for Windows
Hugo Landau [Mon, 13 May 2024 18:22:10 +0000 (19:22 +0100)] 
Minor fix for Windows

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC RADIX: Test domain functions as well
Hugo Landau [Mon, 29 Apr 2024 11:36:21 +0000 (12:36 +0100)] 
QUIC RADIX: Test domain functions as well

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC: Add basic domain flags test
Hugo Landau [Mon, 29 Apr 2024 11:36:01 +0000 (12:36 +0100)] 
QUIC: Add basic domain flags test

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoAssorted bugfixes
Hugo Landau [Mon, 29 Apr 2024 11:35:39 +0000 (12:35 +0100)] 
Assorted bugfixes

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoDoc fixes
Hugo Landau [Mon, 29 Apr 2024 09:52:32 +0000 (10:52 +0100)] 
Doc fixes

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoAllow use of socketpair, WSASocketA
Hugo Landau [Mon, 29 Apr 2024 09:24:30 +0000 (10:24 +0100)] 
Allow use of socketpair, WSASocketA

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoMinor fixes
Hugo Landau [Mon, 29 Apr 2024 09:20:39 +0000 (10:20 +0100)] 
Minor fixes

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoRIO NOTIFIER: Fix symbol usage
Hugo Landau [Mon, 29 Apr 2024 09:13:56 +0000 (10:13 +0100)] 
RIO NOTIFIER: Fix symbol usage

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC OBJ: Require blocking support in the domain flags to use blocking mode
Hugo Landau [Wed, 24 Apr 2024 12:52:26 +0000 (13:52 +0100)] 
QUIC OBJ: Require blocking support in the domain flags to use blocking mode

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agomake update
Hugo Landau [Wed, 24 Apr 2024 09:04:25 +0000 (10:04 +0100)] 
make update

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC: Update listener documentation
Hugo Landau [Wed, 24 Apr 2024 12:22:49 +0000 (13:22 +0100)] 
QUIC: Update listener documentation

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC: Add documentation on concurrency model
Hugo Landau [Wed, 24 Apr 2024 12:20:44 +0000 (13:20 +0100)] 
QUIC: Add documentation on concurrency model

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC: Document SSL_new_domain, etc.
Hugo Landau [Wed, 24 Apr 2024 12:17:06 +0000 (13:17 +0100)] 
QUIC: Document SSL_new_domain, etc.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC APL: Refine domain flag handling
Hugo Landau [Wed, 24 Apr 2024 12:01:44 +0000 (13:01 +0100)] 
QUIC APL: Refine domain flag handling

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC CHANNEL: Notify other threads when needed
Hugo Landau [Wed, 24 Apr 2024 11:47:18 +0000 (12:47 +0100)] 
QUIC CHANNEL: Notify other threads when needed

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC REACTOR: Allow ticks to schedule notifications of other threads
Hugo Landau [Wed, 24 Apr 2024 11:46:34 +0000 (12:46 +0100)] 
QUIC REACTOR: Allow ticks to schedule notifications of other threads

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC ENGINE: Notify when ticking
Hugo Landau [Wed, 24 Apr 2024 11:26:40 +0000 (12:26 +0100)] 
QUIC ENGINE: Notify when ticking

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

5 months agoQUIC REACTOR: Inter-thread notification
Hugo Landau [Wed, 24 Apr 2024 11:24:22 +0000 (12:24 +0100)] 
QUIC REACTOR: Inter-thread notification

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)