openssl.git
12 months agoMinor fixups
Hugo Landau [Tue, 18 Apr 2023 18:37:49 +0000 (19:37 +0100)]
Minor fixups

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

12 months agoQUIC MSST: Tests
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC MSST: Tests

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

12 months agoQUIC APL: Fix a bug where incoming unidirectional streams weren't detected
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC APL: Fix a bug where incoming unidirectional streams weren't detected

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

12 months agoQUIC TSERVER: Allow STOP_SENDING/RESET_STREAM to be queried
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC TSERVER: Allow STOP_SENDING/RESET_STREAM to be queried

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

12 months agoQUIC TSERVER: Handle FINs correctly if ossl_quic_tserver_read is not called first
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC TSERVER: Handle FINs correctly if ossl_quic_tserver_read is not called first

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

12 months agoQUIC QSM: Minor bugfixes
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC QSM: Minor bugfixes

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

12 months agoQUIC MSST: make update
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC MSST: make update

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

12 months agoQUIC MSST: Add documentation for new APIs
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC MSST: Add documentation for new APIs

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

12 months agoQUIC APL: Send STOP_SENDING/RESET_STREAM when XSO is freed
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC APL: Send STOP_SENDING/RESET_STREAM when XSO is freed

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

12 months agoQUIC QSM: Stream garbage collection
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC QSM: Stream garbage collection

This allows QUIC_STREAM objects to be deleted when they are no longer
needed.

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

12 months agoQUIC FIFD: Add support for callback on frame ACK
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC FIFD: Add support for callback on frame ACK

We need to get acknowledgement notifications for our STOP_SENDING and
STREAM_RESET frames as this information is needed to know when we can
delete a QUIC_STREAM object.

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

12 months agoQUIC DISPATCH/APL: Add SSL_stream_reset and status query APIs
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Add SSL_stream_reset and status query APIs

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

12 months agoQUIC RXDP: Record STOP_SENDING/RESET_STREAM event AEC codes consistently
Hugo Landau [Tue, 18 Apr 2023 18:30:56 +0000 (19:30 +0100)]
QUIC RXDP: Record STOP_SENDING/RESET_STREAM event AEC codes consistently

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

12 months agoQUIC QSM: Clean up SEND_STREAM/RECV_STREAM handling
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC QSM: Clean up SEND_STREAM/RECV_STREAM handling

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

12 months agoQUIC CHANNEL: Do not copy terminate cause as it is not modified after termination
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC CHANNEL: Do not copy terminate cause as it is not modified after termination

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

12 months agoQUIC QSM: Handle STOP_SENDING correctly
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC QSM: Handle STOP_SENDING correctly

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

12 months agoQUIC RXDP/QSM: Enforce MAX_STREAMS
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC RXDP/QSM: Enforce MAX_STREAMS

Also use accept queue popping by the application as the retirement
event, i.e., as the cue to increase the limit.

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

12 months agoQUIC TXP/CHANNEL: Generate MAX_STREAMS using RXFC
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC TXP/CHANNEL: Generate MAX_STREAMS using RXFC

Though the RXFC was designed for stream flow control, its logic
is generic enough to use to control MAX_STREAMS generation.

Control of when _we_ can open streams is already done in a bespoke
fashion and doesn't use a TXFC, however (see
ossl_quic_stream_map_update_state).

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

12 months agoQUIC FC: Modify RXFC to support use for enforcing MAX_STREAMS
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC FC: Modify RXFC to support use for enforcing MAX_STREAMS

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

12 months agoQUIC CHANNEL: Incoming streams implicitly create lower-numbered streams
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC CHANNEL: Incoming streams implicitly create lower-numbered streams

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

12 months agoQUIC: Update faults test to use streams correctly
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC: Update faults test to use streams correctly

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

12 months agoQUIC FIFD: Ensure QUIC_STREAM is updated after QUIC_SSTREAM loss
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC FIFD: Ensure QUIC_STREAM is updated after QUIC_SSTREAM loss

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

12 months agoQUIC APL: Fix locking in XSO code and fix tests
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC APL: Fix locking in XSO code and fix tests

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

12 months agoQUIC CHANNEL, APL: Reject policy handling
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC CHANNEL, APL: Reject policy handling

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

12 months agoQUIC DISPATCH/APL: SSL_accept_stream, SSL_get_accept_queue_len
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: SSL_accept_stream, SSL_get_accept_queue_len

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

12 months agoQUIC DISPATCH/APL: Add SSL_set_incoming_stream_reject_policy (unwired)
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Add SSL_set_incoming_stream_reject_policy (unwired)

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

12 months agoQUIC DISPATCH/APL: Implement SSL_set_default_stream_mode, default XSO refactor
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Implement SSL_set_default_stream_mode, default XSO refactor

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

12 months agoQUIC DISPATCH/APL: Implement SSL_get_stream_id
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Implement SSL_get_stream_id

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

12 months agoQUIC DISPATCH/APL: Implement SSL_get_stream_type
Hugo Landau [Tue, 18 Apr 2023 18:30:55 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Implement SSL_get_stream_type

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

12 months agoQUIC DISPATCH/APL: Implement SSL_is_connection
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Implement SSL_is_connection

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

12 months agoQUIC DISPATCH/APL: Implement SSL_get0_connection
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC DISPATCH/APL: Implement SSL_get0_connection

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

12 months agoQUIC APL: Defer default XSO creation
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC APL: Defer default XSO creation

QUIC in single-stream mode could be used with a protocol where the
server writes first or the client writes first. This determines
whether the single stream would be client or server initiated,
which affects the stream ID allocated to the stream. We should support
both client-sends-first and server-sends-first application protocols.
Thus, defer default XSO creation until the point in time at which
we know whether a client-first or server-first application protocol
is being used. We do this by taking whether SSL_read() or SSL_write()
is called first as a cue.

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

12 months agoQUIC TSERVER: Add support for multiple streams
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC TSERVER: Add support for multiple streams

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

12 months agoQUIC CHANNEL: Initialise state, FC credit for new streams correctly
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Initialise state, FC credit for new streams correctly

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

12 months agoQUIC CHANNEL: Handle incoming remotely-created streams
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Handle incoming remotely-created streams

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

12 months agoQUIC APL: Add stream creation APIs
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC APL: Add stream creation APIs

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

12 months agoQUIC APL: Refactor stream-related code into QUIC_XSO object
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC APL: Refactor stream-related code into QUIC_XSO object

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

12 months agoQUIC CHANNEL: Handle any number of streams
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Handle any number of streams

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

12 months agoQUIC CHANNEL: Store TPs for initial flow control in TX direction
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Store TPs for initial flow control in TX direction

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

12 months agoQUIC CHANNEL: Clarify role of RX TPs in preparation of storing TX TPs
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Clarify role of RX TPs in preparation of storing TX TPs

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

12 months agoQUIC CHANNEL: Remove stream 0-specific code
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC CHANNEL: Remove stream 0-specific code

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

12 months agoQUIC APL: Create QUIC CHANNEL up front rather than deferring creation
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC APL: Create QUIC CHANNEL up front rather than deferring creation

We switch to instantiating the QUIC_CHANNEL up front at QCSO
instantiation time. This creates the QUIC_STREAM_MAP early and makes it
easy for us to allocate streams prior to connection initiation. The role
(client or server) is determined at QCSO allocation time and cannot be
changed.

SSL_set_connect/accept_state() are still modelled but their usage must
be consistent with the chosen SSL_METHOD which dictates which role is
being used.

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

12 months agoQUIC: Base client/server identity on SSL method, not SSL_set_connect/accept_state
Hugo Landau [Tue, 18 Apr 2023 18:30:54 +0000 (19:30 +0100)]
QUIC: Base client/server identity on SSL method, not SSL_set_connect/accept_state

In QUIC, we have an architectural need (in future, when we implement
0-RTT, etc.) to be able to create streams before we start connecting.
This requires we allocate a stream, including a stream ID, after
creating a QCSO but prior to connecting. However stream IDs are
dependent on whether the endpoint is in the client or server role,
therefore we must know whether we are going to be a client or server
before any pre-connection streams are created. Moreover, the originally
defined QUIC_client_method() and QUIC_server_method() functions heavily
implied the original plan was to have different SSL_METHODs for clients
and servers. Up until now we had been relying on
SSL_set_connect/accept_state() instead.

Solve these problems by basing client/server identity on whether
QUIC_server_method() is used (in future, when we support servers). This
ensures that once a QCSO is created its client/server identity are fixed
and cannot change, allowing pre-connection stream IDs, etc. to be
allocated.

Client/server uncertainty was the primary reason why QUIC_CHANNEL
creation was deferred until connection time up until now, so this
enables further refactoring to facilitate eager allocation of the
QUIC_CHANNEL at QCSO allocation time. This is important as allocating a
stream including its write buffers is hard without having the
QUIC_CHANNEL (which owns the QUIC_STREAM_MAP) in existence.

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

12 months agoQUIC Dispatch: Update ssl_lib.c frontend to use new dispatch style
Hugo Landau [Tue, 18 Apr 2023 18:30:53 +0000 (19:30 +0100)]
QUIC Dispatch: Update ssl_lib.c frontend to use new dispatch style

This amends the dispatch code from ssl_lib.c to the QUIC API Personality
Layer to use the new approach of dispatching using SSL object pointers
rather than raw QUIC_CONNECTION pointers. This completes the said
refactor.

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

12 months agoQUIC Dispatch: Add simple way to determine if SSL object is QUIC-related
Hugo Landau [Tue, 18 Apr 2023 18:30:53 +0000 (19:30 +0100)]
QUIC Dispatch: Add simple way to determine if SSL object is QUIC-related

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

12 months agoQUIC Dispatch: Refactor APL interface to use SSL pointers not QC pointers
Hugo Landau [Tue, 18 Apr 2023 18:30:53 +0000 (19:30 +0100)]
QUIC Dispatch: Refactor APL interface to use SSL pointers not QC pointers

We now refactor the interface between ssl_lib.c frontend functions and
the QUIC API Personality Layer so that the respective functions
comprising the interface use SSL object pointers rather than raw
QUIC_CONNECTION pointers. This is in preparation for stream support
since once streams are supported, calls to e.g. ossl_quic_write() may be
made on a QUIC_CONNECTION or a QUIC_XSO (that is, a stream object). Thus
we take a uniform approach across all functions comprising the interface
between the ssl_lib.c frontend and the QUIC API Personality Layer of
using SSL pointers always. This provides a uniform approach  and
ensures that any function of the API personality layer can be easily
adapted to support being called on a stream object in the future.

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

12 months agoQUIC Dispatch: Introduce the QUIC_XSO object
Hugo Landau [Tue, 18 Apr 2023 18:30:53 +0000 (19:30 +0100)]
QUIC Dispatch: Introduce the QUIC_XSO object

The QUIC_XSO (external stream object) is to a QUIC stream what a
QUIC_CONNECTION is to a QUIC connection. Both are SSL objects. The
QUIC_CONNECTION type is the internal representation of a QUIC connection
SSL object (QCSO) and the QUIC_XSO type is the internal representation
of a QUIC stream SSL object (QSSO) type. The name QUIC_XSO has been
chosen to be distinct from the existing QUIC_STREAM type which is our
existing internal stream type. QUIC_XSO is to a QUIC_STREAM what
QUIC_CONNECTION is to a QUIC_CHANNEL; in other words, QUIC_CONNECTION
and QUIC_XSO objects form part of the API personality layer, whereas
QUIC_CHANNEL and QUIC_STREAM objects form part of the QUIC core and are
distinct from the API personality layer.

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

12 months agoQUIC Dispatch: Enhance SSL object unwrapping functions (core)
Hugo Landau [Tue, 18 Apr 2023 18:30:53 +0000 (19:30 +0100)]
QUIC Dispatch: Enhance SSL object unwrapping functions (core)

Uniform changes to all dispatch functions to use the new dispatch
functionality follows this commit. Separated into a core commit
and a commit containing the uniform pattern (monotonous) changes
for ease of review.

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

12 months agoCMP client: fix checking new cert enrolled with oldcert and without private key
Dr. David von Oheimb [Tue, 25 Apr 2023 17:26:36 +0000 (19:26 +0200)]
CMP client: fix checking new cert enrolled with oldcert and without private key

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20832)

12 months agoCMP client: fix error response on -csr without private key, also in docs
Dr. David von Oheimb [Tue, 25 Apr 2023 17:14:34 +0000 (19:14 +0200)]
CMP client: fix error response on -csr without private key, also in docs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20832)

12 months agoapps/openssl.cnf: fix reference to insta.ca.crt
Dr. David von Oheimb [Tue, 25 Apr 2023 10:21:33 +0000 (12:21 +0200)]
apps/openssl.cnf: fix reference to insta.ca.crt

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20832)

12 months agoprovider: return error if buf too small when getting ec pubkey param
Yi Li [Fri, 5 May 2023 03:30:05 +0000 (11:30 +0800)]
provider: return error if buf too small when getting ec pubkey param

Fixes #20889

There was an incorrect value passed to EC_POINT_point2oct() for the
buffer size of the param passed-in.

Added testcases.

Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20890)

12 months agoFix typos found by codespell
Dimitri Papadopoulos [Wed, 10 May 2023 10:10:57 +0000 (12:10 +0200)]
Fix typos found by codespell

Fix only typos in doc/man* for inclusion in 3.* branches.

Other typos have been fixed in a different commit.

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

12 months agoClarify documentation of SSL_SESSION_dup
Watson Ladd [Thu, 27 Apr 2023 17:16:49 +0000 (10:16 -0700)]
Clarify documentation of SSL_SESSION_dup

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

12 months agoClear ownership when duplicating sessions
Watson Ladd [Thu, 27 Apr 2023 17:14:51 +0000 (10:14 -0700)]
Clear ownership when duplicating sessions

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

12 months agoecp_nistp256.c: Fix exponent in comment
Jonas Lindstrøm [Wed, 10 May 2023 10:47:10 +0000 (12:47 +0200)]
ecp_nistp256.c: Fix exponent in comment

CLA: trivial

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

12 months agofix SSL_get_wbio may return rbio on quic
ihciah [Wed, 10 May 2023 15:07:08 +0000 (15:07 +0000)]
fix SSL_get_wbio may return rbio on quic

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

12 months agoFixed TLS1.3 handshake issue for legacy engine API.
Yuan, Shuai [Wed, 10 May 2023 08:49:54 +0000 (04:49 -0400)]
Fixed TLS1.3 handshake issue for legacy engine API.

Signed-off-by: Yuan, Shuai <shuai.yuan@intel.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20922)

12 months agoFix a typo found by codespell in a variable name
Dimitri Papadopoulos [Tue, 9 May 2023 10:21:36 +0000 (12:21 +0200)]
Fix a typo found by codespell in a variable name

The change is limited to a single C file.

CLA: trivial

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

12 months agorestrict rsaBITS algorithm name check in speed
Michael Baentsch [Mon, 8 May 2023 04:32:37 +0000 (06:32 +0200)]
restrict rsaBITS algorithm name check in speed

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

12 months agoCMP app: fix deallocated host/port fields in APP_HTTP_TLS_INFO
Dr. David von Oheimb [Mon, 16 Jan 2023 14:48:24 +0000 (15:48 +0100)]
CMP app: fix deallocated host/port fields in APP_HTTP_TLS_INFO

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

12 months agoCMP app and app_http_tls_cb(): pick the right TLS hostname (also without port)
Dr. David von Oheimb [Thu, 12 Jan 2023 09:54:50 +0000 (10:54 +0100)]
CMP app and app_http_tls_cb(): pick the right TLS hostname (also without port)

Fixes #20031

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

12 months agoFix a typo found by codespell in a Makefile variable
Dimitri Papadopoulos [Tue, 9 May 2023 09:50:06 +0000 (11:50 +0200)]
Fix a typo found by codespell in a Makefile variable

I have no experience with building on Windows, so I don't know the
effect of fixing this typo. I guess that this will fix a bug at worst.

CLA: trivial

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

12 months agoDLTS → DTLS
Dimitri Papadopoulos [Tue, 9 May 2023 06:04:20 +0000 (08:04 +0200)]
DLTS → DTLS

Fix a typo that is confusing for newcomers.

CLA: trivial

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

12 months agoFix memory leak in engine_cleanup_add_first()
Kovalev Vasiliy [Thu, 4 May 2023 12:12:33 +0000 (16:12 +0400)]
Fix memory leak in engine_cleanup_add_first()

Fixes #20870

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20880)

12 months agoaes-gcm-armv8_64 asm support bigdian
JerryDevis [Sat, 11 Mar 2023 10:35:23 +0000 (18:35 +0800)]
aes-gcm-armv8_64 asm support bigdian

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20489)

(cherry picked from commit 32344a74b7ee2693a5bfda361c40ec60ab5be624)

12 months agoFix stack use-after-free in QUIC
Juergen Christ [Mon, 8 May 2023 09:15:32 +0000 (11:15 +0200)]
Fix stack use-after-free in QUIC

When running test_quicapi on master on a Fedora 38 with santizier, a stack
use-after-free is reported:

```
75-test_quicapi.t ..
=================================================================
==28379==ERROR: AddressSanitizer: stack-use-after-return on address 0x03ffa22a2961 at pc 0x03ffa507384a bp 0x03fffb576d68 sp 0x03fffb576550
READ of size 8 at 0x03ffa22a2961 thread T0
    #0 0x3ffa5073849 in memcpy (/usr/lib64/libasan.so.8+0x73849) (BuildId: ce24d4ce2e06892c2e9105155979b957089a182c)
    #1 0x118b883 in tls_handle_alpn ssl/statem/statem_srvr.c:2221
    #2 0x111569d in tls_parse_all_extensions ssl/statem/extensions.c:813
    #3 0x118e2bf in tls_early_post_process_client_hello ssl/statem/statem_srvr.c:1957
    #4 0x118e2bf in tls_post_process_client_hello ssl/statem/statem_srvr.c:2290
    #5 0x113d797 in read_state_machine ssl/statem/statem.c:712
    #6 0x113d797 in state_machine ssl/statem/statem.c:478
    #7 0x10729f3 in SSL_do_handshake ssl/ssl_lib.c:4669
    #8 0x11cec2d in ossl_quic_tls_tick ssl/quic/quic_tls.c:717
    #9 0x11afb03 in ch_tick ssl/quic/quic_channel.c:1296
    #10 0x10cd1a9 in ossl_quic_reactor_tick ssl/quic/quic_reactor.c:79
    #11 0x10d948b in ossl_quic_tserver_tick ssl/quic/quic_tserver.c:160
    #12 0x1021ead in qtest_create_quic_connection test/helpers/quictestlib.c:273
    #13 0x102b81d in test_quic_write_read test/quicapitest.c:54
    #14 0x12035a9 in run_tests test/testutil/driver.c:370
    #15 0x1013203 in main test/testutil/main.c:30
    #16 0x3ffa463262b in __libc_start_call_main (/usr/lib64/libc.so.6+0x3262b) (BuildId: 6bd4a775904d85009582d6887da4767128897d0e)
    #17 0x3ffa463272d in __libc_start_main_impl (/usr/lib64/libc.so.6+0x3272d) (BuildId: 6bd4a775904d85009582d6887da4767128897d0e)
    #18 0x101efb9  (/root/openssl/test/quicapitest+0x101efb9) (BuildId: 075e387adf6d0032320aaa18061f13e9565ab481)
Address 0x03ffa22a2961 is located in stack of thread T0 at offset 33 in frame
    #0 0x10d868f in alpn_select_cb ssl/quic/quic_tserver.c:49
  This frame has 1 object(s):
    [32, 41) 'alpn' (line 50) <== Memory access at offset 33 is inside this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-return (/usr/lib64/libasan.so.8+0x73849) (BuildId: ce24d4ce2e06892c2e9105155979b957089a182c) in memcpy
Shadow bytes around the buggy address:
  0x03ffa22a2680: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2700: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2780: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2800: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2880: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
=>0x03ffa22a2900: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5[f5]f5 f5 f5
  0x03ffa22a2980: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2a00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2a80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2b00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x03ffa22a2b80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==28379==ABORTING
../../util/wrap.pl ../../test/quicapitest default ../../test/default.cnf ../../test/certs => 1
not ok 1 - running quicapitest
```

Fix this be making the protocols to select static constants and thereby moving
them out of the stack frame of the callback function.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20904)

12 months agoUpdate the corpora submodule
Matt Caswell [Fri, 28 Apr 2023 10:08:33 +0000 (11:08 +0100)]
Update the corpora submodule

We update the corpora submodule to include a fuzz testcase for the conf
timeout.

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

12 months agoPrevent a fuzzing timeout in the conf fuzzer
Matt Caswell [Wed, 26 Apr 2023 14:04:42 +0000 (15:04 +0100)]
Prevent a fuzzing timeout in the conf fuzzer

The fuzzer was creating a config file with large numbers of includes
which are expensive to process. However this should not cause a security
issue, and should never happen in normal operation so we can ignore it.

Fixes ossfuzz issue 57718.

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

12 months agoDon't attempt a QUIC connection without specifying ALPN
Matt Caswell [Fri, 24 Mar 2023 12:02:37 +0000 (12:02 +0000)]
Don't attempt a QUIC connection without specifying ALPN

ALPN is required for a successful QUIC connection, so do not allow the
-quic option for s_client without -alpn

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20580)

