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

[tor-commits] [sbws/master] Add ed25519_master_key to results; bump result version to 3



commit 2c8212d23984b5a890dc2bdaa39109935f907249
Author: Matt Traudt <sirmatt@xxxxxxx>
Date:   Thu Jun 7 21:10:09 2018 -0400

    Add ed25519_master_key to results; bump result version to 3
    
    node_id=$B058ABB695524A11D0FE958C0F8AA7963FD4258C bw=5685 nick=exit2 rtt=139 time=2018-06-08T01:06:27 ed25519=g+Shk00y9Md0hg1S6ptnuc/wWKbADBgdjT0Kg+TSF3s
---
 sbws/globals.py        |  2 +-
 sbws/lib/resultdump.py | 30 +++++++++++++++++++++++-------
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/sbws/globals.py b/sbws/globals.py
index a16682c..e48b378 100644
--- a/sbws/globals.py
+++ b/sbws/globals.py
@@ -4,7 +4,7 @@ import socket
 
 log = logging.getLogger(__name__)
 
-RESULT_VERSION = 2
+RESULT_VERSION = 3
 WIRE_VERSION = 1
 SPEC_VERSION = '1.1.0'
 
diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index ffa493d..4401412 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -150,14 +150,15 @@ class Result:
     class Relay:
         ''' Implements just enough of a stem RouterStatusEntryV3 for this
         Result class to be happy '''
-        def __init__(self, fingerprint, nickname, address):
+        def __init__(self, fingerprint, nickname, address, ed25519_master_key):
             self.fingerprint = fingerprint
             self.nickname = nickname
             self.address = address
+            self.ed25519_master_key = ed25519_master_key
 
     def __init__(self, relay, circ, dest_url, scanner_nick, t=None):
         self._relay = Result.Relay(relay.fingerprint, relay.nickname,
-                                   relay.address)
+                                   relay.address, relay.ed25519_master_key)
         self._circ = circ
         self._dest_url = dest_url
         self._scanner = scanner_nick
@@ -180,6 +181,10 @@ class Result:
         return self._relay.address
 
     @property
+    def ed25519_master_key(self):
+        return self._relay.ed25519_master_key
+
+    @property
     def circ(self):
         return self._circ
 
@@ -204,6 +209,7 @@ class Result:
             'fingerprint': self.fingerprint,
             'nickname': self.nickname,
             'address': self.address,
+            'ed25519_master_key': self.ed25519_master_key,
             'circ': self.circ,
             'dest_url': self.dest_url,
             'time': self.time,
@@ -275,7 +281,9 @@ class ResultError(Result):
     def from_dict(d):
         assert isinstance(d, dict)
         return ResultError(
-            Result.Relay(d['fingerprint'], d['nickname'], d['address']),
+            Result.Relay(
+                d['fingerprint'], d['nickname'], d['address'],
+                d['ed25519_master_key']),
             d['circ'], d['dest_url'], d['scanner'],
             msg=d['msg'], t=d['time'])
 
@@ -314,7 +322,9 @@ class ResultErrorCircuit(ResultError):
     def from_dict(d):
         assert isinstance(d, dict)
         return ResultErrorCircuit(
-            Result.Relay(d['fingerprint'], d['nickname'], d['address']),
+            Result.Relay(
+                d['fingerprint'], d['nickname'], d['address'],
+                d['ed25519_master_key']),
             d['circ'], d['dest_url'], d['scanner'],
             msg=d['msg'], t=d['time'])
 
@@ -335,7 +345,9 @@ class ResultErrorStream(ResultError):
     def from_dict(d):
         assert isinstance(d, dict)
         return ResultErrorStream(
-            Result.Relay(d['fingerprint'], d['nickname'], d['address']),
+            Result.Relay(
+                d['fingerprint'], d['nickname'], d['address'],
+                d['ed25519_master_key']),
             d['circ'], d['dest_url'], d['scanner'],
             msg=d['msg'], t=d['time'])
 
@@ -369,7 +381,9 @@ class ResultErrorAuth(ResultError):
     def from_dict(d):
         assert isinstance(d, dict)
         return ResultErrorAuth(
-            Result.Relay(d['fingerprint'], d['nickname'], d['address']),
+            Result.Relay(
+                d['fingerprint'], d['nickname'], d['address'],
+                d['ed25519_master_key']),
             d['circ'], d['dest_url'], d['scanner'],
             msg=d['msg'], t=d['time'])
 
@@ -401,7 +415,9 @@ class ResultSuccess(Result):
         assert isinstance(d, dict)
         return ResultSuccess(
             d['rtts'], d['downloads'],
-            Result.Relay(d['fingerprint'], d['nickname'], d['address']),
+            Result.Relay(
+                d['fingerprint'], d['nickname'], d['address'],
+                d['ed25519_master_key']),
             d['circ'], d['dest_url'], d['scanner'],
             t=d['time'])
 



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