From 8b0d08d260cb7e9dd177a0027f3fc75652cb4a25 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Sat, 27 Mar 2021 18:43:22 +0000 Subject: [PATCH] Don't request privkey for ephemeral onion from Tor Prior to this commit, the Tor control request `ADD_ONION` did not specify that the private key need not be returned. After this commit we add the flag `DiscardPK` by specifying the argument private_key=txtorcon.DISCARD to the call to `create_onion_endpoint`, so that the private key is not returned. The private key is not needed, so this is better. --- jmbase/jmbase/twisted_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jmbase/jmbase/twisted_utils.py b/jmbase/jmbase/twisted_utils.py index 8424d24..dff7c73 100644 --- a/jmbase/jmbase/twisted_utils.py +++ b/jmbase/jmbase/twisted_utils.py @@ -131,7 +131,7 @@ class JMHiddenService(object): def create_onion_ep(self, t): self.tor_connection = t - return t.create_onion_endpoint(self.port) + return t.create_onion_endpoint(self.port, private_key=txtorcon.DISCARD) def onion_listen(self, onion_ep): return onion_ep.listen(self.site)