Change the string types for encrypted passwords from bytes to Unicode.

Review Request #10204 — Created Oct. 9, 2018 and submitted

Information

Review Board
release-4.0.x
a290397...

Reviewers

encrypt_password and decrypt_password were previously expecting to
work with byte strings, but given the nature of Python 2, those were
implicitly being converted elsewhere to Unicode strings. In Python 3,
they're not so interchangeable, and requiring/returning byte strings
makes for too much hassle, breaking all sorts of code.

These functions now expect to be dealing with Unicode strings. Both
return Unicode strings and accept either byte strings or Unicode strings
as values. This is actually safer than what we had before, since they
were always turning into Unicode at some point, and now it's at a level
that we control.

All unit tests pass on Python 2.7.

Unit tests that can be run on Python 3.x that used to break due to
password string types now pass.

Manually tested saving and loading passwords for repositories.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (b49ba54)