Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1227505 - Fix exception handling when loading a private key
Summary: Fix exception handling when loading a private key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pyOpenSSL
Version: 7.3
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Hubert Kario
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-02 20:08 UTC by Arie Bregman
Modified: 2018-10-30 09:48 UTC (History)
6 users (show)

Fixed In Version: pyOpenSSL-0.13.1-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:48:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test_parser_cert (1.89 KB, text/plain)
2015-06-02 20:08 UTC, Arie Bregman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3106 0 None None None 2018-10-30 09:48:47 UTC

Internal Links: 1283932

Description Arie Bregman 2015-06-02 20:08:24 UTC
Created attachment 1034008 [details]
test_parser_cert

Description of problem:
When running different tests in openstack components from upstream, I receive the following error: "bad password read" while expecting to different result

Apparently major changes introduced in 0.14 version, but the latest available pyOpenSSL rpm for rhel 7.x is 0.13.1-4

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

How reproducible:
100%

Steps to Reproduce:
1. yum install pyOpenSSL on rhel 7.x machine
2. Download test_cert_parser attached to this bug
3. Run it: python test_cert_parser.py

Actual results:
OpenSSL.crypto.Error: [(None, 'UI_set_result', 'result too small'), ('PEM routines', 'PEM_def_callback', 'problems getting password'), ('PEM routines', 'PEM_READ_BIO_PRIVATEKEY', 'bad password read')]

Expected results:
Allow exceptions from passphrase callbacks to propagate up out of load_privatekey

Comment 2 Tomas Mraz 2015-06-03 08:48:44 UTC
The upstream completely changed the way the pyOpenSSL is written I do not think it is possible to rebase to 0.14 in RHEL-7.

Comment 3 Ihar Hrachyshka 2015-06-03 10:43:55 UTC
OK, if not a rebase, can we bisect a patch that fixes the test case and consider it for a backport?

Comment 4 Tomas Mraz 2015-06-03 11:38:36 UTC
Yes, fixing this via specific patch is definitely the way to go.

Comment 5 Arie Bregman 2015-08-25 20:37:54 UTC
I believe this will resolve the problem: https://github.com/pyca/pyopenssl/commit/56b2fb8abb3ea3d846bb336a7bc25fa2b0a9c0d9

From changelog: "* OpenSSL/crypto/crypto.c: Allow exceptions from passphrase callbacks to propagate up out of load_privatekey" 

Please let me know if any additional information needed.

Comment 6 Tomas Mraz 2015-08-26 07:44:37 UTC
This seems to be doable. You'll probably need to verify whether the backport fixes the problem yourself.

Comment 7 Arie Bregman 2015-08-27 10:31:19 UTC
No problem. Once this specific patch is in, I'll test it.

Comment 12 Arie Bregman 2017-11-28 18:54:41 UTC
Why is this being delayed for so many releases?

Comment 18 errata-xmlrpc 2018-10-30 09:48:30 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://access.redhat.com/errata/RHBA-2018:3106


Note You need to log in before you can comment on or make changes to this bug.