diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-05-21 14:28:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 08:37:22 -0400 |
commit | 348b90a915a5867bc0d8888e0fd12e8ec2319628 (patch) | |
tree | 3c42aaa4ea9eef11eedfdcd62bf023628e2f9a85 /src/test/test_link_handshake.c | |
parent | e94f1b4e0d4b31ed80e2eefb8700f2671817f561 (diff) | |
download | tor-348b90a915a5867bc0d8888e0fd12e8ec2319628.tar.gz tor-348b90a915a5867bc0d8888e0fd12e8ec2319628.zip |
Refactor RSA certificate checking into its own function.
Diffstat (limited to 'src/test/test_link_handshake.c')
-rw-r--r-- | src/test/test_link_handshake.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c index 3314880785..91c6299b4a 100644 --- a/src/test/test_link_handshake.c +++ b/src/test/test_link_handshake.c @@ -315,6 +315,7 @@ test_link_handshake_recv_certs_ok_server(void *arg) { certs_data_t *d = arg; d->c->handshake_state->started_here = 0; + d->c->handshake_state->certs->started_here = 0; certs_cell_get_certs(d->ccell, 0)->cert_type = 3; certs_cell_get_certs(d->ccell, 1)->cert_type = 2; ssize_t n = certs_cell_encode(d->cell->payload, 2048, d->ccell); @@ -450,17 +451,21 @@ CERTS_FAIL(server_missing_certs, { require_failure_message = "The certs we wanted were missing"; d->c->handshake_state->started_here = 0; + d->c->handshake_state->certs->started_here = 0; + }) CERTS_FAIL(server_wrong_labels_1, { require_failure_message = "The authentication certificate was not valid"; d->c->handshake_state->started_here = 0; + d->c->handshake_state->certs->started_here = 0; certs_cell_get_certs(d->ccell, 0)->cert_type = 2; certs_cell_get_certs(d->ccell, 1)->cert_type = 3; REENCODE(); }) + static void test_link_handshake_send_authchallenge(void *arg) { @@ -637,7 +642,8 @@ AUTHCHALLENGE_FAIL(badproto, AUTHCHALLENGE_FAIL(as_server, require_failure_message = "We didn't originate this " "connection"; - d->c->handshake_state->started_here = 0;) + d->c->handshake_state->started_here = 0; + d->c->handshake_state->certs->started_here = 0;) AUTHCHALLENGE_FAIL(duplicate, require_failure_message = "We already received one"; d->c->handshake_state->received_auth_challenge = 1) @@ -874,7 +880,8 @@ AUTHENTICATE_FAIL(badproto, d->c2->link_proto = 2) AUTHENTICATE_FAIL(atclient, require_failure_message = "We originated this connection"; - d->c2->handshake_state->started_here = 1) + d->c2->handshake_state->started_here = 1; + d->c2->handshake_state->certs->started_here = 1;) AUTHENTICATE_FAIL(duplicate, require_failure_message = "We already got one"; d->c2->handshake_state->received_authenticate = 1) |