RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1364444 - Python fails to decode X.509 cert with GEN_RID subject alt name
Summary: Python fails to decode X.509 cert with GEN_RID subject alt name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Charalampos Stratakis
QA Contact: Branislav Náter
URL:
Whiteboard:
Depends On:
Blocks: 1380359 1393868
TreeView+ depends on / blocked
 
Reported: 2016-08-05 11:09 UTC by Christian Heimes
Modified: 2017-08-01 20:25 UTC (History)
4 users (show)

Fixed In Version: python-2.7.5-49.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
: 1402154 (view as bug list)
Environment:
Last Closed: 2017-08-01 20:25:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 27691 0 None None None 2016-08-08 09:04:29 UTC
Red Hat Product Errata RHSA-2017:1868 0 normal SHIPPED_LIVE Moderate: python security and bug fix update 2017-08-01 18:24:21 UTC

Description Christian Heimes 2016-08-05 11:09:35 UTC
Description of problem:
Python fails to decode X.509 certificate with a GEN_RID general name in subject alternative names. The problem makes it impossible to verify that a server certificate matches a host name. On the other hand registered id are required for SearchGuard 2.x with Elasticsearch 2.x. #1364268 has more information.

Version-Release number of selected component (if applicable):
All versions of Python in RHEL and Fedora are affected.

How reproducible:
The bug can be reproduced with any certificate that has a registered id (GEN_RID) in the X509v3 subject alt name extension.

Steps to Reproduce:
1. Download rid.pem from https://bugs.python.org/issue27691
2. python -c "import _ssl; print(_ssl._test_decode_cert('rid.pem'))"

Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: error return without exception set

Expected results:
{'OCSP': ('http://acme.test/ca/ocsp/tls-server-ca',), 'serialNumber': '01', 'crlDistributionPoints': ('http://acme.test/ca/tls-server-ca.crl',), 'version': 3, 'caIssuers': ('http://acme.test/ca/tls-server-ca.cer',), 'notAfter': 'Aug  5 09:13:13 2018 GMT', 'subjectAltName': (('Registered ID', '1.2.3.4.5.5'), ('DNS', 'localhost'), ('IP Address', '127.0.0.1'), ('IP Address', '0:0:0:0:0:0:0:1\n')), 'subject': ((('countryName', 'XX'),), (('organizationName', 'Acme Corp'),), (('organizationalUnitName', 'Acme Users'),), (('commonName', 'localhost'),)), 'issuer': ((('countryName', 'XX'),), (('organizationName', 'Acme Corp'),), (('organizationalUnitName', 'Acme Certificate Authority'),), (('commonName', 'Acme TLS Server CA'),)), 'notBefore': 'Aug  5 09:13:13 2016 GMT'}


Additional info:
The root cause of the Python bug is a bug in OpenSSL's GENERAL_NAME_print() function, see #1364268. The ticket on Python's bug tracker has a fix with unit tests.

Comment 2 Petr Viktorin (pviktori) 2016-08-08 09:04:29 UTC
Fixing Python tracker ID.

I plan to add devel_ack as soon as the patch is upstream.

Comment 5 Branislav Náter 2017-04-26 12:21:41 UTC
Reproduced on python-2.7.5-48.el7:

:: [  BEGIN   ] :: Running 'python -c "import _ssl; print(_ssl._test_decode_cert('rid.pem'))"'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: error return without exception set
:: [   FAIL   ] :: Command 'python -c "import _ssl; print(_ssl._test_decode_cert('rid.pem'))"' (Expected 0, got 1)

Verified on python-2.7.5-57.el7:
Python is able to decode certificate that has a registered id (GEN_RID) in the X509v3 subject alt name extension.

:: [  BEGIN   ] :: Running 'python -c "import _ssl; print(_ssl._test_decode_cert('rid.pem'))"'
{'crlDistributionPoints': (u'http://acme.test/ca/tls-server-ca.crl',), 'subjectAltName': ((u'Registered ID', u'1.2.3.4.5.5'), ('DNS', 'localhost'), ('IP Address', '127.0.0.1'), ('IP Address', '0:0:0:0:0:0:0:1\n')), 'notBefore': u'Aug  5 09:13:13 2016 GMT', 'caIssuers': (u'http://acme.test/ca/tls-server-ca.cer',), 'OCSP': (u'http://acme.test/ca/ocsp/tls-server-ca',), 'serialNumber': u'01', 'notAfter': 'Aug  5 09:13:13 2018 GMT', 'version': 3L, 'subject': ((('countryName', u'XX'),), (('organizationName', u'Acme Corp'),), (('organizationalUnitName', u'Acme Users'),), (('commonName', u'localhost'),)), 'issuer': ((('countryName', u'XX'),), (('organizationName', u'Acme Corp'),), (('organizationalUnitName', u'Acme Certificate Authority'),), (('commonName', u'Acme TLS Server CA'),))}
:: [   PASS   ] :: Command 'python -c "import _ssl; print(_ssl._test_decode_cert('rid.pem'))"' (Expected 0, got 0)

Comment 6 errata-xmlrpc 2017-08-01 20:25:03 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/RHSA-2017:1868


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