openssl.git
16 months agoQUIC QTX: Handle network errors explicitly
Hugo Landau [Mon, 9 Jan 2023 15:44:42 +0000 (15:44 +0000)]
QUIC QTX: Handle network errors explicitly

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

16 months agoQUIC DEMUX: Handle network errors explicitly
Hugo Landau [Mon, 9 Jan 2023 15:43:52 +0000 (15:43 +0000)]
QUIC DEMUX: Handle network errors explicitly

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

16 months agoQUIC: Document how blocking mode is automatically turned off
Hugo Landau [Mon, 9 Jan 2023 11:31:07 +0000 (11:31 +0000)]
QUIC: Document how blocking mode is automatically turned off

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

16 months agoQUIC BIO Poll Descriptors: simplify custom interface
Hugo Landau [Mon, 9 Jan 2023 11:20:08 +0000 (11:20 +0000)]
QUIC BIO Poll Descriptors: simplify custom interface

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

16 months agoQUIC CSM: Tweak docs for tick functions, add DTLSv1 docs
Hugo Landau [Mon, 9 Jan 2023 11:18:06 +0000 (11:18 +0000)]
QUIC CSM: Tweak docs for tick functions, add DTLSv1 docs

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

16 months agoQUIC CSM: Minor style fixes
Hugo Landau [Mon, 9 Jan 2023 11:17:42 +0000 (11:17 +0000)]
QUIC CSM: Minor style fixes

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

16 months agoQUIC Front End I/O API: Remove __owur from man pages
Hugo Landau [Fri, 6 Jan 2023 11:50:55 +0000 (11:50 +0000)]
QUIC Front End I/O API: Remove __owur from man pages

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

16 months agoQUIC: Minor cleanup
Hugo Landau [Wed, 4 Jan 2023 07:24:08 +0000 (07:24 +0000)]
QUIC: Minor cleanup

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

16 months agoQUIC TXP: Fix bug in send stream handling, cleanup
Hugo Landau [Fri, 16 Dec 2022 13:26:33 +0000 (13:26 +0000)]
QUIC TXP: Fix bug in send stream handling, cleanup

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

16 months agoQUIC: Add TODO for CCM support
Hugo Landau [Thu, 15 Dec 2022 11:29:38 +0000 (11:29 +0000)]
QUIC: Add TODO for CCM support

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

16 months agoQUIC Front-End I/O API: Determine read completion correctly
Hugo Landau [Thu, 15 Dec 2022 07:07:49 +0000 (07:07 +0000)]
QUIC Front-End I/O API: Determine read completion correctly

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

16 months agoQUIC: Use ossl_assert
Hugo Landau [Thu, 15 Dec 2022 07:07:35 +0000 (07:07 +0000)]
QUIC: Use ossl_assert

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

16 months agoQUIC RXDP: Different error messages for stream conditions
Hugo Landau [Thu, 15 Dec 2022 07:07:12 +0000 (07:07 +0000)]
QUIC RXDP: Different error messages for stream conditions

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

16 months agoQUIC: Minor comment and editorial fixes
Hugo Landau [Thu, 15 Dec 2022 07:06:55 +0000 (07:06 +0000)]
QUIC: Minor comment and editorial fixes

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

16 months agoQUIC Front End I/O API: Minor doc fixes
Hugo Landau [Thu, 15 Dec 2022 07:05:21 +0000 (07:05 +0000)]
QUIC Front End I/O API: Minor doc fixes

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

16 months agoQUIC Front End I/O API: Don't allow EPW to be enabled during AON
Hugo Landau [Thu, 15 Dec 2022 06:42:43 +0000 (06:42 +0000)]
QUIC Front End I/O API: Don't allow EPW to be enabled during AON

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

16 months agoQUIC: Back out version string change
Hugo Landau [Tue, 13 Dec 2022 12:34:36 +0000 (12:34 +0000)]
QUIC: Back out version string change

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

16 months agoQUIC: Documentation updates
Hugo Landau [Wed, 30 Nov 2022 08:04:34 +0000 (08:04 +0000)]
QUIC: Documentation updates

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

16 months agoQUIC Front End I/O API: Tweaks to handshake processing
Hugo Landau [Wed, 30 Nov 2022 08:04:00 +0000 (08:04 +0000)]
QUIC Front End I/O API: Tweaks to handshake processing

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

16 months agoQUIC Front End I/O API: Remove unnecessary code from SSL_get_tick_timeout
Hugo Landau [Wed, 30 Nov 2022 08:02:50 +0000 (08:02 +0000)]
QUIC Front End I/O API: Remove unnecessary code from SSL_get_tick_timeout

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

16 months agoQUIC CHANNEL: Minor cleanups and bug fix
Hugo Landau [Wed, 30 Nov 2022 08:01:58 +0000 (08:01 +0000)]
QUIC CHANNEL: Minor cleanups and bug fix

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

16 months agoQUIC: Style fixes
Hugo Landau [Wed, 30 Nov 2022 08:01:39 +0000 (08:01 +0000)]
QUIC: Style fixes

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

16 months agoQUIC Front End I/O API: Wire up SSL_CTX ctrls and remove unneeded functions
Hugo Landau [Wed, 30 Nov 2022 08:00:19 +0000 (08:00 +0000)]
QUIC Front End I/O API: Wire up SSL_CTX ctrls and remove unneeded functions

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

16 months agoQUIC CHANNEL: Revise inaccurate comments
Hugo Landau [Wed, 30 Nov 2022 07:57:55 +0000 (07:57 +0000)]
QUIC CHANNEL: Revise inaccurate comments

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

16 months agoQUIC: Revise and add some TODO lines
Hugo Landau [Wed, 30 Nov 2022 07:57:36 +0000 (07:57 +0000)]
QUIC: Revise and add some TODO lines

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

16 months agoQUIC Front End I/O API: Correct implementation of SSL_tick, SSL_get_tick_timeout
Hugo Landau [Wed, 30 Nov 2022 07:55:48 +0000 (07:55 +0000)]
QUIC Front End I/O API: Correct implementation of SSL_tick, SSL_get_tick_timeout

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

16 months agoQUIC Front End I/O API: Change version string
Hugo Landau [Wed, 30 Nov 2022 07:54:39 +0000 (07:54 +0000)]
QUIC Front End I/O API: Change version string

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

16 months agoSeparate handling of RX and TX enc level
Matt Caswell [Mon, 21 Nov 2022 11:00:34 +0000 (11:00 +0000)]
Separate handling of RX and TX enc level

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)

16 months agoQUIC CHANNEL: Only pump the demuxer once per tick
Hugo Landau [Tue, 22 Nov 2022 17:56:18 +0000 (17:56 +0000)]
QUIC CHANNEL: Only pump the demuxer once per tick

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

16 months agoQUIC CHANNEL: Only reprocess after an RX secret has been provisioned
Hugo Landau [Tue, 22 Nov 2022 13:46:05 +0000 (13:46 +0000)]
QUIC CHANNEL: Only reprocess after an RX secret has been provisioned

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

16 months agoQUIC TXP: Correct an issue with an uninitialized variable
Hugo Landau [Mon, 21 Nov 2022 09:55:30 +0000 (09:55 +0000)]
QUIC TXP: Correct an issue with an uninitialized variable

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

16 months agoQUIC Front-End I/O API: Ensure BIOs are reffed and freed correctly
Hugo Landau [Mon, 21 Nov 2022 07:55:37 +0000 (07:55 +0000)]
QUIC Front-End I/O API: Ensure BIOs are reffed and freed correctly

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

16 months agoQUIC_CHANNEL: Handle deferred packet processing after yielding of secrets correctly
Hugo Landau [Fri, 18 Nov 2022 17:25:25 +0000 (17:25 +0000)]
QUIC_CHANNEL: Handle deferred packet processing after yielding of secrets correctly

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

16 months agoQUIC DEMUX: Allow MTU to vary over time and autodetect MTU
Hugo Landau [Fri, 18 Nov 2022 17:20:20 +0000 (17:20 +0000)]
QUIC DEMUX: Allow MTU to vary over time and autodetect MTU

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

16 months agoQUIC: Enable building with QUIC support disabled
Hugo Landau [Thu, 17 Nov 2022 16:03:00 +0000 (16:03 +0000)]
QUIC: Enable building with QUIC support disabled

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

16 months agoQUIC: make update
Hugo Landau [Thu, 17 Nov 2022 15:47:17 +0000 (15:47 +0000)]
QUIC: make update

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

16 months agoQUIC: Temporarily disable front-end API tests
Hugo Landau [Thu, 17 Nov 2022 15:45:11 +0000 (15:45 +0000)]
QUIC: Temporarily disable front-end API tests

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

16 months agoQUIC: Remove RX depacketiser tests from QRL test suite
Hugo Landau [Thu, 17 Nov 2022 15:39:18 +0000 (15:39 +0000)]
QUIC: Remove RX depacketiser tests from QRL test suite

These create significant coupling between the QRL tests and the RXDP.
Moreover, the RXDP has no state of its own and is implemented as part of
the QUIC_CHANNEL, ergo it doesn't make that much sense to test it in
isolation.

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

16 months agoQUIC Front-End I/O API: Wire up the SSL API functions
Hugo Landau [Thu, 17 Nov 2022 15:35:17 +0000 (15:35 +0000)]
QUIC Front-End I/O API: Wire up the SSL API functions

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

16 months agoQUIC Front-End I/O API
Hugo Landau [Thu, 17 Nov 2022 15:33:11 +0000 (15:33 +0000)]
QUIC Front-End I/O API

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

16 months agointernal/sockets.h: Add support for testing EINTR portably
Hugo Landau [Thu, 17 Nov 2022 15:30:57 +0000 (15:30 +0000)]
internal/sockets.h: Add support for testing EINTR portably

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

16 months agoQUIC: Add miscellaneous QUIC constants
Hugo Landau [Thu, 17 Nov 2022 15:30:22 +0000 (15:30 +0000)]
QUIC: Add miscellaneous QUIC constants

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

16 months agoQUIC Stream Mapper: CSM-related changes, stream limits handling
Hugo Landau [Thu, 17 Nov 2022 15:29:44 +0000 (15:29 +0000)]
QUIC Stream Mapper: CSM-related changes, stream limits handling

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

16 months agoQUIC: Complete the implementation of the RX depacketiser in terms of QUIC_CHANNEL
Hugo Landau [Thu, 17 Nov 2022 15:26:39 +0000 (15:26 +0000)]
QUIC: Complete the implementation of the RX depacketiser in terms of QUIC_CHANNEL

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

16 months agoQUIC_CHANNEL: Implementation
Hugo Landau [Thu, 17 Nov 2022 15:00:41 +0000 (15:00 +0000)]
QUIC_CHANNEL: Implementation

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

16 months agoQUIC: Add QUIC reactor
Hugo Landau [Thu, 17 Nov 2022 14:59:18 +0000 (14:59 +0000)]
QUIC: Add QUIC reactor

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

16 months agoAdd BIO poll descriptors
Hugo Landau [Thu, 17 Nov 2022 15:17:39 +0000 (15:17 +0000)]
Add BIO poll descriptors

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

16 months agoQUIC ACKM: Add function to get PTO
Hugo Landau [Tue, 1 Nov 2022 16:39:09 +0000 (16:39 +0000)]
QUIC ACKM: Add function to get PTO

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

16 months agoQUIC RXDP: Remove non-actionable TODOs
Hugo Landau [Tue, 1 Nov 2022 14:38:07 +0000 (14:38 +0000)]
QUIC RXDP: Remove non-actionable TODOs

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

16 months agoQUIC CSM: Documentation for new APIs
Hugo Landau [Mon, 14 Nov 2022 18:13:35 +0000 (18:13 +0000)]
QUIC CSM: Documentation for new APIs

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

16 months agoQUIC Transport Parameters: Add CID encoder/decoder, make ID optional
Hugo Landau [Thu, 17 Nov 2022 14:20:39 +0000 (14:20 +0000)]
QUIC Transport Parameters: Add CID encoder/decoder, make ID optional

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

16 months agoQUIC RX: Refactor unsafe DCID consistency checking
Hugo Landau [Thu, 3 Nov 2022 06:45:50 +0000 (06:45 +0000)]
QUIC RX: Refactor unsafe DCID consistency checking

Previously, we enforced the requirement that the DCIDs be the same for
all packets in a datagram by keeping a pointer to the first RXE
generated from a datagram. This is unsafe and could lead to a UAF if the
first packet is malformed, meaning that no RXE ended up being generated
from it. Keep track of the DCID directly instead, as we should enforce
this correctly even if the first packet in a datagram is malformed (but
has an intelligible header with a DCID and length).

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

