History log of /freebsd-current/crypto/openssl/ssl/record/ssl3_record.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# c085ca52 10-Oct-2021 Daiki Ueno <dueno@redhat.com>

KTLS: Handle TLS 1.3 in ssl3_get_record.

- Don't unpad records, check the outer record type, or extract the
inner record type from TLS 1.3 records handled by the kernel. KTLS
performs all of these steps and returns the inner record type in the
TLS header.

- When checking the length of a received TLS 1.3 record don't allow
for the extra byte for the nested record type when KTLS is used.

- Pass a pointer to the record type in the TLS header to the
SSL3_RT_INNER_CONTENT_TYPE message callback. For KTLS, the old
pointer pointed to the last byte of payload rather than the record
type. For the non-KTLS case, the TLS header has been updated with
the inner type before this callback is invoked.

Obtained from: OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624)


# 0fc28f22 07-Mar-2022 John Baldwin <jhb@FreeBSD.org>

KTLS: Add using_ktls helper variable in ssl3_get_record().

When KTLS receive is enabled, pending data may still be present due to
read ahead. This data must still be processed the same as records
received without KTLS. To ease readability (especially in
consideration of additional checks which will be added for TLS 1.3),
add a helper variable 'using_ktls' that is true when the KTLS receive
path is being used to receive a record.

Obtained from: OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399


# b077aed3 23-Jun-2023 Pierre Pronchery <pierre@freebsdfoundation.org>

Merge OpenSSL 3.0.9

Migrate to OpenSSL 3.0 in advance of FreeBSD 14.0. OpenSSL 1.1.1 (the
version we were previously using) will be EOL as of 2023-09-11.

Most of the base system has already been updated for a seamless switch
to OpenSSL 3.0. For many components we've added
`-DOPENSSL_API_COMPAT=0x10100000L` to CFLAGS to specify the API version,
which avoids deprecation warnings from OpenSSL 3.0. Changes have also
been made to avoid OpenSSL APIs that were already deprecated in OpenSSL
1.1.1. The process of updating to contemporary APIs can continue after
this merge.

Additional changes are still required for libarchive and Kerberos-
related libraries or tools; workarounds will immediately follow this
commit. Fixes are in progress in the upstream projects and will be
incorporated when those are next updated.

There are some performance regressions in benchmarks (certain tests in
`openssl speed`) and in some OpenSSL consumers in ports (e.g. haproxy).
Investigation will continue for these.

Netflix's testing showed no functional regression and a rather small,
albeit statistically significant, increase in CPU consumption with
OpenSSL 3.0.

Thanks to ngie@ and des@ for updating base system components, to
antoine@ and bofh@ for ports exp-runs and port fixes/workarounds, and to
Netflix and everyone who tested prior to commit or contributed to this
update in other ways.

PR: 271615
PR: 271656 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 83eaf7ae 21-Jun-2022 Jung-uk Kim <jkim@FreeBSD.org>

OpenSSL: Merge OpenSSL 1.1.1p

Merge commit '54ae8e38f717f22963c2a87f48af6ecefc6b3e9b'


# c0f977bf 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Handle TLS 1.3 in ssl3_get_record.

- Don't unpad records, check the outer record type, or extract the
inner record type from TLS 1.3 records handled by the kernel. KTLS
performs all of these steps and returns the inner record type in the
TLS header.

- When checking the length of a received TLS 1.3 record don't allow
for the extra byte for the nested record type when KTLS is used.

- Pass a pointer to the record type in the TLS header to the
SSL3_RT_INNER_CONTENT_TYPE message callback. For KTLS, the old
pointer pointed to the last byte of payload rather than the record
type. For the non-KTLS case, the TLS header has been updated with
the inner type before this callback is invoked.

Approved by: jkim
Obtained from: OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34975

# 4f1f9c55 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Add using_ktls helper variable in ssl3_get_record().

When KTLS receive is enabled, pending data may still be present due to
read ahead. This data must still be processed the same as records
received without KTLS. To ease readability (especially in
consideration of additional checks which will be added for TLS 1.3),
add a helper variable 'using_ktls' that is true when the KTLS receive
path is being used to receive a record.

Approved by: jkim
Obtained from: OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34974

# f6e5fcdc 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Cleanup record length checks for KTLS

In some corner cases the check for packets
which exceed the allowed record length was missing
when KTLS is initially enabled, when some
unprocessed packets are still pending.

Approved by: jkim
Obtained from: OpenSSL commit 8fff986d52606e1a33f9404504535e2e2aee3e8b
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34972

# b2bf0c7e 14-Dec-2021 Jung-uk Kim <jkim@FreeBSD.org>

OpenSSL: Merge OpenSSL 1.1.1m

Merge commit '56eae1b760adf10835560a9ee595549a1f10410f'

# 9a3ae0cd 31-Aug-2021 Jung-uk Kim <jkim@FreeBSD.org>

Import OpenSSL 1.1.1l

# aa906e2a 15-Jan-2021 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support. It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by: jkim (earlier version)
Approved by: secteam
Obtained from: OpenSSL (patches from master)
MFC after: 1 week
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28273

# 17f01e99 17-Mar-2020 Jung-uk Kim <jkim@FreeBSD.org>

