Move from PyCrypto to the newer, maintained cryptography package.

Review Request #8813 — Created March 12, 2017 and submitted

Information

Review Board
release-2.5.x
432f96a...

Reviewers

PyCrypto's been unmaintained for a while, which in theory opens the door
to security issues. In practice, this doesn't truly affect us, as we
only use the AES encryption/decryption, which doesn't appear to have had
any security problems. However, from a user standpoint, it's easier to
install the new cryptography module and harder to install PyCrypto, and
it's better to have more modern options.

This change moves us over from PyCrypto fully to cryptography, updating
dependencies accordingly. This is fully backwards-compatible, meaning
that existing installs with encrypted content from PyCrypto will
continue to work with cryptography, and vice-versa if downgrading.

Documentation for the functions have also been added, helping to
clarify the types of encryption used.

Unit tests were added to ensure these operations continue to work and
that backwards-compatibility does not break.

Tested that all credentials on my development server made from PyCrypto
were properly loaded, and new credentials could be saved and then loaded
again.

Unit tests pass.

Description From Last Updated

'reviewboard' imported but unused

reviewbotreviewbot

Shouldn't this be AES_BLOCK_SIZE ?

brenniebrennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/scmtools/tests/test_crypto_utils.py
        reviewboard/scmtools/crypto_utils.py
        reviewboard/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/scmtools/tests/test_crypto_utils.py
        reviewboard/scmtools/crypto_utils.py
        reviewboard/__init__.py
    
    
  2. reviewboard/__init__.py (Diff revision 1)
     
     
    Show all issues
     'reviewboard' imported but unused
    
  3. 
      
david
  1. Ship It!
  2. 
      
brennie
  1. 
      
  2. reviewboard/scmtools/crypto_utils.py (Diff revision 1)
     
     
    Show all issues

    Shouldn't this be AES_BLOCK_SIZE ?

    1. Yep. Thanks for spotting it. Got changed throughout my iterations and testing of this while dealing with both PyCrypto and cryptography implementations in the same file.

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (1a450a4)
Loading...