[tor-commits] [tor/master] Test failing cases of ed25519 authentication.
nickm at torproject.org
nickm at torproject.org
Thu Nov 3 13:18:59 UTC 2016
commit d4c57909f8578bb90e38573b873487be3ba759bd
Author: Nick Mathewson <nickm at torproject.org>
Date: Sun Sep 11 14:00:54 2016 -0400
Test failing cases of ed25519 authentication.
---
src/test/test_link_handshake.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index 04bfb5a..ba1c9b0 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -1395,8 +1395,25 @@ AUTHENTICATE_FAIL(badcontent,
"cell body was not as expected";
d->cell->payload[10] ^= 0xff)
AUTHENTICATE_FAIL(badsig_1,
- require_failure_message = "RSA signature wasn't valid";
+ if (d->is_ed)
+ require_failure_message = "Ed25519 signature wasn't valid";
+ else
+ require_failure_message = "RSA signature wasn't valid";
d->cell->payload[d->cell->payload_len - 5] ^= 0xff)
+AUTHENTICATE_FAIL(missing_ed_id,
+ {
+ tor_cert_free(d->c2->handshake_state->certs->ed_id_sign);
+ d->c2->handshake_state->certs->ed_id_sign = NULL;
+ require_failure_message = "Ed authenticate without Ed ID "
+ "cert from peer";
+ })
+AUTHENTICATE_FAIL(missing_ed_auth,
+ {
+ tor_cert_free(d->c2->handshake_state->certs->ed_sign_auth);
+ d->c2->handshake_state->certs->ed_sign_auth = NULL;
+ require_failure_message = "We never got an Ed25519 "
+ "authentication certificate";
+ })
#define TEST_RSA(name, flags) \
{ #name , test_link_handshake_ ## name, (flags), \
@@ -1514,6 +1531,9 @@ struct testcase_t link_handshake_tests[] = {
TEST_AUTHENTICATE(tooshort_1),
TEST_AUTHENTICATE(badcontent),
TEST_AUTHENTICATE(badsig_1),
+ TEST_AUTHENTICATE_ED(badsig_1),
+ TEST_AUTHENTICATE_ED(missing_ed_id),
+ TEST_AUTHENTICATE_ED(missing_ed_auth),
//TEST_AUTHENTICATE(),
END_OF_TESTCASES
More information about the tor-commits
mailing list