View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000054 | LDMud 3.3 | Runtime | public | 2004-04-27 11:53 | 2004-07-01 22:23 |
| Reporter | lynx | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Summary | 0000054: TLS doesn't work without pthreads | ||||
| Description | when compiling the driver with gnutls and without pthreads, tls_init_connection throws a tls_error that says: "Function was interrupted." Everything works when using pthreads, but pthreads may not be safe. | ||||
| Tags | No tags attached. | ||||
|
|
http://www.gnu.org/software/gnutls/documentation/gnutls/gnutls.html#gnutls_handshake The non-fatal errors such as GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED interrupt the handshake procedure, which should be later be resumed. Call this function again, until it returns 0 See attached patch. configure-skript seems to auto-add pthreads dependency for ssl. I guess because of this bug. Would be nice if you removed that. lg |
|
|
mh... unintuitive file upload... as its a threeliner (pkg-tls.c) 566c566,568 < ret = gnutls_handshake(ip->tls_session); --- > do { > ret = gnutls_handshake(ip->tls_session); > } while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED); |
|
|
Looks like openssl has the same problem (line 548) http://www.openssl.org/docs/ssl/SSL_do_handshake.html being called only once. |
|
|
Ok, so fippo fixed gnutls to run without pthreads. Very cool. Now out of perfectionism let's try to get openssl to work. Whenever we connect by SSL it aborts with this message: error:00000001::lib(0) :func(0) :reason(1) I tried some changes that may fix the handshaking, but so far the behaviour has not changed. Here's my change: do { if ((n = SSL_do_handshake(session)) < 0) ret = - SSL_get_error(session, n); else ret = 0; } while (ret == SSL_ERROR_WANT_READ || ret == SSL_ERROR_WANT_WRITE); if (n < 0) { SSL_free(session); break; } The documentation mentions something wanting to be read or written, but we have nothing to read or write.. do we? edited on: 04-27-04 17:43 |
|
|
Thanks for the analysis! I have implemented both the GnuTLS as well as the OpenSSL patch in 3.3.536. The reason why the original OpenSSL patch didn't work was probably because 'ret' was assigned the negated error code, but then compared to the un-negated error code constant - my implementation fixed that. I couldn't reproduce the TLS->pthreads dependency in configure, and looking at the configure code I don't see one either. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2004-04-27 11:53 | lynx | New Issue | |
| 2004-04-27 13:15 | fippo | Note Added: 0000052 | |
| 2004-04-27 13:21 | fippo | Note Added: 0000053 | |
| 2004-04-27 14:08 | fippo | Note Added: 0000054 | |
| 2004-04-27 15:42 | lynx | Note Added: 0000056 | |
| 2004-04-27 15:43 | lynx | Note Edited: 0000056 | |
| 2004-04-28 22:14 |
|
Status | new => resolved |
| 2004-04-28 22:14 |
|
Resolution | open => fixed |
| 2004-04-28 22:14 |
|
Assigned To | => lars |
| 2004-04-28 22:14 |
|
Note Added: 0000057 | |
| 2004-07-01 22:23 |
|
Status | resolved => closed |