aboutsummaryrefslogtreecommitdiff
path: root/src/or/channeltls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-08 15:39:34 -0400
committerNick Mathewson <nickm@torproject.org>2015-05-28 10:41:50 -0400
commitb75361c5ed717cde787c1b4f36e8fb51ccfddc2b (patch)
treeab7eabd383a6b83ffcbdd6bf2f6e19d222ae4681 /src/or/channeltls.c
parentdf05e195ee64d7ed1b5a1b5d74c5868683788ba2 (diff)
downloadtor-b75361c5ed717cde787c1b4f36e8fb51ccfddc2b.tar.gz
tor-b75361c5ed717cde787c1b4f36e8fb51ccfddc2b.zip
Start testing cell encoders/processers for the v3 handshake.
An earlier version of these tests was broken; now they're a nicer, more robust, more black-box set of tests. The key is to have each test check a handshake message that is wrong in _one_ way.
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r--src/or/channeltls.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 10fcb281db..af7f474349 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -13,6 +13,8 @@
#define TOR_CHANNEL_INTERNAL_
+#define CHANNELTLS_PRIVATE
+
#include "or.h"
#include "channel.h"
#include "channeltls.h"
@@ -47,9 +49,6 @@ uint64_t stats_n_authorize_cells_processed = 0;
/** Active listener, if any */
channel_listener_t *channel_tls_listener = NULL;
-/* Utility function declarations */
-static void channel_tls_common_init(channel_tls_t *tlschan);
-
/* channel_tls_t method declarations */
static void channel_tls_close_method(channel_t *chan);
@@ -91,10 +90,6 @@ static void channel_tls_process_versions_cell(var_cell_t *cell,
channel_tls_t *tlschan);
static void channel_tls_process_netinfo_cell(cell_t *cell,
channel_tls_t *tlschan);
-static void channel_tls_process_certs_cell(var_cell_t *cell,
- channel_tls_t *tlschan);
-static void channel_tls_process_auth_challenge_cell(var_cell_t *cell,
- channel_tls_t *tlschan);
static void channel_tls_process_authenticate_cell(var_cell_t *cell,
channel_tls_t *tlschan);
static int command_allowed_before_handshake(uint8_t command);
@@ -106,7 +101,7 @@ static int enter_v3_handshake_with_cell(var_cell_t *cell,
* and channel_tls_handle_incoming().
*/
-static void
+STATIC void
channel_tls_common_init(channel_tls_t *tlschan)
{
channel_t *chan;
@@ -1744,7 +1739,7 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan)
* If it's the server side, wait for an AUTHENTICATE cell.
*/
-static void
+STATIC void
channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan)
{
tor_x509_cert_t *link_cert = NULL;
@@ -1946,7 +1941,7 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan)
* want to authenticate, send an AUTHENTICATE cell and then a NETINFO cell.
*/
-static void
+STATIC void
channel_tls_process_auth_challenge_cell(var_cell_t *cell, channel_tls_t *chan)
{
int n_types, i, use_type = -1;