Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions relenv/build/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
builds,
finalize,
get_dependency_version,
patch_file,
update_sbom_checksums,
)

Expand Down Expand Up @@ -150,6 +151,19 @@ def build_python(env: MutableMapping[str, str], dirs: Dirs, logfp: IO[str]) -> N
# Update bundled expat to latest version
update_expat(dirs, env)

# CPython 3.14.10 shipped a bad backport of gh-149816 (upstream PR #160006)
# that dropped the "!" from `int fips = !disable_fips_property(py_ht);` in
# Modules/_hashopenssl.c. The inverted polarity makes openssl_md5(
# usedforsecurity=False) fail under FIPS, so hashlib falls back to the
# builtin MD5 and silently bypasses FIPS enforcement. Idempotent: the
# correctly-fixed source has "!disable_fips_property" which this regex
# does not match. Remove once a CPython 3.14 point release ships the fix.
patch_file(
dirs.source / "Modules" / "_hashopenssl.c",
r"int fips = disable_fips_property\(",
"int fips = !disable_fips_property(",
)

env["LDFLAGS"] = "-Wl,-rpath,{prefix}/lib {ldflags}".format(prefix=dirs.prefix, ldflags=env["LDFLAGS"])
runcmd(
[
Expand Down
14 changes: 14 additions & 0 deletions relenv/build/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
builds,
finalize,
get_dependency_version,
patch_file,
update_sbom_checksums,
)

Expand Down Expand Up @@ -507,6 +508,19 @@ def build_python(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
# Update bundled expat to latest version
update_expat(dirs, env)

# CPython 3.14.10 shipped a bad backport of gh-149816 (upstream PR #160006)
# that dropped the "!" from `int fips = !disable_fips_property(py_ht);` in
# Modules/_hashopenssl.c. The inverted polarity makes openssl_md5(
# usedforsecurity=False) fail under FIPS, so hashlib falls back to the
# builtin MD5 and silently bypasses FIPS enforcement. Idempotent: the
# correctly-fixed source has "!disable_fips_property" which this regex
# does not match. Remove once a CPython 3.14 point release ships the fix.
patch_file(
dirs.source / "Modules" / "_hashopenssl.c",
r"int fips = disable_fips_property\(",
"int fips = !disable_fips_property(",
)

ldflagopt = f"-Wl,--rpath={dirs.prefix}/lib"
if ldflagopt not in env["LDFLAGS"]:
env["LDFLAGS"] = f"{ldflagopt} {env['LDFLAGS']}"
Expand Down
13 changes: 13 additions & 0 deletions relenv/build/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,19 @@ def build_python(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:

patch_ssl_for_cpython_104135(dirs.source)

# CPython 3.14.10 shipped a bad backport of gh-149816 (upstream PR #160006)
# that dropped the "!" from `int fips = !disable_fips_property(py_ht);` in
# Modules/_hashopenssl.c. The inverted polarity makes openssl_md5(
# usedforsecurity=False) fail under FIPS, so hashlib falls back to the
# builtin MD5 and silently bypasses FIPS enforcement. Idempotent: the
# correctly-fixed source has "!disable_fips_property" which this regex
# does not match. Remove once a CPython 3.14 point release ships the fix.
patch_file(
dirs.source / "Modules" / "_hashopenssl.c",
r"int fips = disable_fips_property\(",
"int fips = !disable_fips_property(",
)

arch_to_plat = {"amd64": "x64", "x86": "win32", "arm64": "arm64"}
arch = env["RELENV_HOST_ARCH"]
plat = arch_to_plat[arch]
Expand Down
Loading