Bug 1316629

Summary: RIPEMD160 removed from hashlib in python 2.7.5-34.el7
Product: Red Hat Enterprise Linux 7 Reporter: Tom O'Connor <toconnor>
Component: pythonAssignee: Python Maintainers <python-maint>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.2CC: cstratak, felipe, pviktori
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-10 16:31:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom O'Connor 2016-03-10 16:07:42 UTC
Description of problem:

The RIPEMD160 hash is no longer available in python 2.7.5-34.el7.  Trying to create an instance results in a ValueError: unsupported hash type.  The previous release of python for EL7, python 2.7.5-16.el7, successfully created an instance of RIPEMD160.

Version-Release number of selected component (if applicable):

python 2.7.5-34.el7

How reproducible:

Always with 2.7.5-34.el7.


Steps to Reproduce:
1. Run python
2. import hashlib
3. r = hashlib.new('ripemd160')

Actual results:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/hashlib.py", line 111, in __hash_new
    return _hashlib.new(name, string, usedforsecurity)
ValueError: unsupported hash type

Expected results:

In prior release of python package, the same statements do not cause a ValueError exception, and the "r" variable is a usable instance of the RIPEMD160 hash.

Additional info:

Comment 2 Charalampos Stratakis 2016-03-10 16:31:33 UTC
Duplicate.

*** This bug has been marked as a duplicate of bug 1295459 ***

Comment 3 Kiltro 2016-09-02 21:13:07 UTC
I have the same problem and bug 1295459 does not apply for me:

Traceback (most recent call last):
  File "keys.py", line 18, in <module>
    ripemd160 = hashlib.new('ripemd160')
  File "build/bdist.linux-x86_64/egg/hashlib.py", line 87, in __py_new
    elif name in ('SHA512', 'sha512', 'SHA384', 'sha384'):
  File "build/bdist.linux-x86_64/egg/hashlib.py", line 80, in __get_builtin_constructor
    elif name in ('SHA256', 'sha256', 'SHA224', 'sha224'):
ValueError: unsupported hash type

Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
[GCC 5.4.0 20160609] on linux2


No solution on the entire web, you will be a hero.

Thanks!

Comment 4 Petr Viktorin (pviktori) 2016-09-05 08:12:08 UTC
Harris, could you check the patch in bug #1295459 fixes this?

Comment 5 Charalampos Stratakis 2016-09-05 08:53:41 UTC
(In reply to Petr Viktorin from comment #4)
> Harris, could you check the patch in bug #1295459 fixes this?

(In reply to Kiltro from comment #3)
> I have the same problem and bug 1295459 does not apply for me:

I just verified the reproducer and the patch does fix the issue.