[openssl/openssl] 14e314: Add the ability to mutate QUIC packets before they...

Matt Caswell noreply at github.com
Wed Feb 22 05:41:48 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 14e314093943ffd89633746179c2c8f0b5c631a4
      https://github.com/openssl/openssl/commit/14e314093943ffd89633746179c2c8f0b5c631a4
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_channel.h
    M include/internal/quic_record_tx.h
    M include/internal/quic_tserver.h
    M ssl/quic/quic_channel.c
    M ssl/quic/quic_record_tx.c
    M ssl/quic/quic_tserver.c

  Log Message:
  -----------
  Add the ability to mutate QUIC packets before they are written

We add callbacks so that QUIC packets can be modified by the test
framework before they are encrypted and written to the network. This
enables us to simulate badly behaving endpoints.

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


  Commit: adef87a2c6a0136aa3d965162932f961daf28411
      https://github.com/openssl/openssl/commit/adef87a2c6a0136aa3d965162932f961daf28411
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_tserver.h
    M ssl/quic/quic_tserver.c
    M test/build.info
    A test/helpers/quictestlib.c
    A test/helpers/quictestlib.h
    A test/quicfaultstest.c
    A test/recipes/90-test_quicfaults.t

  Log Message:
  -----------
  Add a skeleton quicfaultstest

Also includes helper support to create a QUIC connection inside a test.

We wil use quicfaultstest to deliberately inject faulty datagrams/packets
to test how we handle them.

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


  Commit: 2f1d8f858decda2d604abf3347c8e17237f90387
      https://github.com/openssl/openssl/commit/2f1d8f858decda2d604abf3347c8e17237f90387
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Implement the QUIC Fault injector support for plaintext packets

Provider helper functions to listen for plaintext packets being sent, as
well as the ability to change the contents of those packets as well as
resizing them.

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


  Commit: 3f968ecf479ed6ab8a2b25bd1077300baf2287a7
      https://github.com/openssl/openssl/commit/3f968ecf479ed6ab8a2b25bd1077300baf2287a7
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M crypto/bio/bss_dgram_pair.c

  Log Message:
  -----------
  Don't raise an error on retryable read in a BIO_s_dgram_pair()

This results in spurious errors appearing on the queue in normal
operation, e.g. calling SSL_tick() with a QUIC connection will succeed,
but an error will end up on the queue anyway.

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


  Commit: ce3106baba7601bfaf1d1412221e18dec4878e18
      https://github.com/openssl/openssl/commit/ce3106baba7601bfaf1d1412221e18dec4878e18
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M ssl/quic/quic_rx_depack.c

  Log Message:
  -----------
  Treat unknown frames as a protocol error

>From RFC9000, section 19.21 "An extension to QUIC that wishes to use a new
type of frame MUST first ensure that a peer is able to understand the
frame". So if we receive an unknown frame type from a peer we should treat
it as a protocol violation. In fact we ignore it, and ignore all the
contents of the rest of the packet and continue on regardless.

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


  Commit: 149a8e6c0a279b0dbbced72ffa6c5ed870a1bbc0
      https://github.com/openssl/openssl/commit/149a8e6c0a279b0dbbced72ffa6c5ed870a1bbc0
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_channel.h
    M include/internal/quic_tserver.h
    M ssl/quic/quic_channel.c
    M ssl/quic/quic_channel_local.h
    M ssl/quic/quic_impl.c
    M ssl/quic/quic_tserver.c
    M test/helpers/quictestlib.c

  Log Message:
  -----------
  Enable QUIC test server to find out the termination reason

We enable querying of the termination reason which is useful for tests.

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


  Commit: 71587f2b6a711bc8cd18521575910291f637dfcf
      https://github.com/openssl/openssl/commit/71587f2b6a711bc8cd18521575910291f637dfcf
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/quicfaultstest.c

  Log Message:
  -----------
  Add a test where an unknown frame type is received

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


  Commit: d03fe5de8d1b78dd8190a9bce04bb228719b9947
      https://github.com/openssl/openssl/commit/d03fe5de8d1b78dd8190a9bce04bb228719b9947
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_channel.h
    M include/internal/quic_tserver.h
    A include/internal/statem.h
    M ssl/quic/quic_channel.c
    M ssl/quic/quic_tserver.c
    M ssl/ssl_local.h
    R ssl/statem/statem.h
    M ssl/statem/statem_lib.c
    M test/helpers/quictestlib.c

  Log Message:
  -----------
  Add the ability to mutate TLS handshake messages before they are written

We add callbacks so that TLS handshake messages can be modified by the test
framework before they are passed to the handshake hash, possibly encrypted
and written to the network. This enables us to simulate badly behaving
endpoints.

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


  Commit: 6d1f6933595ea66c2e8367fef01e2824b4f3ce6b
      https://github.com/openssl/openssl/commit/6d1f6933595ea66c2e8367fef01e2824b4f3ce6b
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/statem.h
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Implement the QUIC Fault injector support for TLS handshake messages

Provide helper functions to listen for TLS handshake messages being sent,
as well as the ability to change the contents of those messages as well as
resizing them.

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


  Commit: f10e5885f01582c449eff8df70b61c916d9224cf
      https://github.com/openssl/openssl/commit/f10e5885f01582c449eff8df70b61c916d9224cf
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_tserver.h
    M ssl/quic/quic_tls.c
    M ssl/quic/quic_tserver.c
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h
    M test/quicfaultstest.c

  Log Message:
  -----------
  Add a test for a server that doesn't provide transport params