16 months agoRemove duplicate declaration
Hugo Landau [Wed, 2 Nov 2022 08:12:19 +0000 (08:12 +0000)]
Remove duplicate declaration

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

16 months agointernal/sockets.h: Ensure errno.h included when necessary
Hugo Landau [Thu, 17 Nov 2022 14:19:42 +0000 (14:19 +0000)]
internal/sockets.h: Ensure errno.h included when necessary

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

16 months agoQUIC Dummy Handshake Layer: Allow transport parameters to be set later
Hugo Landau [Thu, 17 Nov 2022 14:19:08 +0000 (14:19 +0000)]
QUIC Dummy Handshake Layer: Allow transport parameters to be set later

Server mode not implemented yet.

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

16 months agoQUIC TXP: Don't send STREAM frames until handshake is complete
Hugo Landau [Mon, 31 Oct 2022 17:39:45 +0000 (17:39 +0000)]
QUIC TXP: Don't send STREAM frames until handshake is complete

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

16 months agoQUIC TXP: Make discard_enc_level match documentation
Hugo Landau [Mon, 31 Oct 2022 16:03:25 +0000 (16:03 +0000)]
QUIC TXP: Make discard_enc_level match documentation

The documentation in the header file of the TXP stated that it is the
caller's responsibility to also notify the QTX of a discarded EL.
However, the implementation did not reflect this. Update the
implementation to reflect the intended design.

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

16 months agoQUIC TXP: Add a function to query if the TXP wants to generate a packet
Hugo Landau [Mon, 31 Oct 2022 16:03:03 +0000 (16:03 +0000)]
QUIC TXP: Add a function to query if the TXP wants to generate a packet

For use by QUIC CSM.

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

16 months agoQUIC Record Layer: Allow INITIAL EL to be rekeyed
Hugo Landau [Mon, 31 Oct 2022 15:58:48 +0000 (15:58 +0000)]
QUIC Record Layer: Allow INITIAL EL to be rekeyed

Ordinarily we should not allow ELs to be rekeyed as it makes no sense to
do so. However the INITIAL EL can need to be rekeyed if a connection
retry occurs. Modify the QRL to allow this.

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

16 months agoQUIC: Add transport parameter and other constants
Hugo Landau [Mon, 31 Oct 2022 15:54:14 +0000 (15:54 +0000)]
QUIC: Add transport parameter and other constants

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

16 months agoQUIC Wire Format Encoding: Fix handling of zero-length parameters
Hugo Landau [Mon, 31 Oct 2022 15:48:18 +0000 (15:48 +0000)]
QUIC Wire Format Encoding: Fix handling of zero-length parameters

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

16 months agoQUIC RSTREAM: Allow pointer to be NULL when calling free
Hugo Landau [Mon, 31 Oct 2022 15:45:54 +0000 (15:45 +0000)]
QUIC RSTREAM: Allow pointer to be NULL when calling free

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

16 months agoQUIC TX: Do not have QTX handle refcount of BIOs
Hugo Landau [Mon, 31 Oct 2022 15:44:08 +0000 (15:44 +0000)]
QUIC TX: Do not have QTX handle refcount of BIOs

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

16 months agoQUIC RXFC: Don't emit a MAX_STREAM_DATA frame if we have a final size
Hugo Landau [Mon, 31 Oct 2022 15:22:45 +0000 (15:22 +0000)]
QUIC RXFC: Don't emit a MAX_STREAM_DATA frame if we have a final size

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

16 months agoQUIC Wire Encoding: Support Retry Integrity Tag Calculation
Hugo Landau [Mon, 31 Oct 2022 15:15:26 +0000 (15:15 +0000)]
QUIC Wire Encoding: Support Retry Integrity Tag Calculation

This adds support for calculating and verifying retry integrity tags. In
order to support this, an 'unused' field is added to the QUIC packet
header structure so we can ensure that the serialization of the header
is bit-for-bit identical to what was decoded.

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

16 months agoQUIC RX: Do not handle auto-discard of Initial EL inside the QRX
Hugo Landau [Mon, 31 Oct 2022 14:47:29 +0000 (14:47 +0000)]
QUIC RX: Do not handle auto-discard of Initial EL inside the QRX

While the QUIC RFCs state that the Initial EL should be auto-discarded
when successfully processing a packet at a higher EL, doing this inside
the QRX was not a good idea as this should be handled by the CSM.
We remove this functionality and adapt tests accordingly.

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

16 months agoQUIC RX: Fix QRX packet handling refactor w.r.t. list refactor
Hugo Landau [Thu, 17 Nov 2022 14:22:36 +0000 (14:22 +0000)]
QUIC RX: Fix QRX packet handling refactor w.r.t. list refactor

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

16 months agoQUIC RX: Support refcounted packets and eliminate wrapper
Hugo Landau [Mon, 31 Oct 2022 14:39:13 +0000 (14:39 +0000)]
QUIC RX: Support refcounted packets and eliminate wrapper

Previously, the QRX filled in a OSSL_QRX_PKT structure provided by the
caller. This necessitated the caller managing reference counting itself
using a OSSL_QRX_PKT_WRAP structure. The need for this structure has
been eliminated by adding refcounting support to the QRX itself. The QRX
now outputs a pointer to an OSSL_QRX_PKT instead of filling in a
structure provided by the caller. The OSSL_QRX_PKT_WRAP structure has
been eliminated.

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

16 months agoQUIC: Dummy Handshake Layer for Prototyping
Hugo Landau [Mon, 31 Oct 2022 13:57:40 +0000 (13:57 +0000)]
QUIC: Dummy Handshake Layer for Prototyping

This disables -Wtype-limits /
-Wtautological-constant-out-of-range-compare. Since it generates
warnings for valid and reasonable code, IMO this actually encourages
people to write worse code.

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

16 months agoQUIC DEMUX: Allow BIO to be changed
Hugo Landau [Mon, 31 Oct 2022 13:54:48 +0000 (13:54 +0000)]
QUIC DEMUX: Allow BIO to be changed

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

16 months agoQUIC Congestion Control: API to determine deadline at which more credit will be available
Hugo Landau [Mon, 31 Oct 2022 13:51:09 +0000 (13:51 +0000)]
QUIC Congestion Control: API to determine deadline at which more credit will be available

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

16 months agoQUIC ACKM: Add support for psuedo-loss
Hugo Landau [Mon, 31 Oct 2022 13:32:34 +0000 (13:32 +0000)]
QUIC ACKM: Add support for psuedo-loss

This is required to support retries during connection establishment.

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

16 months agoSupport all five EdDSA instances from RFC 8032
James Muir [Sun, 16 Oct 2022 02:23:39 +0000 (22:23 -0400)]
Support all five EdDSA instances from RFC 8032

Fixes #6277

Description:
Make each of the five EdDSA instances defined in RFC 8032 -- Ed25519,
Ed25519ctx, Ed25519ph, Ed448, Ed448ph -- available via the EVP APIs.

The desired EdDSA instance is specified via an OSSL_PARAM.

All instances, except for Ed25519, allow context strings as input.
Context strings are passed via an OSSL_PARAM.  For Ed25519ctx, the
context string must be nonempty.

Ed25519, Ed25519ctx, Ed448 are PureEdDSA instances, which means that
the full message (not a digest) must be passed to sign and verify
operations.

Ed25519ph, Ed448ph are HashEdDSA instances, which means that the input
message is hashed before sign and verify.

Testing:
All 21 test vectors from RFC 8032 have been added to evppkey_ecx.txt
(thanks to Shane Lontis for showing how to do that).  Those 21 test
vectors are exercised by evp_test.c and cover all five instances.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19705)

16 months agofips: make EdDSA unapproved for FIPS
Pauli [Mon, 9 Jan 2023 00:25:55 +0000 (11:25 +1100)]
fips: make EdDSA unapproved for FIPS

Likewise for the related ECX key exchanges.

NIST is mandating this until FIPS 186-5 is finalised.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20020)

16 months agoMake RSA_generate_multi_prime_key() not segfault if e is NULL.
slontis [Wed, 11 Jan 2023 04:32:07 +0000 (14:32 +1000)]
Make RSA_generate_multi_prime_key() not segfault if e is NULL.

