From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C0EE1139694 for ; Mon, 13 Mar 2017 21:46:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3163A21C072; Mon, 13 Mar 2017 21:46:49 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1099921C04E for ; Mon, 13 Mar 2017 21:46:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 34D9934108B for ; Mon, 13 Mar 2017 21:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AD0CA673A for ; Mon, 13 Mar 2017 21:46:45 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1489441589.0751158e5de176befeed5cb694342a1f0e19e895.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/checksum.py X-VCS-Directories: pym/portage/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 0751158e5de176befeed5cb694342a1f0e19e895 X-VCS-Branch: master Date: Mon, 13 Mar 2017 21:46:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 231dbf87-768d-4689-910d-41334123d20d X-Archives-Hash: 93d15deaeac5db74b1c26ab874c147e9 commit: 0751158e5de176befeed5cb694342a1f0e19e895 Author: Michał Górny gentoo org> AuthorDate: Sun Mar 12 15:21:44 2017 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Mar 13 21:46:29 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0751158e portage.checksum: Fix BLAKE2* fallbacks from pycryptodome Fix BLAKE2* fallback functions to explicitly provide digest length as required by pycryptodome. pym/portage/checksum.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 9ba251f29..82e8bec00 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -132,14 +132,16 @@ except ImportError: try: # added in pycryptodome from Crypto.Hash import BLAKE2b, BLAKE2s, SHA3_256, SHA3_512 + import functools + blake2bhash_ = getattr(BLAKE2b, 'new', None) if blake2bhash_ is not None: blake2bhash = _generate_hash_function("BLAKE2B", - blake2bhash_, origin="pycrypto") + functools.partial(blake2bhash_, digest_bytes=64), origin="pycrypto") blake2shash_ = getattr(BLAKE2s, 'new', None) if blake2shash_ is not None: blake2shash = _generate_hash_function("BLAKE2S", - blake2shash_, origin="pycrypto") + functools.partial(blake2shash_, digest_bytes=32), origin="pycrypto") sha3_256hash_ = getattr(SHA3_256, 'new', None) if sha3_256hash_ is not None: sha3_256hash = _generate_hash_function("SHA3_256",