Skip to content

Commit

Permalink
Fix mypy and flake8 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lhupfeldt committed May 5, 2020
1 parent 1b8415a commit 193d141
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sphinx/util/__init__.py
Expand Up @@ -173,16 +173,17 @@ def __setstate__(self, state: Set[str]) -> None:
def fips_safe_md5(data=b'', **kwargs):
"""Wrapper around hashlib.md5
Attempt call with 'usedforsecurity=False' if we get a ValueError, which happens when OpenSSL FIPS mode is enabled:
Attempt call with 'usedforsecurity=False' if we get a ValueError, which happens when
OpenSSL FIPS mode is enabled:
ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips
See: https://github.com/sphinx-doc/sphinx/issues/7611
"""

try:
return md5(data, **kwargs)
return md5(data, **kwargs) # type: ignore
except ValueError:
return md5(data, **kwargs, usedforsecurity=False)
return md5(data, **kwargs, usedforsecurity=False) # type: ignore


class DownloadFiles(dict):
Expand Down

0 comments on commit 193d141

Please sign in to comment.