[tor-commits] [tor/master] Make bridges send AUTH_CHALLENGE cells

2013-08-24 Thread nickm
commit 940cef3367591fd1ee86971c202ef92aba931cb7
Author: Nick Mathewson 
Date:   Wed Aug 21 10:10:35 2013 -0400

Make bridges send AUTH_CHALLENGE cells

The spec requires them to do so, and not doing so creates a situation
where they can't send-test because relays won't extend to them because
of the other part of bug 9546.

Fixes bug 9546; bugfix on 0.2.3.6-alpha.
---
 bug9546|5 -
 changes/bug9546|   11 +++
 src/or/command.c   |4 ++--
 src/or/connection_or.c |2 +-
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/bug9546 b/bug9546
deleted file mode 100644
index 8596eac..000
--- a/bug9546
+++ /dev/null
@@ -1,5 +0,0 @@
-  o Major bugfixes:
-
-- When a relay is extending a circuit to a bridge, it needs to send a
-  NETINFO cell, even when the bridge hasn't sent an AUTH_CHALLENGE
-  cell. Fixes bug 9546; bugfix on .
diff --git a/changes/bug9546 b/changes/bug9546
new file mode 100644
index 000..2145e35
--- /dev/null
+++ b/changes/bug9546
@@ -0,0 +1,11 @@
+  o Major bugfixes:
+
+- When a relay is extending a circuit to a bridge, it needs to send a
+  NETINFO cell, even when the bridge hasn't sent an AUTH_CHALLENGE
+  cell. Fixes bug 9546; bugfix on 0.2.3.6-alpha.
+
+- Bridges send AUTH_CHALLENGE cells during their handshakes; previously
+  they did not, which prevented relays from successfully connecting
+  to a bridge for self-test or bandwidth testing. Fixes bug 9546;
+  bugfix on 0.2.3.6-alpha.
+
diff --git a/src/or/command.c b/src/or/command.c
index 26e4e68..61e1e13 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -755,8 +755,8 @@ command_process_versions_cell(var_cell_t *cell, 
or_connection_t *conn)
 const int send_versions = !started_here;
 /* If we want to authenticate, send a CERTS cell */
 const int send_certs = !started_here || public_server_mode(get_options());
-/* If we're a relay that got a connection, ask for authentication. */
-const int send_chall = !started_here && public_server_mode(get_options());
+/* If we're a host that got a connection, ask for authentication. */
+const int send_chall = !started_here;
 /* If our certs cell will authenticate us, we can send a netinfo cell
  * right now. */
 const int send_netinfo = !started_here;
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 56c6ed5..fbb7c31 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -2144,7 +2144,7 @@ 
connection_or_compute_authenticate_cell_body(or_connection_t *conn,
 const tor_cert_t *id_cert=NULL, *link_cert=NULL;
 const digests_t *my_digests, *their_digests;
 const uint8_t *my_id, *their_id, *client_id, *server_id;
-if (tor_tls_get_my_certs(0, &link_cert, &id_cert))
+if (tor_tls_get_my_certs(server, &link_cert, &id_cert))
   return -1;
 my_digests = tor_cert_get_id_digests(id_cert);
 their_digests = tor_cert_get_id_digests(conn->handshake_state->id_cert);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Make bridges send AUTH_CHALLENGE cells

2013-08-24 Thread nickm
commit cbc53a2d52a67e49e56ad9d8f5334ad623a59374
Author: Nick Mathewson 
Date:   Wed Aug 21 10:10:35 2013 -0400

Make bridges send AUTH_CHALLENGE cells

The spec requires them to do so, and not doing so creates a situation
where they can't send-test because relays won't extend to them because
of the other part of bug 9546.

Fixes bug 9546; bugfix on 0.2.3.6-alpha.
---
 changes/bug9546|8 +++-
 src/or/channeltls.c|4 ++--
 src/or/connection_or.c |2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/changes/bug9546 b/changes/bug9546
index 8596eac..2145e35 100644
--- a/changes/bug9546
+++ b/changes/bug9546
@@ -2,4 +2,10 @@
 
 - When a relay is extending a circuit to a bridge, it needs to send a
   NETINFO cell, even when the bridge hasn't sent an AUTH_CHALLENGE
-  cell. Fixes bug 9546; bugfix on .
+  cell. Fixes bug 9546; bugfix on 0.2.3.6-alpha.
+
+- Bridges send AUTH_CHALLENGE cells during their handshakes; previously
+  they did not, which prevented relays from successfully connecting
+  to a bridge for self-test or bandwidth testing. Fixes bug 9546;
+  bugfix on 0.2.3.6-alpha.
+
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index a7953e7..f751c0d 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -1262,8 +1262,8 @@ channel_tls_process_versions_cell(var_cell_t *cell, 
channel_tls_t *chan)
 const int send_versions = !started_here;
 /* If we want to authenticate, send a CERTS cell */
 const int send_certs = !started_here || public_server_mode(get_options());
-/* If we're a relay that got a connection, ask for authentication. */
-const int send_chall = !started_here && public_server_mode(get_options());
+/* If we're a host that got a connection, ask for authentication. */
+const int send_chall = !started_here;
 /* If our certs cell will authenticate us, we can send a netinfo cell
  * right now. */
 const int send_netinfo = !started_here;
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 31cc9c7..d5dd447 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -2218,7 +2218,7 @@ 
connection_or_compute_authenticate_cell_body(or_connection_t *conn,
 const tor_cert_t *id_cert=NULL, *link_cert=NULL;
 const digests_t *my_digests, *their_digests;
 const uint8_t *my_id, *their_id, *client_id, *server_id;
-if (tor_tls_get_my_certs(0, &link_cert, &id_cert))
+if (tor_tls_get_my_certs(server, &link_cert, &id_cert))
   return -1;
 my_digests = tor_cert_get_id_digests(id_cert);
 their_digests = tor_cert_get_id_digests(conn->handshake_state->id_cert);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits