Bug 1489816 - python: Utilize system-wide crypto-policies
Summary: python: Utilize system-wide crypto-policies
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmlint
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: fedora-crypto-policies 1535596
TreeView+ depends on / blocked
 
Reported: 2017-09-08 12:16 UTC by Nikos Mavrogiannopoulos
Modified: 2019-11-27 21:49 UTC (History)
12 users (show)

Fixed In Version: python3-3.6.4-11.fc28 python3-3.6.4-7.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 21:49:57 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Python 31429 None None None 2017-09-14 15:16:20 UTC

Description Nikos Mavrogiannopoulos 2017-09-08 12:16:37 UTC
Please convert to use the system's crypto policy for SSL and TLS:
https://fedoraproject.org/wiki/Packaging:CryptoPolicies

If this program is compiled against gnutls, change the default priority string to be "@SYSTEM" or to use gnutls_set_default_priority().

If this program is compiled against openssl, and there is no default cipher list specified, you don't need to modify it. Otherwise replace the default cipher list with "PROFILE=SYSTEM".

In both cases please verify that the application uses the system's crypto policies.

If the package is already using the system-wide crypto policies, or it does not use SSL or TLS, no action is required, the bug can simply be closed.

Comment 1 Charalampos Stratakis 2017-09-11 12:03:16 UTC
I see there are some calls to SSL_CTX_set_cipher_list() at Modules/_ssl.c

Christian would you be able to shed some light here?

Comment 2 Christian Heimes 2017-09-11 12:55:38 UTC
SSL_CTX_set_cipher_list() is called in two places. First of all it is used in the constructor of SSLContext to block unsafe ciphers with old versions of OpenSSL. It is also called by SSLContext.set_ciphers() in ssl.create_default_context(). You have to patch both calls to use system policies.

Comment 3 Nikos Mavrogiannopoulos 2017-09-11 13:09:40 UTC
In order to avoid using a downstream-only string (PROFILE=SYSTEM), you may want to not call these functions at all, unless the caller has explicitly specified a string. Not calling the set_ciphers() in openssl, means using the default ciphers.

Comment 4 Christian Heimes 2017-09-12 13:25:03 UTC
I opened upstream bug https://bugs.python.org/issue31429 to address the issue. While Python won't drop the cipher suite override any time soon, I'll try to get a configure option and macro in:

    ./configure --with-ssl-default-suite="PROFILE=SYSTEM"
    make

Comment 5 Charalampos Stratakis 2017-09-12 15:26:37 UTC
Thanks Christian for looking into it.

Nikos for which branches of Fedora should this be addressed and is there any related deadline? Currently I'm still catching up with things due to a long vacation, so it might take some time until I get to it.

Comment 9 Charalampos Stratakis 2017-09-27 11:27:18 UTC
Current WIP PR from cheimes:

https://github.com/python/cpython/pull/3532

I backported the PR to python 3.6.2 and created a scratch build and it builds fine on rawhide with using the "PROFILE=SYSTEM" string[0].

[0] https://koji.fedoraproject.org/koji/taskinfo?taskID=22087475

Comment 10 Charalampos Stratakis 2018-01-30 11:26:57 UTC
Upstream has merged the PR for the 3.7 branch. I will backport it to our 3.6 package as it's backwards compatible.

Comment 11 Nikos Mavrogiannopoulos 2018-01-31 07:15:24 UTC
Thank you!

Comment 12 Fedora Update System 2018-02-01 13:10:13 UTC
python3-3.6.4-7.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-0910fcb732

Comment 13 Fedora Update System 2018-02-01 19:33:07 UTC
python3-3.6.4-7.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-0910fcb732

Comment 14 Fedora Update System 2018-02-02 17:40:15 UTC
python3-3.6.4-7.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Miro Hrončok 2018-03-14 18:10:33 UTC
python3-3.6.4-17.fc29, rpmlint:

python3-debug.x86_64: W: crypto-policy-non-compliance-openssl /usr/lib64/python3.6/lib-dynload/_ssl.cpython-36dm-x86_64-linux-gnu.so SSL_CTX_set_cipher_list
python3-libs.x86_64: W: crypto-policy-non-compliance-openssl /usr/lib64/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so SSL_CTX_set_cipher_list

Comment 16 Miro Hrončok 2018-03-14 18:13:19 UTC
Looking at https://src.fedoraproject.org/rpms/python3/c/c9bb114a1dc3fc2216af482d1cdbafe58db45afb?branch=master

I don't see --with-ssl-default-suite="PROFILE=SYSTEM"

Comment 17 Miro Hrončok 2018-03-14 18:17:38 UTC
Ignore the last comment.

The fix is actually https://src.fedoraproject.org/rpms/python3/c/969d51434e2479639d62c2b03fd51df7403eb722?branch=master

That has --with-ssl-default-suites=openssl, not --with-ssl-default-suite="PROFILE=SYSTEM".

Comment 18 Miro Hrončok 2018-03-14 18:51:04 UTC
Apparently, rpmlint does something like this:

$ readelf -W -S -l -d -s /usr/lib64/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so | grep SSL_CTX_set_cipher_list | grep -v 'PROFILE=SYSTEM'
    17: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND SSL_CTX_set_cipher_list@OPENSSL_1_1_0 (2)

Comment 19 Charalampos Stratakis 2018-06-21 14:59:57 UTC
Reassigning to rpmlint as this is not a bug in python but an erroneous reporting of rpmlint.

Comment 20 Tom "spot" Callaway 2018-06-21 15:54:59 UTC
rpmlint matches https://fedoraproject.org/wiki/Packaging:CryptoPolicies

If that is incorrect, it should be adjusted (and rpmlint will match it).

Comment 21 Jan Kurik 2018-08-14 10:18:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 22 Ben Cotton 2019-10-31 19:39:56 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 23 Ben Cotton 2019-11-27 21:49:57 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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