]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
5 months agoSLH-DSA cleanups
slontis [Wed, 22 Jan 2025 21:20:58 +0000 (08:20 +1100)] 
SLH-DSA cleanups

Addressed some review comments.
- Ref counting has been removed from SLH_DSA_KEY (EVP_PKEY is responsible
for the keys ref counting).
- Moved constants and prefetched objects into SLH_DSA_KEY.
- The SLH_DSA_HASH_CTX is still required since there are multiple
  contexts that need to propagate to a lot of functions, but it no
  longer contains the constants. Note that it also holds a pointer to
  the SLH_DSA_KEY.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH_DSA key validation.
slontis [Thu, 21 Nov 2024 05:09:18 +0000 (16:09 +1100)] 
Add SLH_DSA key validation.

The pairwise test requires that the computed PK_ROOT key matches the
keys PK_ROOT value. The public and private key tests just require the
key elements to exist.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA FIPS self tests
slontis [Thu, 21 Nov 2024 01:15:24 +0000 (12:15 +1100)] 
Add SLH-DSA FIPS self tests

This requires a keygen test, as well as Sign/Verify tests for at least 1
sha2 algorithm and 1 shake related algorithm.

A pairwise consistency test has also been added to the key generation.

Note that self test datat for the signature is currently stored as a
sha256 digest in order to reduce the memory footprint.
(Since the signature size for sha2/shake using 128s = ~8K, and for 128f = ~17K)

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA encoder/decoder support.
slontis [Tue, 19 Nov 2024 04:40:13 +0000 (15:40 +1100)] 
Add SLH-DSA encoder/decoder support.

This required adding additional EVP_PKEY_ASN1_METHOD methods.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAddress style check nits for SLH-DSA
slontis [Tue, 12 Nov 2024 23:59:10 +0000 (10:59 +1100)] 
Address style check nits for SLH-DSA

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoUpdate SLH-DSA code to use PACKET and WPACKET.
slontis [Tue, 12 Nov 2024 07:35:10 +0000 (18:35 +1100)] 
Update SLH-DSA code to use PACKET and WPACKET.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoUpdate SLH-DSAto use EVP_PKEY_sign_message_init() instead of using the
slontis [Sun, 10 Nov 2024 23:41:35 +0000 (10:41 +1100)] 
Update SLH-DSAto use EVP_PKEY_sign_message_init() instead of using the
prehashed variant.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA design document
slontis [Fri, 8 Nov 2024 06:23:18 +0000 (17:23 +1100)] 
Add SLH-DSA design document

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA documentation
slontis [Fri, 8 Nov 2024 05:16:59 +0000 (16:16 +1100)] 
Add SLH-DSA documentation

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoSLH-DSA clean ups
slontis [Fri, 8 Nov 2024 05:08:31 +0000 (16:08 +1100)] 
SLH-DSA clean ups

- Make slh_dsa_sign() return the siglen when sig is NULL.
- Remove the ability in fromdata to generate the public key root
  given the private key and public key seed. This was messy and can
  be done by key generation instead.
- Add common EVP_PKEY gettablesto SLH_DSA keys
  (OSSL_PKEY_PARAM_BITS, OSSL_PKEY_PARAM_SECURITY_BITS, and
   OSSL_PKEY_PARAM_MAX_SIZE).
- Update tests based on the above changes.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoZeorize some secret values in SLH_DSA
slontis [Thu, 7 Nov 2024 10:01:27 +0000 (21:01 +1100)] 
Zeorize some secret values in SLH_DSA

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdded return code checks to SLH_DSA Hash functions and propogated the
slontis [Thu, 7 Nov 2024 08:01:16 +0000 (19:01 +1100)] 
Added return code checks to SLH_DSA Hash functions and propogated the
values thru the calling functions.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH_DSA to the FIPS provider.
slontis [Thu, 7 Nov 2024 06:43:19 +0000 (17:43 +1100)] 
Add SLH_DSA to the FIPS provider.

