]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
tweak based on comments from dgoulet
authorNick Mathewson <nickm@torproject.org>
Mon, 2 Feb 2015 19:37:02 +0000 (14:37 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 2 Feb 2015 19:42:33 +0000 (14:42 -0500)
src/or/circuitbuild.c
src/or/onion_ntor.c

index 873eba166824324d16f14f4cc33bb79a48b0ca69..676e69cc700fb6ee7d8aec82b0c5ba2b80166610 100644 (file)
@@ -1289,7 +1289,6 @@ circuit_finish_handshake(origin_circuit_t *circ,
   onion_handshake_state_release(&hop->handshake_state);
 
   if (circuit_init_cpath_crypto(hop, keys, 0)<0) {
-    log_warn(LD_BUG, "Couldn't initialize cpath crypto");
     return -END_CIRC_REASON_TORPROTOCOL;
   }
 
index 32d53445204b96398223f95d02722a0b7f43edfd..a7c0545dc7ba2a2b9932698d0707ea768339c5aa 100644 (file)
@@ -292,15 +292,17 @@ onion_skin_ntor_client_handshake(
 
   memwipe(&s, 0, sizeof(s));
 
-  if (bad && msg_out) {
+  if (bad) {
     if (bad & 4) {
-      *msg_out = NULL; /* Don't report this one; we probably just had the
-                        * wrong onion key.*/
+      if (msg_out)
+        *msg_out = NULL; /* Don't report this one; we probably just had the
+                          * wrong onion key.*/
       log_fn(LOG_INFO, LD_PROTOCOL,
              "Invalid result from curve25519 handshake: %d", bad);
     }
     if (bad & 3) {
-      *msg_out = "Zero output from curve25519 handshake";
+      if (msg_out)
+        *msg_out = "Zero output from curve25519 handshake";
       log_fn(LOG_WARN, LD_PROTOCOL,
              "Invalid result from curve25519 handshake: %d", bad);
     }