12 months agoAdd some documentation for the new QUIC mode in s_client
Matt Caswell [Thu, 23 Mar 2023 16:24:52 +0000 (16:24 +0000)]
Add some documentation for the new QUIC mode in s_client

Also mentions the new FIN command in s_client advance mode

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20580)

12 months agoAdd the ability to send FIN on a QUIC stream from s_client
Matt Caswell [Tue, 21 Mar 2023 16:52:32 +0000 (16:52 +0000)]
Add the ability to send FIN on a QUIC stream from s_client

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20580)

12 months agoAdd QUIC support to s_client
Matt Caswell [Thu, 9 Mar 2023 17:06:33 +0000 (17:06 +0000)]
Add QUIC support to s_client

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20580)

12 months agoremove unused macro in common.h
zhangzhilei [Thu, 4 May 2023 12:33:38 +0000 (20:33 +0800)]
remove unused macro in common.h

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

12 months agoRevert "win-onecore: Build with /APPCONTAINER for UWP compat"
Mathias Berchtold [Tue, 2 May 2023 22:58:02 +0000 (16:58 -0600)]
Revert "win-onecore: Build with /APPCONTAINER for UWP compat"
This reverts commit 2c61a670ebf2f1923a3bd2ef0ee4b2fa6261eaeb.

Not all OneCore based SKUs (or editions) of Windows (Server, XBOX, etc) require /APPCONTAINER. The /APPCONTAINER link option is only relevant for Universal Windows Platform (UWP) apps for which there are already dedicated configurations (VC-WIN32-UWP, VC-WIN64A-UWP, etc) where the /APPCONTAINER link option is added.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20872)

12 months agoFix the padlock engine
Bernd Edlinger [Thu, 26 Jan 2023 14:45:03 +0000 (15:45 +0100)]
Fix the padlock engine

... after it was broken for almost 5 years,
since the first 1.1.1 release.
Note: The last working version was 1.1.0l release.

Fixes #20073

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20146)

12 months agoAdd libctx to x931 keygen.
slontis [Tue, 15 Nov 2022 02:38:31 +0000 (12:38 +1000)]
Add libctx to x931 keygen.

Added coverage test that failed without the change.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19677)

12 months agoExtend the min/max protocol testing
Matt Caswell [Fri, 31 Mar 2023 11:02:33 +0000 (12:02 +0100)]
Extend the min/max protocol testing

Add more test cases and ensure we test DTLS and QUIC too

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

12 months agoBe more accurate about what we accept as a valid DTLS version
Matt Caswell [Tue, 25 Apr 2023 13:57:02 +0000 (14:57 +0100)]
Be more accurate about what we accept as a valid DTLS version

We accepted more version numbers as valid DTLS then we really should do.

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

12 months agoUpdate the min/max proto function documentation for QUIC
Matt Caswell [Tue, 25 Apr 2023 13:49:22 +0000 (14:49 +0100)]
Update the min/max proto function documentation for QUIC

These functions do nothing if used with a QUIC object, so we document
this behaviour.

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

12 months ago25-test_x509.t: test dots in CA file path
Alois Klink [Tue, 2 May 2023 20:59:45 +0000 (21:59 +0100)]
25-test_x509.t: test dots in CA file path

Test whether dots in the CA file path breaks the default CA serial
number file path.

Tests for:
  - https://github.com/openssl/openssl/issues/6203
  - https://github.com/openssl/openssl/issues/6489
  - https://github.com/openssl/openssl/pull/6566
  - https://github.com/openssl/openssl/issues/10442

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

12 months agofeature: openssl req -verify output to stderr instead of stdout #20728
Rajarshi Karmakar [Sat, 29 Apr 2023 07:27:57 +0000 (07:27 +0000)]
feature: openssl req -verify output to stderr instead of stdout #20728

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20858)

12 months agoFix broken links on asym_cipher manpages
Ladislav Marko [Thu, 13 Apr 2023 15:13:36 +0000 (17:13 +0200)]
Fix broken links on asym_cipher manpages

Links were missing starting tags

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

12 months agoAdd negative integer check when using ASN1_BIT_STRING
mlitre [Mon, 1 May 2023 09:07:21 +0000 (11:07 +0200)]
Add negative integer check when using ASN1_BIT_STRING

The negative integer check is done to prevent potential overflow.
Fixes #20719.

CLA: trivial

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