The keygen tests required "entropy" to be added via an additional
parameter for ACVP testing. This is required because TEST_RAND cant be
used to pass entropy to the FIPS provider, due to it not knowing the
lib ctx of the FIPS provider.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd support for all 12 SLH-DSA parameter sets.
slontis [Thu, 7 Nov 2024 03:59:45 +0000 (14:59 +1100)] 
Add support for all 12 SLH-DSA parameter sets.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA signing.
slontis [Thu, 7 Nov 2024 00:24:06 +0000 (11:24 +1100)] 
Add SLH-DSA signing.

Also updated function comments.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA key generation
slontis [Wed, 6 Nov 2024 10:45:29 +0000 (21:45 +1100)] 
Add SLH-DSA key generation

Also made fromdata able to generate the public root key if the private
key seed + prf as well as the public key seed are passed to from data.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH_DSA signature verification.
slontis [Wed, 6 Nov 2024 06:37:08 +0000 (17:37 +1100)] 
Add SLH_DSA signature verification.

This uses a SLH_DSA_CTX that is passed to most functions.
It contains information related to a parameter set (such as constants,
hash functions, prefetched EVP_MD/EVP_MAC objects, as well as ADDRESS
functions). This context is seperated from the SLH_DSA_KEY since
multiple signature operations could be performed using the same keys.
This only implements functions required for SLH-DSA-SHA2-128s

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months ago Add base code to load a SLH_DSA public key.
slontis [Wed, 6 Nov 2024 03:22:45 +0000 (14:22 +1100)] 
 Add base code to load a SLH_DSA public key.

This loads a SLH_DSA public key from data.
A simple SLH_DSA keymanager imports this key.

Initially this only has a parameter set for
SLH-DSA-SHA2-128s

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH_DSA configuration option
slontis [Tue, 5 Nov 2024 04:18:41 +0000 (15:18 +1100)] 
Add SLH_DSA configuration option

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoCase-insensitive sigalgs
Viktor Dukhovni [Sat, 15 Feb 2025 15:25:16 +0000 (02:25 +1100)] 
Case-insensitive sigalgs

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26767)

5 months agofips: omit PCT on key import
Pauli [Mon, 10 Feb 2025 22:32:28 +0000 (09:32 +1100)] 
fips: omit PCT on key import

Our lab thinks the IG 10.3.A additional comment 1 is a mistake and that
a PCT on import is not required.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26785)

5 months agoFixup error ennumeration 26802/head
Neil Horman [Fri, 14 Feb 2025 21:40:45 +0000 (16:40 -0500)] 
Fixup error ennumeration

The merge gives us a conflict on SSL_R_MISSING_QUIC_TLS_FUNCTIONS
which conflicted with SSL_R_LISTENER_USE_ONLY.  Move the former to
ordinal 423

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26762)

5 months agoFix ssltrace test
Neil Horman [Fri, 14 Feb 2025 19:42:58 +0000 (14:42 -0500)] 
Fix ssltrace test

It seems something changed during the merge leading to a slightly longer
frame

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26762)

5 months agoAdd ssl_unwrap.h to quic_tls_api.c
Neil Horman [Fri, 14 Feb 2025 19:25:41 +0000 (14:25 -0500)] 
Add ssl_unwrap.h to quic_tls_api.c

Needed after the macro re-arranging performed on the quic-server branch

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26762)

5 months agoReadd the inclusion of quic_record_util.h to quic_tls.c
Neil Horman [Fri, 14 Feb 2025 19:21:31 +0000 (14:21 -0500)] 
Readd the inclusion of quic_record_util.h to quic_tls.c

Some refactoring on master removed the inclusion of quic_local.h from
ssl_local.h, which quic_tls.c needed on the server branch to pull in the
QRL_SUITE_AES128GCM and simmilar definitions.  Fix it by specifcially
adding quic_record_util.h into quic_tls.c, as we only need a few defines
from that header.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26762)

5 months agoFixup conflict between 3rd party quic-tls api and quic-server
Neil Horman [Fri, 14 Feb 2025 20:58:58 +0000 (15:58 -0500)] 
Fixup conflict between 3rd party quic-tls api and quic-server

