aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-06-05 15:51:11 -0400
committerNick Mathewson <nickm@torproject.org>2017-06-05 15:51:11 -0400
commit91f49bc0f0759d0e0a794fbfe8cce5a9bb07e607 (patch)
treec1f8700691b13fd3a1f343ae9b2db68cd31d32e7 /src/or/connection_or.c
parentd5acdadaeffa8e1c61abef5881e9cc6e42d9a755 (diff)
downloadtor-91f49bc0f0759d0e0a794fbfe8cce5a9bb07e607.tar.gz
tor-91f49bc0f0759d0e0a794fbfe8cce5a9bb07e607.zip
Fix unit tests to work after own_link_cert assertion
The assert_nonfatal() I had added was triggered by some of the code that tested the pre-ed case of CERTS cell generation.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 1e2d731f53..6eb62a99de 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -2270,6 +2270,12 @@ add_ed25519_cert(certs_cell_t *certs_cell,
cert->encoded, cert->encoded_len);
}
+#ifdef TOR_UNIT_TESTS
+int certs_cell_ed25519_disabled_for_testing = 0;
+#else
+#define certs_cell_ed25519_disabled_for_testing 0
+#endif
+
/** Send a CERTS cell on the connection <b>conn</b>. Return 0 on success, -1
* on failure. */
int
@@ -2320,7 +2326,8 @@ connection_or_send_certs_cell(or_connection_t *conn)
CERTTYPE_ED_ID_SIGN,
get_master_signing_key_cert());
if (conn_in_server_mode) {
- tor_assert_nonfatal(conn->handshake_state->own_link_cert);
+ tor_assert_nonfatal(conn->handshake_state->own_link_cert ||
+ certs_cell_ed25519_disabled_for_testing);
add_ed25519_cert(certs_cell,
CERTTYPE_ED_SIGN_LINK,
conn->handshake_state->own_link_cert);