View Issue Details

IDProjectCategoryView StatusLast Update
0000140LDMud 3.3Networkingpublic2005-05-15 13:03
Reporterfippo Assigned Tolars 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.3 
Summary0000140: TLS not working properly (episode 42)
DescriptionTLS does (still) not work properly when used without pthreads, attempting to read from the connection to early.
continue is needed after tls_continue_handshake regardless of what it returns.

(tested using OpenSSL and without pthreads)
 
--- comm.orig 2004-10-24 13:40:46.501532128 +0200
+++ comm.c 2004-10-24 13:46:11.440133952 +0200
@@ -2998,10 +2998,9 @@
             /* Special case for setting up a TLS connection: don't
              * attempt IO if the connection is still being set up.
              */
- if (ip->tls_status == TLS_HANDSHAKING
- && !tls_continue_handshake(ip)
- )
+ if (ip->tls_status == TLS_HANDSHAKING)
             {
+ tls_continue_handshake(ip);
                 continue;
             }
 #endif
TagsNo tags attached.
Attached Files
comm.c.diff (2,169 bytes)   
*** /mud/src/3-3/src/comm.c	2004-12-04 07:33:45.000000000 +0100
--- /mud/src/3-3-ff/src/comm.c	2004-12-19 10:07:31.000000000 +0100
***************
*** 2998,3007 ****
              /* Special case for setting up a TLS connection: don't
               * attempt IO if the connection is still being set up.
               */
!             if (ip->tls_status == TLS_HANDSHAKING
!              && !tls_continue_handshake(ip)
!                )
              {
                  continue;
              }
  #endif
--- 2998,3006 ----
              /* Special case for setting up a TLS connection: don't
               * attempt IO if the connection is still being set up.
               */
!             if (ip->tls_status == TLS_HANDSHAKING)
              {
+                 tls_continue_handshake(ip);
                  continue;
              }
  #endif
***************
*** 3339,3352 ****
                                      , (size_t)(length - ip->chars_ready), ip, MY_FALSE);
  #else
  #ifdef USE_TLS
!                         if (ip->tls_status == TLS_INACTIVE)
                              tls_write(ip, ip->text + ip->chars_ready
                                          , (size_t)(length - ip->chars_ready));
                          else
! #else
                            socket_write(ip->socket, ip->text + ip->chars_ready
                                        , (size_t)(length - ip->chars_ready));
- #endif /* USE_TLS */
  #endif
                          ip->chars_ready = length;
                      }
--- 3338,3350 ----
                                      , (size_t)(length - ip->chars_ready), ip, MY_FALSE);
  #else
  #ifdef USE_TLS
!                         if (ip->tls_status != TLS_INACTIVE)
                              tls_write(ip, ip->text + ip->chars_ready
                                          , (size_t)(length - ip->chars_ready));
                          else
! #endif /* USE_TLS */
                            socket_write(ip->socket, ip->text + ip->chars_ready
                                        , (size_t)(length - ip->chars_ready));
  #endif
                          ip->chars_ready = length;
                      }
comm.c.diff (2,169 bytes)   

Activities

peng

2004-12-23 11:56

reporter   ~0000275

Last edited: 2004-12-23 11:57

The above one and a small patch for another error included in the diff (against .635)

lars

2004-12-23 13:24

reporter   ~0000276

Implemented in 3.3.636.

Issue History

Date Modified Username Field Change
2004-11-01 04:42 fippo New Issue
2004-12-23 11:55 peng File Added: comm.c.diff
2004-12-23 11:56 peng Note Added: 0000275
2004-12-23 11:57 peng Note Edited: 0000275
2004-12-23 13:24 lars Status new => resolved
2004-12-23 13:24 lars Resolution open => fixed
2004-12-23 13:24 lars Assigned To => lars
2004-12-23 13:24 lars Note Added: 0000276
2005-05-15 13:03 lars Status resolved => closed