Bug 1295459

Summary: python-2.7.5-34 breaks hashlib (md4)
Product: Red Hat Enterprise Linux 7 Reporter: Thomas Lang <thomas.koppe>
Component: pythonAssignee: Charalampos Stratakis <cstratak>
Status: CLOSED ERRATA QA Contact: Branislav Náter <bnater>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.1CC: bnater, cstratak, fkrska, hartsjc, isenfeld, jberan, lmiksik, ovasik, pviktori, toconnor
Target Milestone: rcKeywords: Patch, Regression, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python-2.7.5-38.el7 Doc Type: Bug Fix
Doc Text:
Cause: Uninitialized function in _hashlib library Consequence: Some hashlib algorithms do not work Fix: Initialize OpenSSL_add_all_digests function in _hashlib library Result: Hashlib algorithms work
Story Points: ---
Clone Of:
: 1318319 1371132 (view as bug list) Environment:
Last Closed: 2016-11-03 20:15:52 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:
Bug Depends On:    
Bug Blocks: 1203710, 1289025, 1305230    
Attachments:
Description Flags
Initialize OpenSSL_add_all_digests in _hashlib none

Description Thomas Lang 2016-01-04 15:15:08 UTC
We have updated our Python from python-2.7.5-18 to python-2.7.5-34, which breaks some hashlib algorithms (md4).

Python 2.7.5-18:
>>> import hashlib
>>> hashlib.new('md4', 'foo')
<md4 HASH object @ 0x7f91907e9d50>
>>>

Python 2.7.5-34:
>>> import hashlib
>>> hashlib.new('md4', 'foo')
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

Reverting back to 2.7.5-18 fixes the problem for now.

Comment 2 Robert Kuska 2016-01-05 10:05:03 UTC
Created attachment 1111776 [details]
Initialize OpenSSL_add_all_digests in _hashlib

Comment 3 Robert Kuska 2016-01-05 10:05:57 UTC
This is caused by not initializing OpenSSL_add_all_digests function in _hashlib library, I've attached patch which will fix the issue.

Comment 4 Charalampos Stratakis 2016-03-10 16:31:33 UTC
*** Bug 1316629 has been marked as a duplicate of this bug. ***

Comment 8 Thomas Lang 2016-08-23 05:43:09 UTC
I just got the Update of python-2.7.5-38.el7 on RHEL 7.2 and this is still not fixed.

Comment 9 Branislav Náter 2016-08-23 08:11:51 UTC
Hi,

This fix will be released in rhel-7.3. It is not present in current rhel-7.2 version of python (python-2.7.5-38.el7_2). Latest released python package contains mainly security fixes.

Comment 16 errata-xmlrpc 2016-11-03 20:15:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2586.html