Build.info changes between quic-server and master occured here, resolve
them.  Can't do it as a fixup as the conficting changes have already
been merged to master

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26762)

5 months agoBackout validation of initial packet done by port_default_packet_handler()
Alexandr Nedvedicky [Thu, 13 Feb 2025 21:55:10 +0000 (22:55 +0100)] 
Backout validation of initial packet done by port_default_packet_handler()

QUIC interoperability tests discovered bugs in my earlier commit #59e7c2313be7cff.
This change reverts everything out.

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

5 months agoPerform initial AEAD validation before creating a channel
Alexandr Nedvedicky [Sun, 2 Feb 2025 16:40:25 +0000 (17:40 +0100)] 
Perform initial AEAD validation before creating a channel

We let port to create qrx object and use it for
packet validation. If packet validates, we then
create channel and pass pre-created qrx to channel's
constructor.

Co-authored-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26610)

5 months agoAdd quic-server fuzz test. Also update fuzz corpora submodule.
Andrew Dinh [Wed, 22 Jan 2025 13:45:00 +0000 (20:45 +0700)] 
Add quic-server fuzz test. Also update fuzz corpora submodule.

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

5 months agoFix ossl_quic_trace to fetch connection short conn id len
Neil Horman [Wed, 29 Jan 2025 19:10:09 +0000 (14:10 -0500)] 
Fix ossl_quic_trace to fetch connection short conn id len

ossl_quic_trace currently fails to get the connection id when parsing a
short header.  now that we have an api to get the known length, go ahead
and use that to parse the header properly

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

5 months agoUse the recorded short conn id len in pktsplitbio
Neil Horman [Wed, 29 Jan 2025 18:19:49 +0000 (13:19 -0500)] 
Use the recorded short conn id len in pktsplitbio

Do the same thing in our pktsplit bio

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

5 months agoUse reported short conn id len in qtestlib
Neil Horman [Wed, 29 Jan 2025 18:18:57 +0000 (13:18 -0500)] 
Use reported short conn id len in qtestlib

Use the new short conn id internal api to record and use the connections
short conn id len when decoding packets in qtestlib

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

5 months agoAdd api to fetch short conn id len from a given channel/tserver
Neil Horman [Wed, 29 Jan 2025 18:17:32 +0000 (13:17 -0500)] 
Add api to fetch short conn id len from a given channel/tserver

Need an api to fetch the configured conn id len for short headers, add
that in here

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

5 months agoMove handling of connection close frames to QUIC FUTURE
Neil Horman [Wed, 29 Jan 2025 19:44:13 +0000 (14:44 -0500)] 
Move handling of connection close frames to QUIC FUTURE

There is a corner case in handling connection close frames for which RFC
guidance is unclear.  Given that, move addressing it to QUIC FUTURE

Fixes openssl/project#1075

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

5 months agoEliminate SSL_LISTENER_FLAG_NO_ACCEPT flag in QUIC
Neil Horman [Wed, 29 Jan 2025 19:38:45 +0000 (14:38 -0500)] 
Eliminate SSL_LISTENER_FLAG_NO_ACCEPT flag in QUIC

We've not implemented it yet, and don't need it for MVP, so move the
TODO's to QUIC FUTURE and remove the docs for it.

Fixes openssl/project#1074

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

5 months agoMove EAGAIN handling of QUIC retry/verneg frames to QUIC FUTURE
Neil Horman [Wed, 29 Jan 2025 19:31:25 +0000 (14:31 -0500)] 
Move EAGAIN handling of QUIC retry/verneg frames to QUIC FUTURE

Fixes openssl/project#1072
Fixes openssl/project#1073

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

5 months agoMove implementation of RETIRE CONN ID frames to QUIC FUTURE
Neil Horman [Wed, 29 Jan 2025 19:28:49 +0000 (14:28 -0500)] 
Move implementation of RETIRE CONN ID frames to QUIC FUTURE

Fixes openssl/project#1071

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

5 months agoMove quictestlib TODO to QUIC FUTURE
Neil Horman [Wed, 29 Jan 2025 19:19:35 +0000 (14:19 -0500)] 
Move quictestlib TODO to QUIC FUTURE