This is not a big problem for higher level keygen, as these set e
beforehand to a default value. But the logic at the lower level is
incorrect since it was doing a NULL check in one place but then
segfaulting during a later BN_copy().

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20025)

16 months agoremove unused macro in rc2_local.h and rc5_local.h
zhangzhilei [Tue, 10 Jan 2023 08:32:08 +0000 (16:32 +0800)]
remove unused macro in rc2_local.h and rc5_local.h

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20015)

16 months agoSSKDF with KMAC should return SIZE_MAX when EVP_KDF_CTX_get_kdf_size()
slontis [Tue, 20 Dec 2022 03:44:18 +0000 (13:44 +1000)]
SSKDF with KMAC should return SIZE_MAX when EVP_KDF_CTX_get_kdf_size()
is used.

Fixes #19934

The existing code was looking for the digest size, and then returned
zero.

The example code in EVP_KDF-SS.pod has been corrected to not use a
digest.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19935)

16 months agofix manpage of `d2i_X509(3)`
Nobuhiro IMAI [Tue, 10 Jan 2023 09:44:44 +0000 (18:44 +0900)]
fix manpage of `d2i_X509(3)`

* capitalize `X509_NAME`
* add missing suffixes to `i2d_TYPE`

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20016)

16 months agoDo not check definition of a macro and use it in a single condition
Tomas Mraz [Tue, 10 Jan 2023 17:00:59 +0000 (18:00 +0100)]
Do not check definition of a macro and use it in a single condition

The condition evaluation in #if conditions does not tolerate this
if the macro is not defined.

Fixes #19628

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20018)

16 months agoOSSL_PARAM_BLD and BIGNUM; ensure at least one byte is allocated
Richard Levitte [Tue, 10 Jan 2023 07:27:44 +0000 (08:27 +0100)]
OSSL_PARAM_BLD and BIGNUM; ensure at least one byte is allocated

A zero BIGNUM contains zero bytes, while OSSL_PARAMs with an INTEGER (or
UNSIGNED INTEGER) data type are expected to have at least one data byte
allocated, containing a zero.  This wasn't handled correctly.

Fixes #20011

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)

16 months agoIn OSSL_PARAM_set_BN(), make sure that the data_size field is at least 1
Richard Levitte [Tue, 10 Jan 2023 11:22:39 +0000 (12:22 +0100)]
In OSSL_PARAM_set_BN(), make sure that the data_size field is at least 1

This way, we guarantee that a zero is represented with one byte of data
that's set to zero.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)

16 months agotest/param_build_test.c: test zero BIGNUM
Richard Levitte [Tue, 10 Jan 2023 06:50:24 +0000 (07:50 +0100)]
test/param_build_test.c: test zero BIGNUM

We also add tests where the zero bignum is the only parameter, to test what
that does with the allocated blocks that the OSSL_PARAM_BLD functionality
handles.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20013)

16 months agoAdd empty migration guide for 3.1
H. Vetinari [Mon, 9 Jan 2023 04:53:48 +0000 (15:53 +1100)]
Add empty migration guide for 3.1

Fixes #19953

CLA: trivial

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

16 months agoDoc: Update history section of EC_GROUP API's.
slontis [Thu, 22 Dec 2022 08:52:17 +0000 (18:52 +1000)]
Doc: Update history section of EC_GROUP API's.

Fixes #8630

The remaining functions are at least as old as 0.9.8 so it is
not worth documenting this.

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19956)

16 months agoDocumentation for EVP_PKEY_CTX_get0_pkey() and EVP_PKEY_CTX_get0_peerkey().
Nikhil Bisht [Thu, 22 Dec 2022 20:56:28 +0000 (02:26 +0530)]
Documentation for EVP_PKEY_CTX_get0_pkey() and EVP_PKEY_CTX_get0_peerkey().

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

16 months agoinfo.c: Fix typos in seed macro name and description string
Greg McLearn [Fri, 6 Jan 2023 08:40:04 +0000 (03:40 -0500)]
info.c: Fix typos in seed macro name and description string

Fixes: #19996
CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20001)

16 months agorsaz_exp_x2.c: Remove unused ALIGN64 macro
Tomas Mraz [Thu, 3 Nov 2022 13:01:56 +0000 (14:01 +0100)]
rsaz_exp_x2.c: Remove unused ALIGN64 macro

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19597)

