Re: [gentoo-portage-dev] [PATCH 2/3] checksum: Remove redundant internal fallbacks

2017-02-28 Thread Michał Górny
W dniu 28.02.2017, wto o godzinie 10∶01 +0100, użytkownik Michał Górny napisał: > Remove the internal digest fallbacks since they have no real use > nowadays. The hashlib versions are preferred later in the logic anyway, > and they are available since Python 2.5. > --- > pym/portage/checksum.py |

[gentoo-portage-dev] [PATCH 3/3] checksum: Add blake2* and sha3 hashes from hashlib 3.6+

2017-02-28 Thread Michał Górny
Add initial support for using the new SHA3_256 and SHA3_512, as well as competetive BLAKE2b and BLAKE2s hashes that are now provided in hashlib module of Python 3.6. --- pym/portage/checksum.py | 14 +- pym/portage/const.py| 6 ++ 2 files changed, 15 insertions(+), 5

[gentoo-portage-dev] [PATCH 1/2] vartree: Use hashlib lazy-import, kill py<2.5 compat

2017-02-28 Thread Michał Górny
--- pym/portage/dbapi/vartree.py | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5053801e6..2a612d162 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1,4 +1,4 @@ -#

[gentoo-portage-dev] [PATCHES] Fix md5 refs in vartree

2017-02-28 Thread Michał Górny
Hi, Here's a prequel to my other patch set. It cleans up the use of MD5 in vartree. Currently, MD5 is loaded from three different locations -- most of merging code uses portage.checksum high-level functions, one bit uses implementation detail of portage.checksum and one bit imports hashlib

[gentoo-portage-dev] [PATCH 2/2] vartree: Replace uses of internal portage.checksum._new_md5 var

2017-02-28 Thread Michał Górny
Use the public hashlib.md5 method that is required for other code in the module already. --- pym/portage/dbapi/vartree.py | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 2a612d162..c421dc50b 100644 ---

[gentoo-portage-dev] [PATCH 1/3] checksum: Add summary on top to help following the logic

2017-02-28 Thread Michał Górny
Add a summary of all supported digest algorithms on top of the file along with the supported implementations and their order of preference. This will help people follow the crazy logic below. --- pym/portage/checksum.py | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff

[gentoo-portage-dev] [PATCH 2/3] checksum: Remove redundant internal fallbacks

2017-02-28 Thread Michał Górny
Remove the internal digest fallbacks since they have no real use nowadays. The hashlib versions are preferred later in the logic anyway, and they are available since Python 2.5. --- pym/portage/checksum.py | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git

[gentoo-portage-dev] [PATCH 1/2] checksum: Fix overriding fallbacks on broken pycrypto

2017-02-28 Thread Michał Górny
The pycrypto override used the same variables as actual hash functions before determining whether its functions are useful. As a result, if pycrypto had a broken module and no hash function was generated, the possible previous implementation was replaced by None. --- pym/portage/checksum.py | 12

[gentoo-portage-dev] [PATCH 2/2] checksum: Add pycryptodome fallbacks for SHA3 and BLAKE2

2017-02-28 Thread Michał Górny
--- pym/portage/checksum.py | 22 ++ 1 file changed, 22 insertions(+) diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index fc38417a7..042a0a745 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -116,6 +116,28 @@ try: except ImportError:

Re: [gentoo-portage-dev] [PATCH 1/2] checksum: Fix overriding fallbacks on broken pycrypto

2017-02-28 Thread Zac Medico
On 02/28/2017 11:34 PM, Michał Górny wrote: > The pycrypto override used the same variables as actual hash functions > before determining whether its functions are useful. As a result, if > pycrypto had a broken module and no hash function was generated, > the possible previous implementation was

Re: [gentoo-portage-dev] [PATCH 2/2] checksum: Add pycryptodome fallbacks for SHA3 and BLAKE2

2017-02-28 Thread Zac Medico
On 02/28/2017 11:34 PM, Michał Górny wrote: > --- > pym/portage/checksum.py | 22 ++ > 1 file changed, 22 insertions(+) > > diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py > index fc38417a7..042a0a745 100644 > --- a/pym/portage/checksum.py > +++