Skip to content

gh-118224: When in FIPS mode ensure builtin hashes check for usedforsecurity=False - #127300

Closed
xnox wants to merge 1 commit into
python:mainfrom
xnox:hashlib-builtin-fips-check
Closed

xnox wants to merge 1 commit into
python:mainfrom
xnox:hashlib-builtin-fips-check

Conversation

@xnox

@xnox xnox commented Nov 26, 2024 •

Copy link
Copy Markdown

When _hashlib/OpenSSL is available, and OpenSSL is in FIPS mode,
ensure that builtin (fallback) hash implementations are wrapped with a
check for usedforsecurity=False. It is likely that buitin
implementations are FIPS unapproved (either algorithm disallowed; or
the implementation not certified by NIST).

This enables strict approved-only compliance when usedforsecurity=True
on FIPS systems only.

And yet it also enables fallback access with usedforsecurity=False for
any missing (historical, disallowed or missing certified
implementation) algorithms (i.e. blake2, md5, shake/sha3) depending on
the runtime configuration of OpenSSL.

…edforsecurity=False

When _hashlib/OpenSSL is available, and OpenSSL is in FIPS mode,
ensure that builtin (fallback) hash implementations are wrapped with a
check for usedforsecurity=False. It is likely that buitin
implementations are FIPS unapproved (either algorithm disallowed; or
the implementation not certified by NIST).

This enables strict approved-only compliance when usedforsecurity=True
on FIPS systems only.

And yet it also enables fallback access with usedforsecurity=False for
any missing (historical, disallowed or missing certified
implementation) algorithms (i.e. blake2, md5, shake/sha3) depending on
the runtime configuration of OpenSSL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant