[tor-bugs] #21583 [Core Tor/Stem]: Crypto nonce must be bytes instead of string for python3

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Mar 1 01:03:07 UTC 2017


#21583: Crypto nonce must be bytes instead of string for python3
-------------------------------+--------------------
     Reporter:  feignix        |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 {{{
 File "stem/stem/descriptor/hidden_service_descriptor.py", line 329, in
 _decrypt_basic_auth
     cipher = Cipher(algorithms.AES(authentication_cookie),
 modes.CTR('\x00' * len(iv)), default_backend())
   File "/usr/lib/python3.5/site-
 packages/cryptography/hazmat/primitives/ciphers/modes.py", line 139, in
 __init__
     raise TypeError("nonce must be bytes")
 TypeError: nonce must be bytescipher =
 Cipher(algorithms.AES(authentication_cookie), modes.CTR('\x00' * len(iv)),
 default_backend())

   File "/usr/lib/python3.5/site-
 packages/cryptography/hazmat/primitives/ciphers/modes.py", line 139, in
 !__init!__
     raise !TypeError("nonce must be bytes")

 !TypeError: nonce must be bytes
 }}}

 The above error shows up in python3.
 Most likely it is due to the recent migration from pycrypto to
 cryptography.

 Fix:
 https://github.com/paraschetal/stem/commit/c09c9c723806d933445c5a33bceb20d31dcb99d3

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21583>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list