-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135401: Test AWS-LC as a cryptography library in CI #135402
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
Draft
WillChilds-Klein
wants to merge
20
commits into
python:main
Choose a base branch
from
WillChilds-Klein:add-awslc-ci-job
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+149
−33
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
57209fe
First cut, minimal testing
WillChilds-Klein 8fb1016
Various fixups, multissl.py works to build AWS-LC
WillChilds-Klein 67fd836
Add linkage check
WillChilds-Klein 4f0928b
Fix line break in configure command
WillChilds-Klein b65d662
Fix more formatting
WillChilds-Klein 6791473
Fix more formatting
WillChilds-Klein 269dc10
📜🤖 Added by blurb_it.
blurb-it[bot] cd74e2b
Fix all-required-greed target
WillChilds-Klein 24fbecf
Fix aws-lc build dir path
WillChilds-Klein fa08737
Remove NID_blake2b512 from hashlib dependency test in ./configure
WillChilds-Klein 3f3a70b
Remove NID_blake2b512 from configure.ac
WillChilds-Klein 7d37e6a
Tryi setting --with-openssl-rpath in configure invocation
WillChilds-Klein 6eb1190
Revert "Tryi setting --with-openssl-rpath in configure invocation"
WillChilds-Klein 8f4a0eb
Guard new hashlib ctor test
WillChilds-Klein 7ebee26
Update Tools/ssl/multissltests.py
WillChilds-Klein 840923d
Update Tools/ssl/multissltests.py
WillChilds-Klein 3850ba0
Update Misc/NEWS.d/next/Tests/2025-06-11-16-52-49.gh-issue-135401.ccM…
WillChilds-Klein be1b72c
Remove TODOs per PR feedback, remove this as required CI job
WillChilds-Klein c655484
Check for SHA-512 instead of BLAKE in configure
WillChilds-Klein 99df7d5
Simplify multissltests.py builders
WillChilds-Klein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ apt-get -yq install \ | |
build-essential \ | ||
pkg-config \ | ||
ccache \ | ||
cmake \ | ||
gdb \ | ||
lcov \ | ||
libb2-dev \ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Tests/2025-06-11-16-52-49.gh-issue-135401.ccMXmL.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Add a new GitHub CI job to test the :py:mod:`ssl` module with AWS-LC__ as the backing cryptography and TLS library. | ||
|
||
__ https://github.com/aws/aws-lc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,12 +1,12 @@ | ||||||
#!./python | ||||||
"""Run Python tests against multiple installations of OpenSSL and LibreSSL | ||||||
"""Run Python tests against multiple installations of crypto libraries | ||||||
|
||||||
The script | ||||||
|
||||||
(1) downloads OpenSSL / LibreSSL tar bundle | ||||||
(1) downloads the tar bundle | ||||||
(2) extracts it to ./src | ||||||
(3) compiles OpenSSL / LibreSSL | ||||||
(4) installs OpenSSL / LibreSSL into ../multissl/$LIB/$VERSION/ | ||||||
(3) compiles the relevant library | ||||||
(4) installs that library into ../multissl/$LIB/$VERSION/ | ||||||
(5) forces a recompilation of Python modules using the | ||||||
header and library files from ../multissl/$LIB/$VERSION/ | ||||||
(6) runs Python's test suite | ||||||
|
@@ -61,6 +61,10 @@ | |||||
LIBRESSL_RECENT_VERSIONS = [ | ||||||
] | ||||||
|
||||||
AWSLC_RECENT_VERSIONS = [ | ||||||
"1.52.1", | ||||||
] | ||||||
|
||||||
# store files in ../multissl | ||||||
HERE = os.path.dirname(os.path.abspath(__file__)) | ||||||
PYTHONROOT = os.path.abspath(os.path.join(HERE, '..', '..')) | ||||||
|
@@ -70,7 +74,7 @@ | |||||
parser = argparse.ArgumentParser( | ||||||
prog='multissl', | ||||||
description=( | ||||||
"Run CPython tests with multiple OpenSSL and LibreSSL " | ||||||
"Run CPython tests with multiple crypto libraries" | ||||||
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.
Suggested change
|
||||||
"versions." | ||||||
) | ||||||
) | ||||||
|
@@ -102,6 +106,14 @@ | |||||
"OpenSSL and LibreSSL versions are given." | ||||||
).format(LIBRESSL_RECENT_VERSIONS, LIBRESSL_OLD_VERSIONS) | ||||||
) | ||||||
parser.add_argument( | ||||||
'--awslc', | ||||||
nargs='+', | ||||||
default=(), | ||||||
help=( | ||||||
"AWS-LC versions, defaults to '{}'." | ||||||
).format(AWSLC_RECENT_VERSIONS) | ||||||
) | ||||||
parser.add_argument( | ||||||
'--tests', | ||||||
nargs='*', | ||||||
|
@@ -111,7 +123,7 @@ | |||||
parser.add_argument( | ||||||
'--base-directory', | ||||||
default=MULTISSL_DIR, | ||||||
help="Base directory for OpenSSL / LibreSSL sources and builds." | ||||||
help="Base directory for crypto library sources and builds." | ||||||
) | ||||||
parser.add_argument( | ||||||
'--no-network', | ||||||
|
@@ -124,8 +136,8 @@ | |||||
choices=['library', 'modules', 'tests'], | ||||||
default='tests', | ||||||
help=( | ||||||
"Which steps to perform. 'library' downloads and compiles OpenSSL " | ||||||
"or LibreSSL. 'module' also compiles Python modules. 'tests' builds " | ||||||
"Which steps to perform. 'library' downloads and compiles a crypto" | ||||||
"library. 'module' also compiles Python modules. 'tests' builds " | ||||||
"all and runs the test suite." | ||||||
) | ||||||
) | ||||||
|
@@ -453,6 +465,34 @@ class BuildLibreSSL(AbstractBuilder): | |||||
build_template = "libressl-{}" | ||||||
|
||||||
|
||||||
class BuildAWSLC(AbstractBuilder): | ||||||
library = "AWS-LC" | ||||||
url_templates = ( | ||||||
"https://github.com/aws/aws-lc/archive/refs/tags/v{v}.tar.gz", | ||||||
) | ||||||
src_template = "aws-lc-{}.tar.gz" | ||||||
build_template = "aws-lc-{}" | ||||||
|
||||||
def _build_src(self, config_args=()): | ||||||
cwd = self.build_dir | ||||||
log.info("Running build in {}".format(cwd)) | ||||||
env = os.environ.copy() | ||||||
env["LD_RUN_PATH"] = self.lib_dir # set rpath | ||||||
if self.system: | ||||||
env['SYSTEM'] = self.system | ||||||
cmd = [ | ||||||
"cmake", | ||||||
"-DCMAKE_BUILD_TYPE=RelWithDebInfo", | ||||||
"-DCMAKE_PREFIX_PATH={}".format(self.install_dir), | ||||||
"-DCMAKE_INSTALL_PREFIX={}".format(self.install_dir), | ||||||
"-DBUILD_SHARED_LIBS=ON", | ||||||
"-DBUILD_TESTING=OFF", | ||||||
"-DFIPS=OFF", | ||||||
] | ||||||
self._subprocess_call(cmd, cwd=cwd, env=env) | ||||||
self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env) | ||||||
|
||||||
|
||||||
def configure_make(): | ||||||
if not os.path.isfile('Makefile'): | ||||||
log.info('Running ./configure') | ||||||
|
@@ -467,9 +507,10 @@ def configure_make(): | |||||
|
||||||
def main(): | ||||||
args = parser.parse_args() | ||||||
if not args.openssl and not args.libressl: | ||||||
if not args.openssl and not args.libressl and not args.awslc: | ||||||
args.openssl = list(OPENSSL_RECENT_VERSIONS) | ||||||
args.libressl = list(LIBRESSL_RECENT_VERSIONS) | ||||||
args.awslc = list(AWSLC_RECENT_VERSIONS) | ||||||
if not args.disable_ancient: | ||||||
args.openssl.extend(OPENSSL_OLD_VERSIONS) | ||||||
args.libressl.extend(LIBRESSL_OLD_VERSIONS) | ||||||
|
@@ -496,22 +537,15 @@ def main(): | |||||
|
||||||
# download and register builder | ||||||
builds = [] | ||||||
|
||||||
for version in args.openssl: | ||||||
build = BuildOpenSSL( | ||||||
version, | ||||||
args | ||||||
) | ||||||
build.install() | ||||||
builds.append(build) | ||||||
|
||||||
for version in args.libressl: | ||||||
build = BuildLibreSSL( | ||||||
version, | ||||||
args | ||||||
) | ||||||
build.install() | ||||||
builds.append(build) | ||||||
for build_class, versions in [ | ||||||
(BuildOpenSSL, args.openssl), | ||||||
(BuildLibreSSL, args.libressl), | ||||||
(BuildAWSLC, args.awslc), | ||||||
]: | ||||||
for version in versions: | ||||||
build = build_class(version, args) | ||||||
build.install() | ||||||
builds.append(build) | ||||||
|
||||||
if args.steps in {'modules', 'tests'}: | ||||||
for build in builds: | ||||||
|
@@ -539,7 +573,7 @@ def main(): | |||||
else: | ||||||
print('Executed all SSL tests.') | ||||||
|
||||||
print('OpenSSL / LibreSSL versions:') | ||||||
print('OpenSSL / LibreSSL / AWS-LC versions:') | ||||||
for build in builds: | ||||||
print(" * {0.library} {0.version}".format(build)) | ||||||
|
||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
I agree that "crypto" is unfortunate shorthand. Not to get too deep in the semantic weeds, but I wonder if "cryptography" might be more appropriate than "cryptographic". The former noun-based nomenclature is more idiomatic when referring to libraries ("compression library", "serialization library", etc.) while the latter's adjective seems a bit off.
I don't have a strong preference, what do you think @AA-Turner?
by the way, thank you for the quick review :)
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.
libcrypto
is the OpenSSL cryptographic library, and the other libs (BoringSSL, LibreSSL) are forks. So I'd prefer keepingcrypto
here or uselibcrypto