Improving handling of packets in tserver doesn't currently make sense,
as we're planning on eliminating it soon.  Move this TODO to QUIC FUTURE

Fixes openssl/project#1070

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

5 months agomove token store definition to quic_predef.h
Neil Horman [Sun, 2 Feb 2025 22:17:20 +0000 (17:17 -0500)] 
move token store definition to quic_predef.h

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

5 months agode-duplicate fnv1a_hash
Neil Horman [Sat, 1 Feb 2025 16:42:22 +0000 (11:42 -0500)] 
de-duplicate fnv1a_hash

I cloned a copy of fnv1a_hash from hashtable.c.  Deduplicate that so we
have common source code.

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

5 months agoRemove NEW_TOKEN public api
Neil Horman [Sat, 1 Feb 2025 16:28:25 +0000 (11:28 -0500)] 
Remove NEW_TOKEN public api

@sashan and I were discussing the usefulness of the public facing api
for NEW_TOKEN support, and he has concerns over its usefulness and our
being stuck with it if we need to make changes later.  Given that it is
a convience api for using multiple CTX-es to share a cache, its fine if
we remove it for now, as that seems like a less common use case.

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

5 months agoinit token to ease cleanup
Neil Horman [Fri, 31 Jan 2025 14:41:36 +0000 (09:41 -0500)] 
init token to ease cleanup

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

5 months agoRemove SSL_TOKEN_STORE_HANDLE type
Neil Horman [Fri, 31 Jan 2025 13:02:34 +0000 (08:02 -0500)] 
Remove SSL_TOKEN_STORE_HANDLE type

Replace it with SSL_TOKEN_STORE and make the structure opaque in the
public api

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

5 months agoModify ossl_quic_get_peer_token to return QUIC_TOKEN
Neil Horman [Thu, 30 Jan 2025 19:38:18 +0000 (14:38 -0500)] 
Modify ossl_quic_get_peer_token to return QUIC_TOKEN

we use this struct internally to track computed tokens, we may as well
use it when fetching those tokens, as it allows the removeal of the QTOK
type

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

5 months agoRename token_store functions to make them consistent
Neil Horman [Thu, 30 Jan 2025 17:14:26 +0000 (12:14 -0500)] 
Rename token_store functions to make them consistent

we use get0 to get a token store, but set to set it.  Since the latter
takes a refcount, change that to set1.  Also rename the interal quic
functions to match.

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

5 months agoReview fixups
Neil Horman [Tue, 28 Jan 2025 14:41:52 +0000 (09:41 -0500)] 
Review 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/26517)

5 months agoFix a memory leak on free
Neil Horman [Tue, 28 Jan 2025 14:16:09 +0000 (09:16 -0500)] 
Fix a memory leak on free

Forgot to free the CRYPTO_REF when freeing a token

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

5 months agoReduce our NEW_TOKEN send rate.
Neil Horman [Tue, 28 Jan 2025 13:58:19 +0000 (08:58 -0500)] 
Reduce our NEW_TOKEN send rate.

Currently, we send a NEW_TOKEN frame on every new validated connection,
but thats not necessecary.  Since NEW_TOKEN tokens have a lifetime of 1
hour currently, we really only need to send a NEW_TOKEN if:
1) We validated a RETRY token
or
2) We validated a NEW_TOKEN for which the lifetime is nearing its limit

So lets do that.  When we validate a token, only generate a NEW_TOKEN if
the current token is a RETRY token, or if its a NEW_TOKEN, and there is
less than 10% of the tokens lifetime remaining.

This lets clients use NEW_TOKENS repeatedly (as per the RFC), and saves
us some network bandwith.

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

5 months agoDon't reserve an unused cid for NEW_TOKENS
Neil Horman [Mon, 27 Jan 2025 21:32:32 +0000 (16:32 -0500)] 
Don't reserve an unused cid for NEW_TOKENS

Just realized that NEW_TOKEN tokens don't need a reserved rscid.

Because a client might use a received NEW_TOKEN for multiple subsequent
connections, we allocate a cid when we validate the token on new
connection establishment (in fact we just use the one that the client
sends).  As such the allocated rscid never gets used, and just sits
there until it ages out.

