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 8D4BF139694 for ; Wed, 1 Mar 2017 15:43:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5051921C03E; Wed, 1 Mar 2017 15:43:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 2C5D921C03E for ; Wed, 1 Mar 2017 15:43:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 CDFDD34164B for ; Wed, 1 Mar 2017 15:43:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 11B7058CC for ; Wed, 1 Mar 2017 15:43:16 +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: <1488382944.1c7b39c6cb89da22038291ae69528ac5486fd10c.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: 1c7b39c6cb89da22038291ae69528ac5486fd10c X-VCS-Branch: master Date: Wed, 1 Mar 2017 15:43:16 +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: 1f47d690-661d-405b-ab40-039fac070417 X-Archives-Hash: cf49ff245a11af5e5c0781ab31d458c2 commit: 1c7b39c6cb89da22038291ae69528ac5486fd10c Author: Michał Górny gentoo org> AuthorDate: Tue Feb 28 22:15:20 2017 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Mar 1 15:42:24 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1c7b39c6 checksum: Fix overriding fallbacks on broken pycrypto 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 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index a46b820af..fc38417a7 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -105,14 +105,14 @@ except ImportError: # is broken somehow. try: from Crypto.Hash import SHA256, RIPEMD - sha256hash = getattr(SHA256, 'new', None) - if sha256hash is not None: + sha256hash_ = getattr(SHA256, 'new', None) + if sha256hash_ is not None: sha256hash = _generate_hash_function("SHA256", - sha256hash, origin="pycrypto") - rmd160hash = getattr(RIPEMD, 'new', None) - if rmd160hash is not None: + sha256hash_, origin="pycrypto") + rmd160hash_ = getattr(RIPEMD, 'new', None) + if rmd160hash_ is not None: rmd160hash = _generate_hash_function("RMD160", - rmd160hash, origin="pycrypto") + rmd160hash_, origin="pycrypto") except ImportError: pass