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

[tor-commits] [stem/master] Actually make copies of the backward digest/key, too



commit 03c115dba10de3aca5374ea61893189e5c8b46a1
Author: Dave Rolek <dmr-x@xxxxxxxxxx>
Date:   Sat Aug 18 04:14:43 2018 +0000

    Actually make copies of the backward digest/key, too
    
    And rename the other 'orig_' vars to 'orig_forward_' vars, for clarity.
---
 stem/client/__init__.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/stem/client/__init__.py b/stem/client/__init__.py
index 33ac0d8d..91e8c4ca 100644
--- a/stem/client/__init__.py
+++ b/stem/client/__init__.py
@@ -234,8 +234,10 @@ class Circuit(object):
     """
 
     with self.relay._orport_lock:
-      orig_digest = self.forward_digest.copy()
-      orig_key = copy.copy(self.forward_key)
+      orig_forward_digest = self.forward_digest.copy()
+      orig_forward_key = copy.copy(self.forward_key)
+      orig_backward_digest = self.backward_digest.copy()
+      orig_backward_key = copy.copy(self.backward_key)
 
       try:
         cell = stem.client.cell.RelayCell(self.id, command, data, stream_id = stream_id)
@@ -263,8 +265,10 @@ class Circuit(object):
 
         return reply_cells
       except:
-        self.forward_digest = orig_digest
-        self.forward_key = orig_key
+        self.forward_digest = orig_forward_digest
+        self.forward_key = orig_forward_key
+        self.backward_digest = orig_backward_digest
+        self.backward_key = orig_backward_key
         raise
 
   def close(self):



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