diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-08 15:39:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-05-28 10:41:50 -0400 |
commit | b75361c5ed717cde787c1b4f36e8fb51ccfddc2b (patch) | |
tree | ab7eabd383a6b83ffcbdd6bf2f6e19d222ae4681 /src/or/connection_or.c | |
parent | df05e195ee64d7ed1b5a1b5d74c5868683788ba2 (diff) | |
download | tor-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/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 4ab47f0aa8..8602bcbcf4 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -1318,8 +1318,8 @@ connection_or_close_normally(or_connection_t *orconn, int flush) * the error state. */ -void -connection_or_close_for_error(or_connection_t *orconn, int flush) +MOCK_IMPL(void, +connection_or_close_for_error,(or_connection_t *orconn, int flush)) { channel_t *chan = NULL; @@ -2012,9 +2012,9 @@ connection_or_write_cell_to_buf(const cell_t *cell, or_connection_t *conn) * <b>conn</b>'s outbuf. Right now, this <em>DOES NOT</em> support cells that * affect a circuit. */ -void -connection_or_write_var_cell_to_buf(const var_cell_t *cell, - or_connection_t *conn) +MOCK_IMPL(void, +connection_or_write_var_cell_to_buf,(const var_cell_t *cell, + or_connection_t *conn)) { int n; char hdr[VAR_CELL_MAX_HEADER_SIZE]; @@ -2157,8 +2157,8 @@ connection_or_send_versions(or_connection_t *conn, int v3_plus) /** Send a NETINFO cell on <b>conn</b>, telling the other server what we know * about their address, our address, and the current time. */ -int -connection_or_send_netinfo(or_connection_t *conn) +MOCK_IMPL(int, +connection_or_send_netinfo,(or_connection_t *conn)) { cell_t cell; time_t now = time(NULL); @@ -2443,8 +2443,8 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, /** Send an AUTHENTICATE cell on the connection <b>conn</b>. Return 0 on * success, -1 on failure */ -int -connection_or_send_authenticate_cell(or_connection_t *conn, int authtype) +MOCK_IMPL(int, +connection_or_send_authenticate_cell,(or_connection_t *conn, int authtype)) { var_cell_t *cell; crypto_pk_t *pk = tor_tls_get_my_client_auth_key(); |