netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] tls: implement key updates for TLS1.3
@ 2023-01-17 13:45 Sabrina Dubroca
  2023-01-17 13:45 ` [PATCH net-next 1/5] tls: remove tls_context argument from tls_set_sw_offload Sabrina Dubroca
                   ` (5 more replies)
  0 siblings, 6 replies; 32+ messages in thread
From: Sabrina Dubroca @ 2023-01-17 13:45 UTC (permalink / raw)
  To: netdev; +Cc: Frantisek Krenzelok, Sabrina Dubroca

This adds support for receiving KeyUpdate messages (RFC 8446, 4.6.3
[1]). A sender transmits a KeyUpdate message and then changes its TX
key. The receiver should react by updating its RX key before
processing the next message.

This patchset implements key updates by:
 1. pausing decryption when a KeyUpdate message is received, to avoid
    attempting to use the old key to decrypt a record encrypted with
    the new key
 2. returning -EKEYEXPIRED to syscalls that cannot receive the
    KeyUpdate message, until the rekey has been performed by userspace
 3. passing the KeyUpdate message to userspace as a control message
 4. allowing updates of the crypto_info via the TLS_TX/TLS_RX
    setsockopts

This API has been tested with gnutls to make sure that it allows
userspace libraries to implement key updates [2]. Thanks to Frantisek
Krenzelok <fkrenzel@redhat.com> for providing the implementation in
gnutls and testing the kernel patches.

Note: in a future series, I'll clean up tls_set_sw_offload and
eliminate the per-cipher copy-paste using tls_cipher_size_desc.

[1] https://www.rfc-editor.org/rfc/rfc8446#section-4.6.3
[2] https://gitlab.com/gnutls/gnutls/-/merge_requests/1625

Sabrina Dubroca (5):
  tls: remove tls_context argument from tls_set_sw_offload
  tls: block decryption when a rekey is pending
  tls: implement rekey for TLS1.3
  selftests: tls: add key_generation argument to tls_crypto_info_init
  selftests: tls: add rekey tests

 include/net/tls.h                 |   4 +
 net/tls/tls.h                     |   3 +-
 net/tls/tls_device.c              |   2 +-
 net/tls/tls_main.c                |  32 +++-
 net/tls/tls_sw.c                  | 169 +++++++++++++++----
 tools/testing/selftests/net/tls.c | 272 +++++++++++++++++++++++++++++-
 6 files changed, 434 insertions(+), 48 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2023-01-25 23:53 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 13:45 [PATCH net-next 0/5] tls: implement key updates for TLS1.3 Sabrina Dubroca
2023-01-17 13:45 ` [PATCH net-next 1/5] tls: remove tls_context argument from tls_set_sw_offload Sabrina Dubroca
2023-01-18 23:12   ` Vadim Fedorenko
2023-01-17 13:45 ` [PATCH net-next 2/5] tls: block decryption when a rekey is pending Sabrina Dubroca
2023-01-19  2:10   ` [PATCH net-next 0/5] tls: implement key updates for TLS1.3 Apoorv Kothari
2023-01-17 13:45 ` [PATCH net-next 3/5] tls: implement rekey " Sabrina Dubroca
2023-01-17 23:16   ` Kuniyuki Iwashima
2023-01-18 10:38     ` Sabrina Dubroca
2023-01-19  1:25       ` Apoorv Kothari
2023-01-19 15:16         ` Sabrina Dubroca
2023-01-18 23:10   ` Vadim Fedorenko
2023-01-19 15:14     ` Sabrina Dubroca
2023-01-17 13:45 ` [PATCH net-next 4/5] selftests: tls: add key_generation argument to tls_crypto_info_init Sabrina Dubroca
2023-01-17 13:45 ` [PATCH net-next 5/5] selftests: tls: add rekey tests Sabrina Dubroca
2023-01-20  6:51   ` Apoorv Kothari
2023-01-18  2:03 ` [PATCH net-next 0/5] tls: implement key updates for TLS1.3 Jakub Kicinski
2023-01-18 10:06   ` Sabrina Dubroca
2023-01-19  2:55     ` Jakub Kicinski
2023-01-19  9:27       ` Gal Pressman
2023-01-23 10:13         ` Boris Pismenny
2023-01-24 15:56           ` Sabrina Dubroca
2023-01-25 18:47             ` Apoorv Kothari
2023-01-25 18:57               ` Jakub Kicinski
2023-01-25 21:17                 ` Simo Sorce
2023-01-25 22:43                   ` Jakub Kicinski
2023-01-25 23:05                     ` Simo Sorce
2023-01-25 23:08                       ` Jakub Kicinski
2023-01-25 23:52                         ` Simo Sorce
2023-01-19 15:40       ` Sabrina Dubroca
2023-01-19 17:00         ` Jakub Kicinski
2023-01-19 20:51         ` Apoorv Kothari
2023-01-20  1:37       ` Vadim Fedorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).