Skip to content

tlscontext: add workaround for a TLS 1.3 bug to prevent data loss#3082

Merged
lbudai merged 1 commit intosyslog-ng:masterfrom
MrAnno:data-loss-tls13
Jan 20, 2020
Merged

tlscontext: add workaround for a TLS 1.3 bug to prevent data loss#3082
lbudai merged 1 commit intosyslog-ng:masterfrom
MrAnno:data-loss-tls13

Conversation

@MrAnno
Copy link
Copy Markdown
Collaborator

@MrAnno MrAnno commented Jan 17, 2020

This is a workaround for an OpenSSL TLS 1.3 bug that results in data loss when one-way protocols are used and a connection is closed by the client right after sending data.

"TLS 1.3 session tickets make it impossible to reliably implement communication patterns where the server never sends application-level data."

SSL_CTX_set_num_tickets(0) disables TLS 1.3 session tickets (no session ticket will be sent to the client after a full handshake). Tickets are used for session resumption.

An alternative workaround would be doing a bidirectional SSL shutdown (finishing #2811), but syslog-ng is usually used together with other applications that may not take the bidi shutdown step (it is not mandatory, not even in RFC5425).

This is a workaround for an OpenSSL TLS 1.3 bug that results in data loss
when one-way protocols are used and a connection is closed by the client
right after sending data.

"TLS 1.3 session tickets makes it impossible to reliably implement
communication patterns where the server never sends application-level
data."

- openssl/openssl#10880
- openssl/openssl#7948

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
@MrAnno MrAnno added this to the syslog-ng-3.26 milestone Jan 17, 2020
@MrAnno
Copy link
Copy Markdown
Collaborator Author

MrAnno commented Jan 17, 2020

@kira-syslogng do perftest

@kira-syslogng
Copy link
Copy Markdown
Contributor

Build SUCCESS

@kira-syslogng
Copy link
Copy Markdown
Contributor

Kira-performance-test: Build SUCCESS

@furiel
Copy link
Copy Markdown
Collaborator

furiel commented Jan 20, 2020

I am not understanding the context entirely, just coming from the man page:

https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_num_tickets.html

The default number of tickets is 2; the default number of tickets sent following a resumption handshake is 1 but this cannot be changed using these functions. The number of tickets following a resumption handshake can be reduced to 0 using custom session ticket callbacks (see SSL_CTX_set_session_ticket_cb(3)).

Should this mean we need to have a SSL_CTX_set_session_ticket_cb somewhere as well?

@furiel
Copy link
Copy Markdown
Collaborator

furiel commented Jan 20, 2020

Never mind, probably not necessary. If tickets disabled, resumption cannot happen, therefore it does not matter how many tickets we send after resumption.

@furiel
Copy link
Copy Markdown
Collaborator

furiel commented Jan 20, 2020

Do we need to take care of loggen too? Inside open_ssl_connection in loggen_helper.c?

@furiel
Copy link
Copy Markdown
Collaborator

furiel commented Jan 20, 2020

Ok loggen is client only, so not affected.

@lbudai lbudai merged commit 26cc51b into syslog-ng:master Jan 20, 2020
MrAnno added a commit to MrAnno/syslog-ng that referenced this pull request Feb 24, 2020
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
alltilla pushed a commit to alltilla/syslog-ng that referenced this pull request Feb 25, 2020
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants