Skip to content

Python: Two TLS 1.3 session tickets patch causes EPIPE #6342

@tiran

Description

@tiran

Commit 36ff232 changed session ticket handling in TLS 1.3. Before the change, one session ticket was transmitted. Now it's two session tickets.

The change is causing several CPython SSL tests to fail with BrokenPipeError: [Errno 32] Broken pipe. The error occurs on the server side during handshake. When I manually change the code to ret->num_tickets = 1, the tests are passing again. This is a regression from 1.1.1-pre6.

Backtrace for SIGPIPE:

Thread 3 "python" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7f4b21726700 (LWP 23663)]
0x00007f4b2e276ccb in write () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007f4b2e276ccb in write () from /lib64/libpthread.so.0
#1  0x00007f4b24f5b52f in sock_write (b=0x7f4b140441d0, in=0x7f4b14052b30 "\027\003\003", inl=248) at crypto/bio/bss_sock.c:114
#2  0x00007f4b24f54b60 in bwrite_conv (bio=0x7f4b140441d0, data=0x7f4b14052b30 "\027\003\003", datal=248, written=0x7f4b21724d60)
    at crypto/bio/bio_meth.c:77
#3  0x00007f4b24f53b10 in bio_write_intern (b=0x7f4b140441d0, data=0x7f4b14052b30, dlen=248, written=0x7f4b21724d60) at crypto/bio/bio_lib.c:343
#4  0x00007f4b24f53bc2 in BIO_write (b=0x7f4b140441d0, data=0x7f4b14052b30, dlen=248) at crypto/bio/bio_lib.c:363
#5  0x00007f4b24f5162e in buffer_ctrl (b=0x7f4b14051a30, cmd=11, num=0, ptr=0x0) at crypto/bio/bf_buff.c:367
#6  0x00007f4b24f5419f in BIO_ctrl (b=0x7f4b14051a30, cmd=11, larg=0, parg=0x0) at crypto/bio/bio_lib.c:528
#7  0x00007f4b2542612a in statem_flush (s=0x7f4b14042280) at ssl/statem/statem.c:897
#8  0x00007f4b25438704 in ossl_statem_server_post_work (s=0x7f4b14042280, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:939
#9  0x00007f4b25425fe8 in write_state_machine (s=0x7f4b14042280) at ssl/statem/statem.c:865
#10 0x00007f4b2542523b in state_machine (s=0x7f4b14042280, server=1) at ssl/statem/statem.c:437
#11 0x00007f4b25424d8e in ossl_statem_accept (s=0x7f4b14042280) at ssl/statem/statem.c:251
#12 0x00007f4b2540b566 in SSL_do_handshake (s=0x7f4b14042280) at ssl/ssl_lib.c:3565
#13 0x00007f4b25684e81 in _ssl__SSLSocket_do_handshake_impl (self=0x7f4b20844390) at /home/heimes/dev/python/cpython/Modules/_ssl.c:1007

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions