[tor-commits] [stem/master] Generated onion-key were invalid

atagar at torproject.org atagar at torproject.org
Wed Jun 28 17:11:29 UTC 2017


commit eb07135e7b0f11ab784858c577c6d12e189722c2
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Jun 28 10:13:13 2017 -0700

    Generated onion-key were invalid
    
    Oops, our change to create random fields caused this to be rendered as a list.
---
 stem/descriptor/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/descriptor/__init__.py b/stem/descriptor/__init__.py
index 21e7bd7..f293c6c 100644
--- a/stem/descriptor/__init__.py
+++ b/stem/descriptor/__init__.py
@@ -1047,7 +1047,7 @@ def _random_crypto_blob(block_type = None):
   Provides a random string that can be used for crypto blocks.
   """
 
-  crypto_blob = stem.util.str_tools._split_by_length(base64.b64encode('%0140x' % random.randrange(16 ** 140)), 64)
+  crypto_blob = '\n'.join(stem.util.str_tools._split_by_length(base64.b64encode('%0140x' % random.randrange(16 ** 140)), 64))
 
   if block_type:
     return '\n-----BEGIN %s-----\n%s\n-----END %s-----' % (block_type, crypto_blob, block_type)



More information about the tor-commits mailing list