Merge OpenSSL 1.1.1e.


# c9cf7b5c 20-Nov-2018 Jung-uk Kim <jkim@FreeBSD.org>

Merge OpenSSL 1.1.1a.


# e71b7053 13-Sep-2018 Jung-uk Kim <jkim@FreeBSD.org>

Update OpenSSL to 1.1.1.

Note it does not update build infrastructure.


# 83eaf7ae 21-Jun-2022 Jung-uk Kim <jkim@FreeBSD.org>

OpenSSL: Merge OpenSSL 1.1.1p

Merge commit '54ae8e38f717f22963c2a87f48af6ecefc6b3e9b'


# c0f977bf 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Handle TLS 1.3 in ssl3_get_record.

- Don't unpad records, check the outer record type, or extract the
inner record type from TLS 1.3 records handled by the kernel. KTLS
performs all of these steps and returns the inner record type in the
TLS header.

- When checking the length of a received TLS 1.3 record don't allow
for the extra byte for the nested record type when KTLS is used.

- Pass a pointer to the record type in the TLS header to the
SSL3_RT_INNER_CONTENT_TYPE message callback. For KTLS, the old
pointer pointed to the last byte of payload rather than the record
type. For the non-KTLS case, the TLS header has been updated with
the inner type before this callback is invoked.

Approved by: jkim
Obtained from: OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34975

# 4f1f9c55 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Add using_ktls helper variable in ssl3_get_record().

When KTLS receive is enabled, pending data may still be present due to
read ahead. This data must still be processed the same as records
received without KTLS. To ease readability (especially in
consideration of additional checks which will be added for TLS 1.3),
add a helper variable 'using_ktls' that is true when the KTLS receive
path is being used to receive a record.

Approved by: jkim
Obtained from: OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34974

# f6e5fcdc 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Cleanup record length checks for KTLS

In some corner cases the check for packets
which exceed the allowed record length was missing
when KTLS is initially enabled, when some
unprocessed packets are still pending.

Approved by: jkim
Obtained from: OpenSSL commit 8fff986d52606e1a33f9404504535e2e2aee3e8b
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34972

# b2bf0c7e 14-Dec-2021 Jung-uk Kim <jkim@FreeBSD.org>

OpenSSL: Merge OpenSSL 1.1.1m

Merge commit '56eae1b760adf10835560a9ee595549a1f10410f'

# 9a3ae0cd 31-Aug-2021 Jung-uk Kim <jkim@FreeBSD.org>

Import OpenSSL 1.1.1l

# aa906e2a 15-Jan-2021 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support. It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by: jkim (earlier version)
Approved by: secteam
Obtained from: OpenSSL (patches from master)
MFC after: 1 week
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28273

# 17f01e99 17-Mar-2020 Jung-uk Kim <jkim@FreeBSD.org>

Merge OpenSSL 1.1.1e.


# c9cf7b5c 20-Nov-2018 Jung-uk Kim <jkim@FreeBSD.org>

Merge OpenSSL 1.1.1a.


# e71b7053 13-Sep-2018 Jung-uk Kim <jkim@FreeBSD.org>

Update OpenSSL to 1.1.1.

Note it does not update build infrastructure.


# c0f977bf 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Handle TLS 1.3 in ssl3_get_record.

- Don't unpad records, check the outer record type, or extract the
inner record type from TLS 1.3 records handled by the kernel. KTLS
performs all of these steps and returns the inner record type in the
TLS header.

- When checking the length of a received TLS 1.3 record don't allow
for the extra byte for the nested record type when KTLS is used.

- Pass a pointer to the record type in the TLS header to the
SSL3_RT_INNER_CONTENT_TYPE message callback. For KTLS, the old
pointer pointed to the last byte of payload rather than the record
type. For the non-KTLS case, the TLS header has been updated with
the inner type before this callback is invoked.

Approved by: jkim
Obtained from: OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34975


# 4f1f9c55 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: KTLS: Add using_ktls helper variable in ssl3_get_record().

When KTLS receive is enabled, pending data may still be present due to
read ahead. This data must still be processed the same as records
received without KTLS. To ease readability (especially in
consideration of additional checks which will be added for TLS 1.3),
add a helper variable 'using_ktls' that is true when the KTLS receive
path is being used to receive a record.

Approved by: jkim
Obtained from: OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34974


# f6e5fcdc 04-May-2022 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Cleanup record length checks for KTLS

In some corner cases the check for packets
which exceed the allowed record length was missing
when KTLS is initially enabled, when some
unprocessed packets are still pending.

Approved by: jkim
Obtained from: OpenSSL commit 8fff986d52606e1a33f9404504535e2e2aee3e8b
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34972


# b2bf0c7e 14-Dec-2021 Jung-uk Kim <jkim@FreeBSD.org>

OpenSSL: Merge OpenSSL 1.1.1m

Merge commit '56eae1b760adf10835560a9ee595549a1f10410f'


# 9a3ae0cd 31-Aug-2021 Jung-uk Kim <jkim@FreeBSD.org>

Import OpenSSL 1.1.1l


# aa906e2a 15-Jan-2021 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support. It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by: jkim (earlier version)
Approved by: secteam
Obtained from: OpenSSL (patches from master)
MFC after: 1 week
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28273