Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

use python-cryptography instead of python-crypto#1793

Closed
dirk-thomas wants to merge 1 commit intomelodic-develfrom
dirk-thomas/redo1606
Closed

use python-cryptography instead of python-crypto#1793
dirk-thomas wants to merge 1 commit intomelodic-develfrom
dirk-thomas/redo1606

Conversation

@dirk-thomas
Copy link
Copy Markdown
Member

Redo of #1606 since the fork has been delete and the patch needed some fixes.

The passing CI for the original PR which had bugs which would have failed at runtime shows that this code isn't covered by any unit tests. So this needs manual testing to ensure it doesn't break anything.

A few pending questions inline.

'LZ4 compression will not be available.')
found_lz4 = False

AES_BLOCK_SIZE = 16
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use this constant over AES.block_size (which is 128)?

if not self._gpg_key_user:
return
self._symmetric_key = Random.new().read(AES.block_size)
self._symmetric_key = os.urandom(AES.block_size)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why AES.block_size here instead of AES_BLOCK_SIZE?

@dirk-thomas
Copy link
Copy Markdown
Member Author

This is currently blocking the Python 3 migration (see #1792 (comment)).

@dirk-thomas
Copy link
Copy Markdown
Member Author

@mikepurvis Since you commented on the original ticket do you have a use case for this? If yes, could you manually test this change to ensure in doesn't break compatibility / behavior?

@dirk-thomas
Copy link
Copy Markdown
Member Author

dirk-thomas commented Aug 14, 2019

As an alternative I am considering #1609 since it is much simpler and therefore has a lower chance of regressions.

@dirk-thomas
Copy link
Copy Markdown
Member Author

For now we went with pycryptodome in #1609. I will go ahead and close this.

@dirk-thomas dirk-thomas deleted the dirk-thomas/redo1606 branch August 14, 2019 23:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant