-
Notifications
You must be signed in to change notification settings - Fork 24
handshake: support extracting record size limit value #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
RFC 8449 [1] Section 4 defines the record_size_limit TLS extension, which allows peers to negotiate a maximum plaintext record size during the TLS handshake. The value must be between 64 bytes and 16,384 bytes (2^14). If a TLS endpoint receives a record larger than its advertised limit, it must send a fatal record_overflow alert. This patch adds support for extracting the record size limit value from the gnutls session and passing it to the kernel. This is to be used by the kernel at the tls layer limit outgoing records to the maximum record size limit as specified by the endpoint. [1] https://www.rfc-editor.org/rfc/rfc8449#section-4 Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
e980a14
to
e8e6dfc
Compare
Two questions:
|
I have not sent out the kernel patches yet, I was waiting to see if the GnuTLS patches can be approved beforehand. Since all of this depends on that.
Ah I see, I will add that. Thanks! |
During a handshake, an endpoint may specify a maximum record size limit. Currently, the kernel defaults to TLS_MAX_PAYLOAD_SIZE (16KB), and any negotiated record size limit is ignored. If the negotiated size is lower than TLS_MAX_PAYLOAD_SIZE, and the kernel sends records larger, the TLS endpoint must send a fatal "record_overflow" alert [1], and thus the record is discarded. This patch adds support for retrieving the negotiated record size limit during a handshake, and enforcing it at the TLS layer such that outgoing records are no larger than the size negotiated. This patch depends on the respective userspace support in tlshd [2] and GnuTLS [3]. [1] https://www.rfc-editor.org/rfc/rfc8449 [2] oracle/ktls-utils#112 [3] https://gitlab.com/gnutls/gnutls/-/merge_requests/2005 Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
During a handshake, an endpoint may specify a maximum record size limit. Currently, the kernel defaults to TLS_MAX_PAYLOAD_SIZE (16KB), and any negotiated record size limit is ignored. If the negotiated size is lower than TLS_MAX_PAYLOAD_SIZE, and the kernel sends records larger, the TLS endpoint must send a fatal "record_overflow" alert [1], and thus the record is discarded. This patch adds support for retrieving the negotiated record size limit during a handshake, and enforcing it at the TLS layer such that outgoing records are no larger than the size negotiated. This patch depends on the respective userspace support in tlshd [2] and GnuTLS [3]. [1] https://www.rfc-editor.org/rfc/rfc8449 [2] oracle/ktls-utils#112 [3] https://gitlab.com/gnutls/gnutls/-/merge_requests/2005 Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
During a handshake, an endpoint may specify a maximum record size limit. Currently, the kernel defaults to TLS_MAX_PAYLOAD_SIZE (16KB) for the maximum record size. Meaning that, the outgoing records from the kernel can exceed a lower size negotiated during the handshake. In such a case, the TLS endpoint must send a fatal "record_overflow" alert [1], and thus the record is discarded. This patch adds support for retrieving the negotiated record size limit during a handshake, and enforcing it at the TLS layer such that outgoing records are no larger than the size negotiated. This patch depends on the respective userspace support in tlshd [2] and GnuTLS [3]. [1] https://www.rfc-editor.org/rfc/rfc8449 [2] oracle/ktls-utils#112 [3] https://gitlab.com/gnutls/gnutls/-/merge_requests/2005 Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
RFC 8449 [1] Section 4 defines the record_size_limit TLS extension, which allows peers to negotiate a maximum plaintext record size during the TLS handshake. The value must be between 64 bytes and 16,384 bytes (2^14). If a TLS endpoint receives a record larger than its advertised limit, it must send a fatal record_overflow alert.
This patch adds support for extracting the record size limit value from the gnutls session and passing it to the kernel. This is to be used by the kernel at the tls layer limit outgoing records to the maximum record size limit as specified by the endpoint.
Based on GnuTLS [2] and Kernel Integration [3].
[1] https://www.rfc-editor.org/rfc/rfc8449#section-4
[2] https://gitlab.com/gnutls/gnutls/-/merge_requests/1989
[3] https://github.com/twilfredo/spdm-linux/commits/wilfred/record-size-tls-test/