12 months agoapps: silent warning when loading CSR files with vfyopt option
Tianjia Zhang [Fri, 21 Apr 2023 03:06:21 +0000 (11:06 +0800)]
apps: silent warning when loading CSR files with vfyopt option

When verifying or signing a CSR file with the -vfyopt option,
a warning message similar to the following will appear:

  Warning: CSR self-signature does not match the contents

This happens especially when the SM2 algorithm is used and the
distid parameter is added. Pass the vfyopts parameter to the
do_X509_REQ_verify() function to eliminate the warning message.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20799)

12 months agospeed.c: remove unused num print_message args
Reinhard Urban [Fri, 21 Apr 2023 07:04:57 +0000 (09:04 +0200)]
speed.c: remove unused num print_message args

these num args went unused with the removal of the ifndef SIGALRM
branches, commit ee1d7f1d25ef24f111f13dc742474cd9c39c2753 Feb 2021
PR #14228

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

12 months agorand: trust user supplied entropy when configured without a random source
Pauli [Thu, 27 Apr 2023 01:25:11 +0000 (11:25 +1000)]
rand: trust user supplied entropy when configured without a random source

Fixes #20841

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/20843)

12 months agoCopy min/max_proto_version from SSL_CTX to SSL only for the same method types
Tomas Mraz [Fri, 21 Apr 2023 15:21:21 +0000 (17:21 +0200)]
Copy min/max_proto_version from SSL_CTX to SSL only for the same method types

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

12 months agoDo not send the empty renegotiation info SCSV in QUIC
Tomas Mraz [Fri, 21 Apr 2023 15:19:27 +0000 (17:19 +0200)]
Do not send the empty renegotiation info SCSV in QUIC

There is no point in sending that when min_proto_version is >= TLS1_3_VERSION.
So we set that during SSL_CTX initialization and skip adding the SCSV.

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

12 months agoparam->ctrl translation: Fix evp_pkey_ctx_setget_params_to_ctrl()
Richard Levitte [Fri, 21 Apr 2023 04:00:47 +0000 (06:00 +0200)]
param->ctrl translation: Fix evp_pkey_ctx_setget_params_to_ctrl()

Ensure that ctx.ctrl_cmd defaults to translation->cmd_num

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

12 months agoparam->ctrl translation: Fix fix_ec_paramgen_curve_nid()
Richard Levitte [Thu, 20 Apr 2023 05:22:53 +0000 (07:22 +0200)]
param->ctrl translation: Fix fix_ec_paramgen_curve_nid()

This function didn't prepare space to get the param string, which causes
the default_fixup_args() call to fail.

Fixes #20161

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

12 months agoMinor fixups
Hugo Landau [Fri, 28 Apr 2023 14:48:44 +0000 (15:48 +0100)]
Minor fixups

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

12 months agoQUIC CC: Update CC design document
Hugo Landau [Wed, 26 Apr 2023 12:08:11 +0000 (13:08 +0100)]
QUIC CC: Update CC design document

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

12 months agoQUIC CHANNEL: Fix bug where time callback arg wasn't passed
Hugo Landau [Fri, 21 Apr 2023 10:19:18 +0000 (11:19 +0100)]
QUIC CHANNEL: Fix bug where time callback arg wasn't passed

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

12 months agoQUIC CC: Use OSSL_PARAM
Hugo Landau [Fri, 21 Apr 2023 09:56:48 +0000 (10:56 +0100)]
QUIC CC: Use OSSL_PARAM

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

12 months agoQUIC CC: Move dummy method to test code
Hugo Landau [Tue, 28 Mar 2023 07:21:25 +0000 (08:21 +0100)]
QUIC CC: Move dummy method to test code

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

12 months agoQUIC CC: Tweaks
Hugo Landau [Tue, 28 Mar 2023 07:00:53 +0000 (08:00 +0100)]
QUIC CC: Tweaks

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

12 months agoQUIC CC: Safe multiplication
Hugo Landau [Mon, 20 Mar 2023 16:43:38 +0000 (16:43 +0000)]
QUIC CC: Safe multiplication

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

12 months agoQUIC CC: Minor fixes
Hugo Landau [Thu, 2 Mar 2023 16:05:36 +0000 (16:05 +0000)]
QUIC CC: Minor fixes

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

12 months agoQUIC: Make QUIC_CHANNEL use newreno CC
Hugo Landau [Thu, 2 Mar 2023 16:04:34 +0000 (16:04 +0000)]
QUIC: Make QUIC_CHANNEL use newreno CC

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