16 months agorsaz_exp_x2.c: Avoid potential undefined behavior with strict aliasing
Tomas Mraz [Thu, 3 Nov 2022 12:48:55 +0000 (13:48 +0100)]
rsaz_exp_x2.c: Avoid potential undefined behavior with strict aliasing

Fixes #19584

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19597)

16 months agoRevert "Fix an occasional CI failure due to unaligned access"
Tomas Mraz [Thu, 3 Nov 2022 12:26:22 +0000 (13:26 +0100)]
Revert "Fix an occasional CI failure due to unaligned access"

This reverts commit 8511520842b744d1794ea794c032ce5f78cd874b.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19597)

16 months agoFix SM4 test failures on big-endian ARM processors
Xu Yizhou [Thu, 15 Dec 2022 02:21:07 +0000 (10:21 +0800)]
Fix SM4 test failures on big-endian ARM processors

Signed-off-by: Xu Yizhou <xuyizhou1@huawei.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19910)

16 months agoremove extra define for __NR_getrandom and add some comments
zhangzhilei [Tue, 3 Jan 2023 11:12:35 +0000 (19:12 +0800)]
remove extra define for __NR_getrandom and add some comments

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19985)

16 months agoWrite SSL_R alerts to error state to keep updated strings
Tomas Mraz [Wed, 21 Dec 2022 15:49:10 +0000 (16:49 +0100)]
Write SSL_R alerts to error state to keep updated strings

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19950)

16 months ago80-test_cms.t: Fix rsapssSaltlen check on MinGW
Tomas Mraz [Thu, 22 Dec 2022 10:25:16 +0000 (11:25 +0100)]
80-test_cms.t: Fix rsapssSaltlen check on MinGW

Fixes #19907

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19957)

16 months ago25-test_pkcs8.t: Make text comparison ignore extra CR characters
Tomas Mraz [Thu, 22 Dec 2022 10:26:14 +0000 (11:26 +0100)]
25-test_pkcs8.t: Make text comparison ignore extra CR characters

This is needed to pass the test on MinGW.

Fixes #19921

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19957)

16 months agoCleanse internal BN_generate_dsa_nonce() buffers used to generate k.
slontis [Thu, 22 Dec 2022 02:01:02 +0000 (12:01 +1000)]
Cleanse internal BN_generate_dsa_nonce() buffers used to generate k.

Fixes #9205

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19954)

16 months agoFixed typos in documentation and comments
Semen Zhydenko [Sun, 1 Jan 2023 21:50:11 +0000 (22:50 +0100)]
Fixed typos in documentation and comments

Fixed typo: accomodate -> accommodate
Fixed typo: analagous -> analogous
Fixed typo: auxilliary -> auxiliary
Fixed typo: eigth -> eighth
Fixed typo: explotation -> exploitation
Fixed typo: originaly -> originally
Fixed typo: simplier -> simpler
Fixed typo: sucessful -> successful
Fixed typo: recievers -> receivers

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19977)

16 months agoBump actions/setup-python from 4.3.1 to 4.4.0
dependabot[bot] [Thu, 22 Dec 2022 17:10:52 +0000 (17:10 +0000)]
Bump actions/setup-python from 4.3.1 to 4.4.0

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
CLA: trivial

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19961)

16 months agoINSTALL.md: Remove trailing space
Tomas Mraz [Thu, 22 Dec 2022 14:24:24 +0000 (15:24 +0100)]
INSTALL.md: Remove trailing space

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19960)

16 months agoSupport multibin to allow multiple binary models to co-exist.
Randall S. Becker [Mon, 30 Aug 2021 19:24:39 +0000 (15:24 -0400)]
Support multibin to allow multiple binary models to co-exist.

This change parallels the implementation of multilib and initially
only applies to the NonStop platform's DLL loader limitations.

Fixes: #16460
Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16472)

16 months agoDocs: Move deprecated ECDSA_ functions into a separate file.
slontis [Tue, 20 Dec 2022 05:54:34 +0000 (15:54 +1000)]
Docs: Move deprecated ECDSA_ functions into a separate file.

Fixes #19829

Examples added for setting/getting ECDSA SIG related r and s values

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19936)