|
@@ -878,6 +878,11 @@ class RelayChannelManager(ChannelManager):
|
|
|
elif isinstance(msg, SinglePassCreateCircuitMsg):
|
|
|
# A new circuit has arrived
|
|
|
circhandler = channel.new_circuit_with_circid(msg.circid)
|
|
|
+ # Create the ntor reply using Sphinx
|
|
|
+ #TODO what is the correct domain seperater here to indicate using
|
|
|
+ #Sphinx?
|
|
|
+ reply, secret = NTor.reply(self.onionkey, self.idpubkey,
|
|
|
+ msg.ntor_request, self.perfstats, b'data')
|
|
|
sys.exit("have not yet implemented circuit handling for single-pass in relays")
|
|
|
else:
|
|
|
return super().received_msg(msg, peeraddr, channel)
|
|
@@ -921,6 +926,11 @@ class Relay(network.Server):
|
|
|
# Initially, we're not a fallback relay
|
|
|
self.is_fallbackrelay = False
|
|
|
|
|
|
+ if network.thenetwork.womode == network.WOMode.SINGLEPASS:
|
|
|
+ self.path_selection_key = nacl.public.PrivateKey.generate()
|
|
|
+ else:
|
|
|
+ self.path_selection_key = None
|
|
|
+
|
|
|
self.uploaddesc()
|
|
|
|
|
|
def terminate(self):
|
|
@@ -967,6 +977,10 @@ class Relay(network.Server):
|
|
|
descdict["addr"] = self.netaddr
|
|
|
descdict["bw"] = self.bw
|
|
|
descdict["flags"] = self.flags
|
|
|
+
|
|
|
+ if network.thenetwork.womode == network.WOMode.SINGLEPASS:
|
|
|
+ descdict["path_selection_key"] = self.path_selection_key
|
|
|
+
|
|
|
desc = dirauth.RelayDescriptor(descdict)
|
|
|
desc.sign(self.idkey, self.perfstats)
|
|
|
dirauth.RelayDescriptor.verify(desc, self.perfstats)
|