1. 01 Aug, 2020 1 commit
    • Enrico Scholz's avatar
      wrap I/O operations and handle TLS errors · 1729c443
      Enrico Scholz authored
      avoid '#ifdef HAVE_LIBGNUTLS' blocks within the main code and move
      send/recv into dedicated functions.
      
      There, non-fatal TLS errors will be handled which seems to be
      required when speaking with TLS 1.3 servers (where _AGAIN is
      returned by gnutls_record_recv()).
      
      E.g. shortly after STARTTLS it happens here:
      
      | gsasl->gnutls_record_recv(0x1d48b90 <unfinished ...>
      |   libgnutls.so.30->recv(3, "\027\003\003", 5, 0)          = 5
      |   libgnutls.so.30->recv(3, "voJz~k"..., 250, 0)           = 250
      | <... gnutls_record_recv resumed> , "p\335\324\001", 1)    = -28 (GNUTLS_E_AGAIN)
      | gsasl->gnutls_record_recv(0x1d48b90 <unfinished ...>
      |   libgnutls.so.30->recv(3, "\027\003\003", 5, 0)          = 5
      |   libgnutls.so.30->recv(3, " H\274"..., 250, 0)           = 250
      | <... gnutls_record_recv resumed> , "p\335\324\001", 1)    = -28 (GNUTLS_E_AGAIN)
      | gsasl->gnutls_record_recv(0x1d48b90 <unfinished ...>
      |   libgnutls.so.30->recv(3, "\027\003"..., 5, 0)           = 5
      |   libgnutls.so.30->recv(3, "\036\033"..., 818, 0)         = 818
      | <... gnutls_record_recv resumed> , "*", 1)                = 1
      | gsasl->gnutls_record_recv(0x1d48b90, " ", 1)              = 1
      Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
      1729c443
  2. 31 Jul, 2020 5 commits
    • Enrico Scholz's avatar
      add --no-auth-output option · 6fc53c77
      Enrico Scholz authored
      Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
      6fc53c77
    • Enrico Scholz's avatar
      change poll() code to deal with buffered streams · f0fd875c
      Enrico Scholz authored
      As poll() was applied to file descriptors while rest of program used
      data structures which buffer read data (FILE, gnutls session), the
      poll() might block forever because already available data was not
      recognized by it.
      
      Patch integrates the previous getline() and gnutls buffering patches to
      emulate POLLIN on file descriptors where data has been buffered.
      Signed-off-by: default avatarEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
      f0fd875c
    • Enrico Scholz's avatar
      check whether gnutls session has buffered data · 21896d1a
      Enrico Scholz authored
      Code used a loop like
      
      | while (...) {
      |   poll([fd=<tls-fd>], ...);
      |   ...
      |   gnutls_record_recv(session, <buf>, <len>);
      
      It is possible, that gnutls_record_recv() receives more data from
      <tls-fd> than there can be copied to <buf> (e.g. when stream is
      compressed).  In this case, the poll() in the next loop will block
      because there is no data available from the socket, although a call from
      gnutls_record_recv() would return the buffered payload.
      
      Patch provides the infrastructure required by a later patch. It uses
      gnutls_record_check_pending() to check whether there is buffered data.
      Signed-off-by: default avatarEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
      21896d1a
    • Enrico Scholz's avatar
      use custom getline() implementation · 7a343123
      Enrico Scholz authored
      Code used getline() in a way like
      
      | while (...) {
      |   poll([fd=0], ...);
      |   ...
      |   getline(..., stdin);
      
      This causes problem when a getline() call consumes multiple lines of
      input. It returns only the first line (as by its definition), and
      buffers the remaining data.  In the next loop, poll() will block because
      it is not aware of the buffered data and waits for new one.
      
      Unfortunately, there is no portable way to check whether a FILE contains
      buffered data (and the poll() call should be skipped hence).
      
      Patch provides a custom getline() implementation which provides
      information about the buffer status.  There will be provided another
      patch which integrates these changes into the poll() code.
      Signed-off-by: default avatarEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
      7a343123
    • Simon Josefsson's avatar
      Sync 1.8.1 announcement. · cd7e07a7
      Simon Josefsson authored
      cd7e07a7
  3. 22 Jan, 2020 1 commit
  4. 20 Jan, 2020 24 commits
  5. 19 Jan, 2020 4 commits
  6. 16 Jan, 2020 1 commit
  7. 15 Jan, 2020 3 commits
  8. 14 Jan, 2020 1 commit