[tor-commits] [tor/master] Clean keys on stack in rend_service_intro_has_opened()

nickm at torproject.org nickm at torproject.org
Mon Jun 25 16:08:58 UTC 2012


commit 88c5d3ca55dddd39e336272c9ce56a59e0092265
Author: Andrea Shepard <andrea at persephoneslair.org>
Date:   Fri Jun 15 20:43:33 2012 -0700

    Clean keys on stack in rend_service_intro_has_opened()
---
 src/or/rendservice.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 85e8500..50950d1 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1627,8 +1627,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
          this case, we might as well close the thing. */
       log_info(LD_CIRC|LD_REND, "We have just finished an introduction "
                "circuit, but we already have enough.  Closing it.");
-      circuit_mark_for_close(TO_CIRCUIT(circuit), END_CIRC_REASON_NONE);
-      return;
+      reason = END_CIRC_REASON_NONE;
+      goto err;
     } else {
       tor_assert(circuit->build_state->is_internal);
       log_info(LD_CIRC|LD_REND, "We have just finished an introduction "
@@ -1649,7 +1649,7 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
       }
 
       circuit_has_opened(circuit);
-      return;
+      goto done;
     }
   }
 
@@ -1695,9 +1695,16 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
     goto err;
   }
 
-  return;
+  goto done;
+
  err:
   circuit_mark_for_close(TO_CIRCUIT(circuit), reason);
+ done:
+  memset(buf, 0, sizeof(buf));
+  memset(auth, 0, sizeof(auth));
+  memset(serviceid, 0, sizeof(serviceid));
+
+  return;
 }
 
 /** Called when we get an INTRO_ESTABLISHED cell; mark the circuit as a





More information about the tor-commits mailing list