Instead, fill the rscid with random data to mutate subsequently
generated NEW_TOKENS's, since it won't ever be part of the validation
process anyway.

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

5 months agoReference count QUIC_TOKENS
Neil Horman [Mon, 27 Jan 2025 18:56:40 +0000 (13:56 -0500)] 
Reference count QUIC_TOKENS

closer reading of RFC 9000 indicates that a NEW_TOKEN token can be
(re)used repeatedly.

so instead of creating a use once and discard pattern in the token api.
Let the tokens stick around until they are replaced with a new token
from the server.  To do this, we need to ref count the tokens so that we
don't accidentally free them while a given client is waiting to send an
initial frame making use of them.

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

5 months agoCentralize freeing of tokens
Neil Horman [Mon, 27 Jan 2025 18:04:08 +0000 (13:04 -0500)] 
Centralize freeing of tokens

This will make it easier to refcount them in a moment

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

5 months agoSchedule new token frame after handshake complete
Neil Horman [Sat, 25 Jan 2025 00:51:01 +0000 (19:51 -0500)] 
Schedule new token frame after handshake complete

We don't want to schedule the NEW_TOKEN frame until such time as the
handshake is complete, otherwise we risk giving a token to validate a
future connection to a peer we haven't decided to trust yet

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

5 months agoAdd test to confirm new token functionality
Neil Horman [Tue, 21 Jan 2025 16:48:51 +0000 (11:48 -0500)] 
Add test to confirm new token functionality

Basically just create two clients and two servers, ensuring that both
clients use the same ctx (to share the token cache).

Connect the first client and server so that the cache gets populated
with a new token, tracing the ssl connection

Connect the second client and server, again tracing the connection with
the same bio

Then sift through the trace, looking for the new token frame in the
first connection, matching it with the token used in the second
connection.

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

5 months agoAdd lookup for initial token assignment on channel start
Neil Horman [Thu, 16 Jan 2025 20:34:33 +0000 (15:34 -0500)] 
Add lookup for initial token assignment on channel start

Start assiging initial tokens, and validating them on receipt

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

5 months agoEnhance get_peer_token to not require memcpy
Neil Horman [Thu, 16 Jan 2025 18:12:15 +0000 (13:12 -0500)] 
Enhance get_peer_token to not require memcpy

Instead of copying the token thats store, return a pointer to it
along with a pointer to the token struct to free should we need to

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

5 months agoAdd allocation of token cache on server contexts when needed
Neil Horman [Thu, 16 Jan 2025 13:27:48 +0000 (08:27 -0500)] 
Add allocation of token cache on server contexts when needed

the SSL_new_from_listener api creates a client SSL from a server
SSL_CTX context.  Normally server contexts need no token cache, but once
we start using it as a client, that changes.  Allocate one here when
needed

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

5 months agoAugment client side recieve code to store NEW_TOKENS
Neil Horman [Wed, 15 Jan 2025 21:21:09 +0000 (16:21 -0500)] 
Augment client side recieve code to store NEW_TOKENS

Start storing new tokens in our new cache

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

5 months agoextend internal api to allow for add/lookup token ops
Neil Horman [Wed, 15 Jan 2025 20:16:24 +0000 (15:16 -0500)] 
extend internal api to allow for add/lookup token ops

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

5 months agoAdd docs for token store manipulation
Neil Horman [Wed, 15 Jan 2025 17:01:31 +0000 (12:01 -0500)] 
Add docs for token store manipulation

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

5 months agoAdd public api to create token cache for QUIC NEW_TOKENS
Neil Horman [Wed, 15 Jan 2025 16:40:49 +0000 (11:40 -0500)] 
Add public api to create token cache for QUIC NEW_TOKENS

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

5 months agoAdd new token generation transmission
Neil Horman [Sun, 12 Jan 2025 03:16:16 +0000 (22:16 -0500)] 
Add new token generation transmission

When we bind a channel, create a NEW_TOKEN token to be sent on the next
available datagram, once the channel is validated

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

5 months agoClean up a few further TODO(QUIC SERVER)
Tomas Mraz [Thu, 23 Jan 2025 16:42:56 +0000 (17:42 +0100)] 
Clean up a few further TODO(QUIC SERVER)

These are either already implemented or not relevant for
the QUIC server MVP.

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

5 months agoAdd build.info for QUIC server demo
Tomas Mraz [Thu, 23 Jan 2025 16:28:43 +0000 (17:28 +0100)] 
Add build.info for QUIC server demo

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

5 months agoWe are not handling AEAD at port level for now
Tomas Mraz [Thu, 23 Jan 2025 16:21:21 +0000 (17:21 +0100)] 
We are not handling AEAD at port level for now

-> TODO(QUIC FUTURE)

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

5 months agoossl_quic_tserver_shutdown(): Remove TODO(QUIC SERVER)
Tomas Mraz [Thu, 23 Jan 2025 16:14:46 +0000 (17:14 +0100)] 
ossl_quic_tserver_shutdown(): Remove TODO(QUIC SERVER)

tserver code is not related to QUIC SERVER

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

5 months agoupdate Dockerfile to pull hq-interop code from new location
Neil Horman [Thu, 23 Jan 2025 19:14:33 +0000 (14:14 -0500)] 
update Dockerfile to pull hq-interop code from new location

Change the dockerfile to use enable-hqinterop and copy binaries from
their new location

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

5 months agoAdd hq-interop configure option
Neil Horman [Thu, 23 Jan 2025 19:10:15 +0000 (14:10 -0500)] 
Add hq-interop configure option

Allow the building of the hq-interop client and server when we are
building our interop container

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

5 months agoMove hq-interop code to test/quic-openssl-docker
Neil Horman [Thu, 23 Jan 2025 19:02:55 +0000 (14:02 -0500)] 
Move hq-interop code to test/quic-openssl-docker

Its the only place we use this code, so put the code in that directory

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

5 months agoDisable server address validation for resumption test
Neil Horman [Thu, 23 Jan 2025 18:55:13 +0000 (13:55 -0500)] 
Disable server address validation for resumption test

The quic-interop runner expects a handshake message and certificate
exchange in the first 3 frames in this test.  The addition of server
address validation retry frames causes the test to fail.  Strictly
speaking this is a shortcoming of the test, but disabling address
validation allows the test to pass, and we have the mechanism, so
disable the feature.

Fixes openssl/project#1061

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

5 months agoUpdate doc/man3/SSL_new_stream.pod
Neil Horman [Thu, 23 Jan 2025 15:26:44 +0000 (10:26 -0500)] 
Update doc/man3/SSL_new_stream.pod

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

5 months agoquic-hq-interop: Allow for retries if we've reached our max stream limit
Neil Horman [Wed, 22 Jan 2025 18:19:52 +0000 (13:19 -0500)] 
quic-hq-interop: Allow for retries if we've reached our max stream limit

Several servers defer the sending of max stream frames.  For instance
quic-go uses a go-routine to do the sending after sufficient existing
streams have finished, while mvfst seems to wait for all outstanding
streams to be closed before issuing a new batch.  This result in the
client, if all streams are in use, getting a transient NULL return from
SSL_new_stream().  Check for the stream limit being reached and allow a
number of retries before giving up to give the server a chance to issue
us more streams.  Also dead-reckon the batch count of streams we use in
parallel to be 1/4 of our total number of available streams (generally
hard coded to 100 for most servers) to avoid using all our streams at
once.  It would be really nice to have an api to expose our negotiated
transport parameters so that the application can know what this limit
is, but until then we have to just guess.

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

5 months agoFix up some nits
Neil Horman [Wed, 22 Jan 2025 19:29:19 +0000 (14:29 -0500)] 
Fix up some nits

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoremove check of pending in ossl_quic_free
Neil Horman [Wed, 22 Jan 2025 15:25:47 +0000 (10:25 -0500)] 
remove check of pending in ossl_quic_free

Not strictly needed

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoRemove vestigual accepted flag
Neil Horman [Wed, 22 Jan 2025 15:10:30 +0000 (10:10 -0500)] 
Remove vestigual accepted flag

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoFix more typos
Neil Horman [Wed, 22 Jan 2025 13:37:15 +0000 (08:37 -0500)] 
Fix more typos

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoFix some typos
Neil Horman [Wed, 22 Jan 2025 12:38:51 +0000 (07:38 -0500)] 
Fix some typos

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoupdate docs with reference to SSL_set_ex_data
Neil Horman [Mon, 20 Jan 2025 22:03:42 +0000 (17:03 -0500)] 
update docs with reference to SSL_set_ex_data

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAttempt to use NULL listeners to avoid use after free
Neil Horman [Tue, 21 Jan 2025 21:55:15 +0000 (16:55 -0500)] 
Attempt to use NULL listeners to avoid use after free

As per @sashan suggestion, try pre-creating user ssls with a NULL
listener

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoUpdate man page to note limitations of callbacks for QUIC
Neil Horman [Fri, 17 Jan 2025 18:36:26 +0000 (13:36 -0500)] 
Update man page to note limitations of callbacks for QUIC

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoFix memory leak in pre-allocated listeners
Neil Horman [Tue, 14 Jan 2025 22:52:20 +0000 (17:52 -0500)] 
Fix memory leak in pre-allocated listeners

We have a chicken and egg problem.

Normally when we create a connection object in quic, we associate it
with a listener, and up the ref on the parent listener, which is fine.

However, now that we are pre-allocating user_ssl objects for incomming
connections we have a situation in which:
1) The pre-alocated connection object holds a ref on the listener
2) The application has no awareness of the quic connection object (and
   so can't free it)
3) The freeing of the listener object never calls into the quic stack,
   because its reference count may hold references from connections that
   haven't been accepted yet

We could require that applications register a function for the
new_pending_conn callback, and track/free these pending connections, but
that seems like alot of extra unneeded work to place on the application

Instead:
a) add a quic_conn_st flag named accepted
b) When pre-allocating connections, clear the flag in (a) and _dont_
   hold a reference to the parent listener
c) in SSL_accept_connection, set the accepted flag and reference the
listener
d) in ossl_quic_free drop the listener reference only if the accepted
flag is set
c) expressly free all user_ssl objects in ossl_quic_port_drop_incoming

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAdd changes.md entry noting the limitations of recursive SSL calls
Neil Horman [Mon, 13 Jan 2025 17:06:49 +0000 (12:06 -0500)] 
Add changes.md entry noting the limitations of recursive SSL calls

QUIC can't currently make recursive SSL calls, as it potentially results
in deadlock

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agorename new_pending_ssl to new_pending_conn
Neil Horman [Fri, 10 Jan 2025 17:20:40 +0000 (12:20 -0500)] 
rename new_pending_ssl to new_pending_conn

Make it clear its only announcing connections, not streams

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoRun Make update
Neil Horman [Thu, 9 Jan 2025 14:25:22 +0000 (09:25 -0500)] 
Run Make update

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAdd docs for new callback registration
Neil Horman [Thu, 9 Jan 2025 13:27:58 +0000 (08:27 -0500)] 
Add docs for new callback registration

Add docs for SSL_CTX_set_new_pending_ssl_cb

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAdd a test to validate our new SSL_accept connection objects
Neil Horman [Wed, 8 Jan 2025 23:31:55 +0000 (18:31 -0500)] 
Add a test to validate our new SSL_accept connection objects

Quick test to validate that:

a) our new pending SSL accept callback works
and
b) That our callback passed SSL objects match those that are returned
by SSL_accept_connection

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAdd a callback to announce newly created ssl waiting acceptance
Neil Horman [Wed, 8 Jan 2025 19:59:58 +0000 (14:59 -0500)] 
Add a callback to announce newly created ssl waiting acceptance

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoReturn channel tls from ossl_quic_accept_connection
Neil Horman [Wed, 8 Jan 2025 19:12:28 +0000 (14:12 -0500)] 
Return channel tls from ossl_quic_accept_connection

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agouse internal callback to generate user ssl
Neil Horman [Wed, 8 Jan 2025 19:08:36 +0000 (14:08 -0500)] 
use internal callback to generate user ssl

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoAdd callback to get user ssl on channel creation
Neil Horman [Wed, 8 Jan 2025 18:23:55 +0000 (13:23 -0500)] 
Add callback to get user ssl on channel creation

