Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21583 closed defect (fixed)

Crypto nonce must be bytes instead of string for python3

Reported by: feignix Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by atagar

Resolution: fixed
Status: newclosed

Hi feignix, very sorry about the long delay! Been busy focusing on a big branch the last several weeks. That said, I really hate dropping the ball on a pull request like this - sorry about that. :(

This was fixed within the ed25519 certificate branch I merged yesterday. Thanks for the catch!

comment:2 Changed 3 years ago by feignix

No issues :)
Glad that it has been fixed now

Note: See TracTickets for help on using tickets.