[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Add a few more debug/info-level logs for ed25519 link handshake stuff



commit e0ab293837c76ee95b8b94f461aefe0f1ac6eff0
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Nov 10 12:55:42 2016 -0500

    Add a few more debug/info-level logs for ed25519 link handshake stuff
---
 src/or/channeltls.c    | 14 ++++++++++++--
 src/or/connection_or.c |  8 ++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index fafa08c..aef0143 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -1993,12 +1993,15 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan)
              checked_ed_id, sizeof(ed25519_public_key_t));
     }
 
+    log_debug(LD_HANDSHAKE, "calling client_learned_peer_id from "
+              "process_certs_cell");
+
     if (connection_or_client_learned_peer_id(chan->conn,
                   chan->conn->handshake_state->authenticated_rsa_peer_id,
                   checked_ed_id) < 0)
       ERR("Problem setting or checking peer id");
 
-    log_info(LD_OR,
+    log_info(LD_HANDSHAKE,
              "Got some good certificates from %s:%d: Authenticated it with "
              "RSA%s",
              safe_str(chan->conn->base_.address), chan->conn->base_.port,
@@ -2334,6 +2337,13 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan)
                chan->conn->link_proto < MIN_LINK_PROTO_FOR_WIDE_CIRC_IDS);
     crypto_pk_free(identity_rcvd);
 
+    log_debug(LD_HANDSHAKE,
+              "Calling connection_or_init_conn_from_address for %s "
+              " from %s, with%s ed25519 id.",
+              safe_str(chan->conn->base_.address),
+              __func__,
+              ed_identity_received ? "" : "out");
+
     connection_or_init_conn_from_address(chan->conn,
                   &(chan->conn->base_.addr),
                   chan->conn->base_.port,
@@ -2342,7 +2352,7 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan)
                   ed_identity_received,
                   0);
 
-    log_info(LD_OR,
+    log_debug(LD_HANDSHAKE,
              "Got an AUTHENTICATE cell from %s:%d, type %d: Looks good.",
              safe_str(chan->conn->base_.address),
              chan->conn->base_.port,
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 0caf8a9..e10eaaf 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -831,6 +831,12 @@ connection_or_init_conn_from_address(or_connection_t *conn,
                                      const ed25519_public_key_t *ed_id,
                                      int started_here)
 {
+  log_debug(LD_HANDSHAKE, "init conn from address %s: %s, %s (%d)",
+            fmt_addr(addr),
+            hex_str((const char*)id_digest, DIGEST_LEN),
+            ed25519_fmt(ed_id),
+            started_here);
+
   const node_t *r = node_get_by_id(id_digest);
   connection_or_set_identity_digest(conn, id_digest, ed_id);
   connection_or_update_token_buckets_helper(conn, 1, get_options());
@@ -1510,6 +1516,8 @@ connection_or_check_valid_tls_handshake(or_connection_t *conn,
   if (started_here) {
     /* A TLS handshake can't teach us an Ed25519 ID, so we set it to NULL
      * here. */
+    log_debug(LD_HANDSHAKE, "Calling client_learned_peer_id from "
+              "check_valid_tls_handshake");
     return connection_or_client_learned_peer_id(conn,
                                         (const uint8_t*)digest_rcvd_out,
                                         NULL);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits