brechtm / rinohtype

The Python document processor
http://www.mos6581.org/rinohtype
GNU Affero General Public License v3.0
500 stars 60 forks source link

If on Python 3.9+, set `usedforsecurity` parameter to `False` #426

Closed PabloAlexis611 closed 6 months ago

PabloAlexis611 commented 7 months ago

This is a small, backwards compatible change that allows the use of rinohtype in FIPS-enabled environments that raise errors when using the MD5 hashlib function. Since the purpose of using MD5 in this context is not security-related, this change is acceptable. The usedforsecurity parameter was added starting in Python 3.9+ for the md5 function of the hashlib library.

An error like the following is otherwise thrown:

digital envelope routines:EVP_DigestInit_ex:disabled for fips

An alternative could also be to call the SHA256 hashing function instead, but making this change keeps the current behavior of the rinohtype package.

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.23%. Comparing base (26635ef) to head (ce17498).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #426 +/- ## ======================================= Coverage 77.23% 77.23% ======================================= Files 93 93 Lines 14690 14690 Branches 2416 2416 ======================================= Hits 11346 11346 Misses 2906 2906 Partials 438 438 ``` | [Flag](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | Coverage Δ | | |---|---|---| | [3.10](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.24% <100.00%> (ø)` | | | [3.11](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.25% <100.00%> (ø)` | | | [3.12.0-alpha](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.25% <100.00%> (ø)` | | | [3.8](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.20% <100.00%> (ø)` | | | [3.9](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.88% <50.00%> (ø)` | | | [Linux](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.22% <100.00%> (ø)` | | | [pypy-3.9](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `77.23% <100.00%> (ø)` | | | [regression-3.10](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `75.75% <100.00%> (ø)` | | | [regression-3.11](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `75.76% <100.00%> (ø)` | | | [regression-3.12](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `75.76% <100.00%> (ø)` | | | [regression-3.8](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `75.70% <100.00%> (ø)` | | | [regression-pypy3](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `75.74% <100.00%> (ø)` | | | [unit-3.10](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.89% <50.00%> (ø)` | | | [unit-3.11](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.89% <50.00%> (ø)` | | | [unit-3.12](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.89% <50.00%> (ø)` | | | [unit-3.8](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.88% <50.00%> (ø)` | | | [unit-3.9](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.88% <50.00%> (ø)` | | | [unit-pypy3](https://app.codecov.io/gh/brechtm/rinohtype/pull/426/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels) | `46.90% <50.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brecht+Machiels#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

brechtm commented 6 months ago

Thanks @PabloAlexis611!