aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-01-13 00:20:47 +0000
committerNick Mathewson <nickm@torproject.org>2008-01-13 00:20:47 +0000
commitedf5e70784dc3519b656e12b9b7f7928fa85884a (patch)
tree243fc111ed3877a894e045508e1c0e84442164d8 /src/or/connection.c
parentae6df065ed699278db5a219650cd0037dac2adec (diff)
downloadtor-edf5e70784dc3519b656e12b9b7f7928fa85884a.tar.gz
tor-edf5e70784dc3519b656e12b9b7f7928fa85884a.zip
r15891@tombo: nickm | 2008-01-12 19:20:24 -0500
Basic hacks to get TLS handshakes working: remove dead code; fix post-handshake logic; keep servers from writing while the client is supposed to be renegotiating. This may work. Needs testing. svn:r13122
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 69b3f75360..757516c66f 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -90,7 +90,10 @@ conn_state_to_string(int type, int state)
case OR_CONN_STATE_PROXY_FLUSHING: return "proxy flushing";
case OR_CONN_STATE_PROXY_READING: return "proxy reading";
case OR_CONN_STATE_TLS_HANDSHAKING: return "handshaking (TLS)";
- case OR_CONN_STATE_TLS_RENEGOTIATING: return "renegotiating (TLS)";
+ case OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING:
+ return "renegotiating (TLS)";
+ case OR_CONN_STATE_TLS_SERVER_RENEGOTIATING:
+ return "waiting for renegotiation (TLS)";
case OR_CONN_STATE_OR_HANDSHAKING: return "handshaking (Tor)";
case OR_CONN_STATE_OPEN: return "open";
}
@@ -1896,7 +1899,7 @@ connection_read_to_buf(connection_t *conn, int *max_to_read)
int pending;
or_connection_t *or_conn = TO_OR_CONN(conn);
if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING ||
- conn->state == OR_CONN_STATE_TLS_RENEGOTIATING) {
+ conn->state == OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING) {
/* continue handshaking even if global token bucket is empty */
return connection_tls_continue_handshake(or_conn);
}
@@ -2118,7 +2121,7 @@ connection_handle_write(connection_t *conn, int force)
conn->state > OR_CONN_STATE_PROXY_READING) {
or_connection_t *or_conn = TO_OR_CONN(conn);
if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING ||
- conn->state == OR_CONN_STATE_TLS_RENEGOTIATING) {
+ conn->state == OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING) {
connection_stop_writing(conn);
if (connection_tls_continue_handshake(or_conn) < 0) {
/* Don't flush; connection is dead. */
@@ -2127,6 +2130,8 @@ connection_handle_write(connection_t *conn, int force)
return -1;
}
return 0;
+ } else if (conn->state == OR_CONN_STATE_TLS_SERVER_RENEGOTIATING) {
+ return connection_handle_read(conn);
}
/* else open, or closing */