Check that we fail if the server has failed to provide transport params.

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


  Commit: 62d0da12e397811e26be5b5be8a1cfe54de5031e
      https://github.com/openssl/openssl/commit/62d0da12e397811e26be5b5be8a1cfe54de5031e
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M ssl/quic/quic_channel.c

  Log Message:
  -----------
  Raise a protocol error if we have not received transport params from peer

If we complete the TLS handshake but transport params were not received
then this is a protcol error and we should fail.

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


  Commit: da81f1e563c80a1d4ab82e545f3f5ba6e715267e
      https://github.com/openssl/openssl/commit/da81f1e563c80a1d4ab82e545f3f5ba6e715267e
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.h
    M test/quicfaultstest.c

  Log Message:
  -----------
  Expand some comments in the header file

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


  Commit: de60deb258c4b52502da372a61344b83428fc970
      https://github.com/openssl/openssl/commit/de60deb258c4b52502da372a61344b83428fc970
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Enable the fault injector to add faults to post-encryption packets

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


  Commit: be5b3b3787271d6b9057639ce42145fc66c11732
      https://github.com/openssl/openssl/commit/be5b3b3787271d6b9057639ce42145fc66c11732
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/quicfaultstest.c

  Log Message:
  -----------
  Add a test for a corrupted packet

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


  Commit: ce8f20b6ae8f95493d86ed2f521ad2c371974f45
      https://github.com/openssl/openssl/commit/ce8f20b6ae8f95493d86ed2f521ad2c371974f45
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_channel.h
    M include/internal/quic_tserver.h
    M ssl/quic/quic_channel.c
    M ssl/quic/quic_tserver.c
    M test/helpers/quictestlib.c

  Log Message:
  -----------
  Don't treat the Tserver as connected until the handshake is confirmed

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


  Commit: e4cb6583efa11decfa8d4d539c6cc2f08c99a067
      https://github.com/openssl/openssl/commit/e4cb6583efa11decfa8d4d539c6cc2f08c99a067
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Add the capability to listen for datagrams

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


  Commit: 6a9ab9bc6879b11110183704ca6364bafe794764
      https://github.com/openssl/openssl/commit/6a9ab9bc6879b11110183704ca6364bafe794764
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/quicfaultstest.c

  Log Message:
  -----------
  Extend the corruption test to truncate a datagram

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


  Commit: c88de5607829f8d98427ba3fa3d465c4e66e07fb
      https://github.com/openssl/openssl/commit/c88de5607829f8d98427ba3fa3d465c4e66e07fb
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Add a qtest_check_server_transport_err helper function

Allows tests to check that a given transport error was received by the
server.

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


  Commit: 47d905fdc635dcf92a2de4d1d4eb4cb47a4adcec
      https://github.com/openssl/openssl/commit/47d905fdc635dcf92a2de4d1d4eb4cb47a4adcec
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.h

  Log Message:
  -----------
  Add explanatory comments to say what happens during resizing of buffers

Explain that buffers are over allocated to being with, so a resize is a
logical resize only. Buffer addresses never change.

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


  Commit: 7eaaaaaa559d56edc9732d768dc374a4f829b187
      https://github.com/openssl/openssl/commit/7eaaaaaa559d56edc9732d768dc374a4f829b187
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h
    M test/quicfaultstest.c

  Log Message:
  -----------
  Add a helper function to prepend a frame to a packet

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


  Commit: 533390e46f8e2ea55d66d35fd54e724c2fb77571
      https://github.com/openssl/openssl/commit/533390e46f8e2ea55d66d35fd54e724c2fb77571
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M crypto/bio/bss_dgram_pair.c

  Log Message:
  -----------
  Ensure calling BIO_recvmmsg() with a dgram pair reports errors

When calling BIO-recvmmsg() and using a dgram pair we were failing to
raise an error in the case that a problem occurs. This means that the
reason behind a failure cannot be detected and all problems are treated
as fatal even if they may not be.

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


  Commit: d6cf4b59a0f3c32d61828ee82c193494e13ff969
      https://github.com/openssl/openssl/commit/d6cf4b59a0f3c32d61828ee82c193494e13ff969
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M ssl/record/record.h
    M ssl/ssl_local.h

  Log Message:
  -----------
  Don't declare SSL_CONNECTION twice

It causes problems with some compilation options

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


  Commit: c12e11133625569f5b92a2a78486ecb70cd23df7
      https://github.com/openssl/openssl/commit/c12e11133625569f5b92a2a78486ecb70cd23df7
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_channel.h
    M include/internal/quic_tserver.h
    M ssl/quic/quic_channel.c
    M ssl/quic/quic_impl.c
    M ssl/quic/quic_tserver.c
    M test/helpers/quictestlib.c
    M test/helpers/quictestlib.h
    M test/quicfaultstest.c

  Log Message:
  -----------
  Rename various functions OSSL_QUIC_FAULT -> QTEST_FAULT

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


  Commit: 45bb98bfa223efd3258f445ad443f878011450f0
      https://github.com/openssl/openssl/commit/45bb98bfa223efd3258f445ad443f878011450f0
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M include/internal/quic_tserver.h
    M ssl/quic/quic_tserver.c

  Log Message:
  -----------
  Add const to some test tserver functions

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


Compare: https://github.com/openssl/openssl/compare/fdd4716dd61e...45bb98bfa223


More information about the openssl-commits mailing list