| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7f1e66a commit db47f4d
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -260,7 +260,7 @@ jobs: | |||
| 260 | 260 | free-threading: ${{ matrix.free-threading }} | |
| 261 | 261 | os: ${{ matrix.os }} | |
| 262 | 262 | ||
| 263 | - build-ubuntu-ssltests: | ||
| 263 | + build-ubuntu-ssltests-openssl: | ||
| 264 | 264 | name: 'Ubuntu SSL tests with OpenSSL' | |
| 265 | 265 | runs-on: ${{ matrix.os }} | |
| 266 | 266 | timeout-minutes: 60 | |
@@ -322,6 +322,81 @@ jobs: | |||
| 322 | 322 | - name: SSL tests | |
| 323 | 323 | run: ./python Lib/test/ssltests.py | |
| 324 | 324 | ||
| 325 | + build-ubuntu-ssltests-awslc: | ||
| 326 | + name: 'Ubuntu SSL tests with AWS-LC' | ||
| 327 | + runs-on: ${{ matrix.os }} | ||
| 328 | + timeout-minutes: 60 | ||
| 329 | + needs: build-context | ||
| 330 | + if: needs.build-context.outputs.run-tests == 'true' | ||
| 331 | + strategy: | ||
| 332 | + fail-fast: false | ||
| 333 | + matrix: | ||
| 334 | + os: [ubuntu-24.04] | ||
| 335 | + awslc_ver: [1.55.0] | ||
| 336 | + env: | ||
| 337 | + AWSLC_VER: ${{ matrix.awslc_ver}} | ||
| 338 | + MULTISSL_DIR: ${{ github.workspace }}/multissl | ||
| 339 | + OPENSSL_DIR: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }} | ||
| 340 | + LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}/lib | ||
| 341 | + steps: | ||
| 342 | + - uses: actions/checkout@v4 | ||
| 343 | + with: | ||
| 344 | + persist-credentials: false | ||
| 345 | + - name: Runner image version | ||
| 346 | + run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV" | ||
| 347 | + - name: Restore config.cache | ||
| 348 | + uses: actions/cache@v4 | ||
| 349 | + with: | ||
| 350 | + path: config.cache | ||
| 351 | + key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }} | ||
| 352 | + - name: Register gcc problem matcher | ||
| 353 | + run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
| 354 | + - name: Install dependencies | ||
| 355 | + run: sudo ./.github/workflows/posix-deps-apt.sh | ||
| 356 | + - name: Configure SSL lib env vars | ||
| 357 | + run: | | ||
| 358 | + echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV" | ||
| 359 | + echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}" >> "$GITHUB_ENV" | ||
| 360 | + echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}/lib" >> "$GITHUB_ENV" | ||
| 361 | + - name: 'Restore AWS-LC build' | ||
| 362 | + id: cache-aws-lc | ||
| 363 | + uses: actions/cache@v4 | ||
| 364 | + with: | ||
| 365 | + path: ./multissl/aws-lc/${{ matrix.awslc_ver }} | ||
| 366 | + key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }} | ||
| 367 | + - name: Install AWS-LC | ||
| 368 | + if: steps.cache-aws-lc.outputs.cache-hit != 'true' | ||
| 369 | + run: | | ||
| 370 | + python3 Tools/ssl/multissltests.py \ | ||
| 371 | + --steps=library \ | ||
| 372 | + --base-directory "$MULTISSL_DIR" \ | ||
| 373 | + --awslc ${{ matrix.awslc_ver }} \ | ||
| 374 | + --system Linux | ||
| 375 | + - name: Add ccache to PATH | ||
| 376 | + run: | | ||
| 377 | + echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV" | ||
| 378 | + - name: Configure ccache action | ||
| 379 | + uses: hendrikmuhs/ccache-action@v1.2 | ||
| 380 | + with: | ||
| 381 | + save: false | ||
| 382 | + - name: Configure CPython | ||
| 383 | + run: | | ||
| 384 | + ./configure CFLAGS="-fdiagnostics-format=json" \ | ||
| 385 | + --config-cache \ | ||
| 386 | + --enable-slower-safety \ | ||
| 387 | + --with-pydebug \ | ||
| 388 | + --with-openssl="$OPENSSL_DIR" \ | ||
| 389 | + --with-builtin-hashlib-hashes=blake2 \ | ||
| 390 | + --with-ssl-default-suites=openssl | ||
| 391 | + - name: Build CPython | ||
| 392 | + run: make -j | ||
| 393 | + - name: Display build info | ||
| 394 | + run: make pythoninfo | ||
| 395 | + - name: Verify python is linked to AWS-LC | ||
| 396 | + run: ./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | grep AWS-LC | ||
| 397 | + - name: SSL tests | ||
| 398 | + run: ./python Lib/test/ssltests.py | ||
| 399 | + | ||
| 325 | 400 | build-wasi: | |
| 326 | 401 | name: 'WASI' | |
| 327 | 402 | needs: build-context | |
@@ -628,7 +703,8 @@ jobs: | |||
| 628 | 703 | - build-windows-msi | |
| 629 | 704 | - build-macos | |
| 630 | 705 | - build-ubuntu | |
| 631 | - - build-ubuntu-ssltests | ||
| 706 | + - build-ubuntu-ssltests-awslc | ||
| 707 | + - build-ubuntu-ssltests-openssl | ||
| 632 | 708 | - build-wasi | |
| 633 | 709 | - test-hypothesis | |
| 634 | 710 | - build-asan | |
@@ -643,7 +719,8 @@ jobs: | |||
| 643 | 719 | with: | |
| 644 | 720 | allowed-failures: >- | |
| 645 | 721 | build-windows-msi, | |
| 646 | - build-ubuntu-ssltests, | ||
| 722 | + build-ubuntu-ssltests-awslc, | ||
| 723 | + build-ubuntu-ssltests-openssl, | ||
| 647 | 724 | test-hypothesis, | |
| 648 | 725 | cifuzz, | |
| 649 | 726 | allowed-skips: >- | |
@@ -661,7 +738,8 @@ jobs: | |||
| 661 | 738 | check-generated-files, | |
| 662 | 739 | build-macos, | |
| 663 | 740 | build-ubuntu, | |
| 664 | - build-ubuntu-ssltests, | ||
| 741 | + build-ubuntu-ssltests-awslc, | ||
| 742 | + build-ubuntu-ssltests-openssl, | ||
| 665 | 743 | build-wasi, | |
| 666 | 744 | test-hypothesis, | |
| 667 | 745 | build-asan, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ apt-get -yq install \ | |||
| 5 | 5 | build-essential \ | |
| 6 | 6 | pkg-config \ | |
| 7 | 7 | ccache \ | |
| 8 | + cmake \ | ||
| 8 | 9 | gdb \ | |
| 9 | 10 | lcov \ | |
| 10 | 11 | libb2-dev \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Add a new GitHub CI job to test the :mod:`ssl` module with `AWS-LC <https://github.com/aws/aws-lc>`_ as the backing cryptography and TLS library. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,12 @@ | |||
| 1 | 1 | #!./python | |
| 2 | - """Run Python tests against multiple installations of OpenSSL and LibreSSL | ||
| 2 | + """Run Python tests against multiple installations of cryptography libraries | ||
| 3 | 3 | ||
| 4 | 4 | The script | |
| 5 | 5 | ||
| 6 | - (1) downloads OpenSSL / LibreSSL tar bundle | ||
| 6 | + (1) downloads the tar bundle | ||
| 7 | 7 | (2) extracts it to ./src | |
| 8 | - (3) compiles OpenSSL / LibreSSL | ||
| 9 | - (4) installs OpenSSL / LibreSSL into ../multissl/$LIB/$VERSION/ | ||
| 8 | + (3) compiles the relevant library | ||
| 9 | + (4) installs that library into ../multissl/$LIB/$VERSION/ | ||
| 10 | 10 | (5) forces a recompilation of Python modules using the | |
| 11 | 11 | header and library files from ../multissl/$LIB/$VERSION/ | |
| 12 | 12 | (6) runs Python's test suite | |
@@ -61,6 +61,10 @@ | |||
| 61 | 61 | LIBRESSL_RECENT_VERSIONS = [ | |
| 62 | 62 | ] | |
| 63 | 63 | ||
| 64 | + AWSLC_RECENT_VERSIONS = [ | ||
| 65 | + "1.55.0", | ||
| 66 | + ] | ||
| 67 | + | ||
| 64 | 68 | # store files in ../multissl | |
| 65 | 69 | HERE = os.path.dirname(os.path.abspath(__file__)) | |
| 66 | 70 | PYTHONROOT = os.path.abspath(os.path.join(HERE, '..', '..')) | |
@@ -70,9 +74,9 @@ | |||
| 70 | 74 | parser = argparse.ArgumentParser( | |
| 71 | 75 | prog='multissl', | |
| 72 | 76 | description=( | |
| 73 | - "Run CPython tests with multiple OpenSSL and LibreSSL " | ||
| 77 | + "Run CPython tests with multiple cryptography libraries" | ||
| 74 | 78 | "versions." | |
| 75 | - ) | ||
| 79 | + ), | ||
| 76 | 80 | ) | |
| 77 | 81 | parser.add_argument( | |
| 78 | 82 | '--debug', | |
@@ -102,6 +106,14 @@ | |||
| 102 | 106 | "OpenSSL and LibreSSL versions are given." | |
| 103 | 107 | ).format(LIBRESSL_RECENT_VERSIONS, LIBRESSL_OLD_VERSIONS) | |
| 104 | 108 | ) | |
| 109 | + parser.add_argument( | ||
| 110 | + '--awslc', | ||
| 111 | + nargs='+', | ||
| 112 | + default=(), | ||
| 113 | + help=( | ||
| 114 | + "AWS-LC versions, defaults to '{}' if no crypto library versions are given." | ||
| 115 | + ).format(AWSLC_RECENT_VERSIONS) | ||
| 116 | + ) | ||
| 105 | 117 | parser.add_argument( | |
| 106 | 118 | '--tests', | |
| 107 | 119 | nargs='*', | |
@@ -111,7 +123,7 @@ | |||
| 111 | 123 | parser.add_argument( | |
| 112 | 124 | '--base-directory', | |
| 113 | 125 | default=MULTISSL_DIR, | |
| 114 | - help="Base directory for OpenSSL / LibreSSL sources and builds." | ||
| 126 | + help="Base directory for crypto library sources and builds." | ||
| 115 | 127 | ) | |
| 116 | 128 | parser.add_argument( | |
| 117 | 129 | '--no-network', | |
@@ -124,8 +136,8 @@ | |||
| 124 | 136 | choices=['library', 'modules', 'tests'], | |
| 125 | 137 | default='tests', | |
| 126 | 138 | help=( | |
| 127 | - "Which steps to perform. 'library' downloads and compiles OpenSSL " | ||
| 128 | - "or LibreSSL. 'module' also compiles Python modules. 'tests' builds " | ||
| 139 | + "Which steps to perform. 'library' downloads and compiles a crypto" | ||
| 140 | + "library. 'module' also compiles Python modules. 'tests' builds " | ||
| 129 | 141 | "all and runs the test suite." | |
| 130 | 142 | ) | |
| 131 | 143 | ) | |
@@ -453,6 +465,34 @@ class BuildLibreSSL(AbstractBuilder): | |||
| 453 | 465 | build_template = "libressl-{}" | |
| 454 | 466 | ||
| 455 | 467 | ||
| 468 | + class BuildAWSLC(AbstractBuilder): | ||
| 469 | + library = "AWS-LC" | ||
| 470 | + url_templates = ( | ||
| 471 | + "https://github.com/aws/aws-lc/archive/refs/tags/v{v}.tar.gz", | ||
| 472 | + ) | ||
| 473 | + src_template = "aws-lc-{}.tar.gz" | ||
| 474 | + build_template = "aws-lc-{}" | ||
| 475 | + | ||
| 476 | + def _build_src(self, config_args=()): | ||
| 477 | + cwd = self.build_dir | ||
| 478 | + log.info("Running build in {}".format(cwd)) | ||
| 479 | + env = os.environ.copy() | ||
| 480 | + env["LD_RUN_PATH"] = self.lib_dir # set rpath | ||
| 481 | + if self.system: | ||
| 482 | + env['SYSTEM'] = self.system | ||
| 483 | + cmd = [ | ||
| 484 | + "cmake", | ||
| 485 | + "-DCMAKE_BUILD_TYPE=RelWithDebInfo", | ||
| 486 | + "-DCMAKE_PREFIX_PATH={}".format(self.install_dir), | ||
| 487 | + "-DCMAKE_INSTALL_PREFIX={}".format(self.install_dir), | ||
| 488 | + "-DBUILD_SHARED_LIBS=ON", | ||
| 489 | + "-DBUILD_TESTING=OFF", | ||
| 490 | + "-DFIPS=OFF", | ||
| 491 | + ] | ||
| 492 | + self._subprocess_call(cmd, cwd=cwd, env=env) | ||
| 493 | + self._subprocess_call(["make", "-j{}".format(self.jobs)], cwd=cwd, env=env) | ||
| 494 | + | ||
| 495 | + | ||
| 456 | 496 | def configure_make(): | |
| 457 | 497 | if not os.path.isfile('Makefile'): | |
| 458 | 498 | log.info('Running ./configure') | |
@@ -467,9 +507,10 @@ def configure_make(): | |||
| 467 | 507 | ||
| 468 | 508 | def main(): | |
| 469 | 509 | args = parser.parse_args() | |
| 470 | - if not args.openssl and not args.libressl: | ||
| 510 | + if not args.openssl and not args.libressl and not args.awslc: | ||
| 471 | 511 | args.openssl = list(OPENSSL_RECENT_VERSIONS) | |
| 472 | 512 | args.libressl = list(LIBRESSL_RECENT_VERSIONS) | |
| 513 | + args.awslc = list(AWSLC_RECENT_VERSIONS) | ||
| 473 | 514 | if not args.disable_ancient: | |
| 474 | 515 | args.openssl.extend(OPENSSL_OLD_VERSIONS) | |
| 475 | 516 | args.libressl.extend(LIBRESSL_OLD_VERSIONS) | |
@@ -496,22 +537,15 @@ def main(): | |||
| 496 | 537 | ||
| 497 | 538 | # download and register builder | |
| 498 | 539 | builds = [] | |
| 499 | - | ||
| 500 | - for version in args.openssl: | ||
| 501 | - build = BuildOpenSSL( | ||
| 502 | - version, | ||
| 503 | - args | ||
| 504 | - ) | ||
| 505 | - build.install() | ||
| 506 | - builds.append(build) | ||
| 507 | - | ||
| 508 | - for version in args.libressl: | ||
| 509 | - build = BuildLibreSSL( | ||
| 510 | - version, | ||
| 511 | - args | ||
| 512 | - ) | ||
| 513 | - build.install() | ||
| 514 | - builds.append(build) | ||
| 540 | + for build_class, versions in [ | ||
| 541 | + (BuildOpenSSL, args.openssl), | ||
| 542 | + (BuildLibreSSL, args.libressl), | ||
| 543 | + (BuildAWSLC, args.awslc), | ||
| 544 | + ]: | ||
| 545 | + for version in versions: | ||
| 546 | + build = build_class(version, args) | ||
| 547 | + build.install() | ||
| 548 | + builds.append(build) | ||
| 515 | 549 | ||
| 516 | 550 | if args.steps in {'modules', 'tests'}: | |
| 517 | 551 | for build in builds: | |
@@ -539,7 +573,7 @@ def main(): | |||
| 539 | 573 | else: | |
| 540 | 574 | print('Executed all SSL tests.') | |
| 541 | 575 | ||
| 542 | - print('OpenSSL / LibreSSL versions:') | ||
| 576 | + print('OpenSSL / LibreSSL / AWS-LC versions:') | ||
| 543 | 577 | for build in builds: | |
| 544 | 578 | print(" * {0.library} {0.version}".format(build)) | |
| 545 | 579 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7529,8 +7529,8 @@ WITH_SAVE_ENV([ | |||
| 7529 | 7529 | ], [ | |
| 7530 | 7530 | OBJ_nid2sn(NID_md5); | |
| 7531 | 7531 | OBJ_nid2sn(NID_sha1); | |
| 7532 | + OBJ_nid2sn(NID_sha512); | ||
| 7532 | 7533 | OBJ_nid2sn(NID_sha3_512); | |
| 7533 | - OBJ_nid2sn(NID_blake2b512); | ||
| 7534 | 7534 | EVP_PBE_scrypt(NULL, 0, NULL, 0, 2, 8, 1, 0, NULL, 0); | |
| 7535 | 7535 | ])], [ac_cv_working_openssl_hashlib=yes], [ac_cv_working_openssl_hashlib=no]) | |
| 7536 | 7536 | ]) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments