Skip to content
  • Thomas Huth's avatar
    chardev/char-socket: Fix TLS io channels sending too much data to the backend · 462945cd
    Thomas Huth authored
    Commit ffda5db6 ("io/channel-tls: fix handling of bigger read buffers")
    changed the behavior of the TLS io channels to schedule a second reading
    attempt if there is still incoming data pending. This caused a regression
    with backends like the sclpconsole that check in their read function that
    the sender does not try to write more bytes to it than the device can
    currently handle.
    
    The problem can be reproduced like this:
    
     1) In one terminal, do this:
    
      mkdir qemu-pki
      cd qemu-pki
      openssl genrsa 2048 > ca-key.pem
      openssl req -new -x509 -nodes -days 365000 -key ca-key.pem -out ca-cert.pem
      # enter some dummy value for the cert
      openssl genrsa 2048 > server-key.pem
      openssl req -new -x509 -nodes -days 365000 -key server-key.pem \
        -out server-cert.pem
      # enter some other dummy values for the cert
    
      gnutls-serv --echo --x509cafile ca-cert.pem --x509keyfile server-key.pem \
                  --x509certfile server-cert.pem ...
    462945cd