-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'digest_size' is an invalid keyword argument for openssl_blake2b() #857
Comments
Potentially related code from CPython: |
I haven't tried to reproduce but this definitely seems to be an issue with whatever distribution of python you're using. You should try to file a bug with whomever build the image you're trying to use |
I opened Case #03126473 with RedHat support about the ubi8/python-39 container image. |
RedHat has opened Bugzilla ticket #2041710 to track this case internally. |
It sounds like this is not an issue with Twine, so I'm going to close this. If that's incorrect, of if there's a related improvement that could be made to Twine, I'm happy to re-open it. |
Could we please reopen this issue. It seems that the problem is not in the twine but in our Python interpreter itself but it might be faster to discuss it here where we have all the details. It seems to me that the problem is caused by using blake2b implementation from openssl. Python should prefer its own implementation of blake2b. The only possible reason I see for this situation is FIPS mode. Is there any chance that you have it enabled? Could you please try this:
|
I'm able to reproduce the issue. I'm using Python 3.8 because that's the newest I have on an FIPS-enabled machine. Unfortunately, the problem is not just the different API but also the fact, that BLAKE algorithms are not certified for FIPS.
|
Would it make sense to catch also Lines 268 to 273 in f69d4b7
|
@frenzymadness I think that makes sense. Thanks for the digging into this. Would you be game to open a PR? |
Sure, on it. |
I can confirm that we have FIPS enabled. This causes other apparently related issues, e.g. when using the UBI8 Python 3.9 image mentioned above for Django Web development: ...
File "/opt/app-root/lib64/python3.9/site-packages/django/db/backends/utils.py", line 218, in names_digest
h = hashlib.md5()
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS |
Yeah, a lot of upstream projects are not ready for FIPS and it's hard to implement the support for them because the FIPS mode is not that commonly used. |
And FIPS causes other problems just because updates to the compliant/audited code is near impossible even for security patches |
I'm not sure I understand your point and also I'm not an expert in this field but if we (Red Hat) provide a Python package that is FIPS-compliant, we also provide security fixes for that package for the whole support lifespan. Upstream projects like Django are not certified for FIPS so it depends on who provides the software to you. |
There are entire branches of openssl that are frozen in time - vulnerabilities and all - because they were audited for FIPS and the code cannot change without compliance changing (to the best of my understanding). It's an expensive process to go through and it's time-consuming. Things built a-top FIPS certified code can move much faster because that code hasn't been audited for large sums of money. Twine, Python, etc. can be updated just fine. |
Environment
RedHat Linux inside an UBI8 Python 3.9 container image.
Using tox, as follows, running
tox -e readme
:My
pyproject.toml
looks like this:The Issue
I verified that:
digest_size
keyword argument (at least) since version 3.7Looking at the error message, it's unclear to me why
openssl_blake2b
is mentioned (instead of justblake2b
):Does this indicate that there is an incompatible library installed that takes precedence over the C-library that Python is meant to reference? Really just guessing. 🤔
Steps to Reproduce
registry.redhat.io/ubi8/python-39:latest
tox.ini
with the configuration shown abovetox
(pip install tox
) and runtox
The text was updated successfully, but these errors were encountered: