-
Notifications
You must be signed in to change notification settings - Fork 0
FIPS Adaptations #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,9 @@ sed "${sed_args[@]}" "s|/tools/host|${TOOLS_PATH}/host|g" ${TOOLS_PATH}/host/sha | |
# We force linking of external static libraries by removing the shared | ||
# libraries. This is hacky. But we're building in a temporary container | ||
# and it gets the job done. | ||
find ${TOOLS_PATH}/deps -name '*.so*' -exec rm {} \; | ||
# FIPS: In order to build FIPS compatible Python, we don't want to | ||
# remove the shared libraries libssl and libcrypto | ||
find ${TOOLS_PATH}/deps -name '*.so*' ! -name 'libssl.*' ! -name 'libcrypto.*' -exec rm {} \; | ||
|
||
tar -xf Python-${PYTHON_VERSION}.tar.xz | ||
|
||
|
@@ -389,7 +391,7 @@ CONFIGURE_FLAGS=" | |
--build=${BUILD_TRIPLE} | ||
--host=${TARGET_TRIPLE} | ||
--prefix=/install | ||
--with-openssl=${TOOLS_PATH}/deps | ||
--with-builtin-hashlib-hashes=sha256,sha512 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important! |
||
--with-system-expat | ||
--with-system-libmpdec | ||
--without-ensurepip | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,14 @@ EXTRA_TARGET_CFLAGS=${EXTRA_TARGET_CFLAGS/\-arch x86_64/} | |
|
||
EXTRA_FLAGS="${EXTRA_FLAGS} ${EXTRA_TARGET_CFLAGS}" | ||
|
||
# FIPS: Notice the 'fips' and 'shared' flags | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important! |
||
/usr/bin/perl ./Configure \ | ||
fips \ | ||
--prefix=/tools/deps \ | ||
--libdir=lib \ | ||
${OPENSSL_TARGET} \ | ||
no-legacy \ | ||
no-shared \ | ||
shared \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
no-tests \ | ||
${EXTRA_FLAGS} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,11 +492,15 @@ def derive_setup_local( | |
enabled_extensions[name]["setup_line"] = name.encode("ascii") | ||
continue | ||
|
||
# Force static linking if we're doing a fully static build, otherwise, | ||
# respect the `build-mode` falling back to `static` if not defined. | ||
section = ( | ||
"static" if "static" in build_options else info.get("build-mode", "static") | ||
) | ||
# FIPS: Always shared | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important! |
||
if name in ("_ssl", "_hashlib"): | ||
section = "shared" | ||
else: | ||
# Force static linking if we're doing a fully static build, otherwise, | ||
# respect the `build-mode` falling back to `static` if not defined. | ||
section = ( | ||
"static" if "static" in build_options else info.get("build-mode", "static") | ||
) | ||
enabled_extensions[name]["build-mode"] = section | ||
|
||
# Presumably this means the extension comes from the distribution's | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,10 +245,10 @@ | |
# using the latest available. | ||
# Remember to update OPENSSL_VERSION_INFO in verify_distribution.py whenever upgrading. | ||
"openssl-3.0": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important! |
||
"url": "https://www.openssl.org/source/openssl-3.0.16.tar.gz", | ||
"size": 15334967, | ||
"sha256": "57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86", | ||
"version": "3.0.16", | ||
"url": "https://www.openssl.org/source/openssl-3.0.2.tar.gz", | ||
"size": 15038141, | ||
"sha256": "98e91ccead4d4756ae3c9cde5e09191a8e586d9f4d50838e7ec09d6411dfdb63", | ||
"version": "3.0.2", | ||
"library_names": ["crypto", "ssl"], | ||
"licenses": ["Apache-2.0"], | ||
"license_file": "LICENSE.openssl-3.txt", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important!