Skip to content

Add support for FIPS enabled systems #161

Closed

Description

@gabor-varga

Describe the bug

context
When using the extension on FIPS-enabled systems, hashlib.md5 fails (update_css_js:70) due to security reasons.

expectation
The hashing should work, independently of FIPS being enabled or not.

bug
The following exception is encountered instead:

Extension error (sphinx_design.extension):
Handler <function update_css_js at 0x7f44aa9b9280> for event 'builder-inited' threw an exception (exception: [digital envelope routines] unsupported)

problem
This is a problem for users generating documentation on these systems.

solutions
Changing the algorithm, or adding usedforsecurity=Flag kwarg seems to solve the issue.

hash = hashlib.md5(content.encode("utf8"), usedforsecurity=False).hexdigest()

or

hash = hashlib.sha256(content.encode("utf8")).hexdigest()

Reproduce the bug

  1. Enable FIPS on your system
  2. Try to generate documentation using sphinx-design
  3. Generation fails

List your environment

Standard python-3.9.

Activity

  1. added
    bug
    on Sep 8, 2023
  2. welcome commented on Sep 8, 2023

    @welcome

    Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

    If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

    If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

    Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions