Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 879043

Summary: Incorrect exception type raised when TLS protocol version is not available in FIPS mode
Product: Red Hat Enterprise Linux 7 Reporter: Miloslav Trmač <mitr>
Component: m2cryptoAssignee: Miloslav Trmač <mitr>
Status: CLOSED CURRENTRELEASE QA Contact: Alicja Kario <hkario>
Severity: low Docs Contact:
Priority: medium    
Version: 7.0CC: hkario
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: m2crypto-0.21.1-12.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:47:27 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 Miloslav Trmač 2012-11-21 22:07:26 UTC
In FIPS mode:

Traceback (most recent call last):
>  File "echo.py", line 23, in <module>
>    ctx = SSL.Context('sslv3')
>  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Context.py", line 47, in __init__
>    map()[long(self.ctx)] = self
> TypeError: long() argument must be a string or a number, not 'NoneType'

sslv3 is disabled in FIPS mode, so it's fine that this doesn't work, however a TypeError is unexpected.

self.ctx == None should have been detected, and raised probably ValueError (like in the case of completely unknown method.  Or is there a more useful error on the OpenSSL error stack that should have been picked up by the C bindings?

Version-Release number of selected component (if applicable):
m2crypto-0.21.1-9.el7.x86_64

Comment 2 Miloslav Trmač 2013-12-07 04:07:36 UTC
Non-FIPS reproducer:

> >>> import M2Crypto
> >>> M2Crypto.m2.ssl_ctx_new(None)
# note the None returned with no exception, and the reason:
> >>> M2Crypto.m2.err_reason_error_string(M2Crypto.m2.err_get_error())
> 'null ssl method passed'

with FIPS, the error is 'only tls allowed in fips mode', which is fairly nice.

Comment 3 Miloslav Trmač 2013-12-07 05:18:04 UTC
Expected behavior after the fix:

> >>> import M2Crypto
> >>> M2Crypto.m2.ssl_ctx_new(None)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> M2Crypto.SSL.SSLError: null ssl method passed

... and a corresponding exception raised in the FIPS-mode test case.

Comment 6 Ludek Smid 2014-06-13 12:47:27 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.