Reviewed-by: Matt Caswell <matt@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/26361)

5 months agoIf server receives NEW_TOKEN frame, respond with PROTOCOL_VIOLATION
Andrew Dinh [Wed, 15 Jan 2025 15:12:31 +0000 (23:12 +0800)] 
If server receives NEW_TOKEN frame, respond with PROTOCOL_VIOLATION

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

5 months agoFix MARSHALLED_TOKEN_MAX_LEN
Andrew Dinh [Thu, 2 Jan 2025 03:46:06 +0000 (19:46 -0800)] 
Fix MARSHALLED_TOKEN_MAX_LEN

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

5 months agoQUIC FUTURE: Add concurrency architecture design document
Hugo Landau [Wed, 24 Apr 2024 12:38:27 +0000 (13:38 +0100)] 
QUIC FUTURE: Add concurrency architecture design document

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/26025)

5 months agoFix sizing on variable in ossl-nghttp3-demo-server
Neil Horman [Thu, 9 Jan 2025 17:12:09 +0000 (12:12 -0500)] 
Fix sizing on variable in ossl-nghttp3-demo-server

On working on a rebase for the quic-server branch, I noted that the
rebase was failing on the http3 server.  It occurs because the new CI
ubuntu container appears to have FORTIFY_SOURCE enabled and trips over
the call to read here.  Specifically the compiler notes that in passing
an int into the read syscall (which accepts a size_t as the 3rd
argument), may interpret a negative value as a very large unsigned value
that exeeds the size allowed by a read call.

Fix it by converting the size variable to a size_t to ensure that the
signing is correct

Reviewed-by: Matt Caswell <matt@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/26368)

5 months agoImplement SSL_new_from_listener()
Alexandr Nedvedicky [Mon, 9 Dec 2024 09:49:05 +0000 (10:49 +0100)] 
Implement SSL_new_from_listener()

SSL_new_from_listner() creates QUIC connection object (QCSO)
from listener. Caller can use the object retuned from
SSL_new_from_listener() to connect to remote QUIC server.
The QCSO created here shares engine/port with listener.

the change is covered by `test_ssl_new_from_listener()` in
test/quicapitest.c

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

5 months agoMake quic interop tests pass with the demo server
Jean-Frederic Clere [Mon, 16 Dec 2024 09:28:55 +0000 (10:28 +0100)] 
Make quic interop tests pass with the demo server

Included are also multiple style fixes.

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

5 months agoIPv6 support for quic interop
Andrew Dinh [Mon, 16 Dec 2024 17:23:59 +0000 (12:23 -0500)] 
IPv6 support for quic interop

Modify the QUIC HQ interop server/client to support both IPv4 and IPv6.

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

5 months agoDisable address validation for throughput test
Neil Horman [Tue, 17 Dec 2024 15:54:47 +0000 (10:54 -0500)] 
Disable address validation for throughput test

The multiplexing test using quiche as a client seems to get confused
when server address validation is enabled.  specifically it writes the
wrong keys into its keylog file, causing the test to fail when tshark
can't decode the tls connection that is established.  Fix it by
disabling address validation for the multiplexing/transfer test

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

5 months agoDo read retries in quic hq-interop server
Neil Horman [Sun, 15 Dec 2024 20:26:41 +0000 (15:26 -0500)] 
Do read retries in quic hq-interop server

Normally the throughput test in the interop harness requests several
hundred very small files, resulting in lots of small stream packets from
the client, which are nominally read in a single read operation (as they
typically fit into a single stream frame), and the server was written to
expect that.  However, its still possible, if a stream frame is packed
to the end of a datagram, that only part of its content is carried,
finished in a subsequent stream packet, which leads to a short read.

Augment the server to properly handle SSL_read transient failures so
that such an occurance is handled properly.

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

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)