-
Notifications
You must be signed in to change notification settings - Fork 122
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
Cross library PQ interop test with s2n-tls #2138
base: main
Are you sure you want to change the base?
Changes from 2 commits
a1f19ed
88b28c8
4911902
b5f9df5
d2b8124
cf1df0c
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
set -ex | ||
|
||
source tests/ci/common_posix_setup.sh | ||
|
||
scratch_folder=${SYS_ROOT}/"s2n-scratch" | ||
s2n_url='https://github.com/aws/s2n-tls.git' | ||
s2n_branch='main' | ||
lc_url='https://github.com/aws/aws-lc.git' | ||
lc_branch='main' | ||
|
||
mkdir -p "${scratch_folder}" | ||
rm -rf "${scratch_folder:?}"/* | ||
|
||
# clone s2n-tls | ||
git clone --depth 1 --branch "${s2n_branch}" "${s2n_url}" "${scratch_folder}/s2n-tls" | ||
|
||
# clone aws-lc | ||
git clone --depth 1 --branch "${lc_branch}" "${lc_url}" "${scratch_folder}/s2n-tls/aws-lc" | ||
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. This shouldn't need to clone AWS-LC since it will already be there when run locally or run in codebuild. |
||
|
||
# build aws-lc | ||
echo "building aws-lc" | ||
cd "${scratch_folder}/s2n-tls/aws-lc" | ||
cmake -GNinja -B build | ||
ninja -C build | ||
cmake --install build --prefix install | ||
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. Use the |
||
|
||
# build s2n-tls with aws-lc | ||
echo "building s2n_tls" | ||
cd "${scratch_folder}/s2n-tls" | ||
cmake . -Bbuild-with-lc \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_PREFIX_PATH=aws-lc/install | ||
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. Update this to use the correct LC location after making the change to how it gets built. |
||
cmake --build build-with-lc | ||
|
||
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. Please refactor this to loop across different TLS groups to cut down on the repetition.
|
||
# handshake test 1 - aws-lc bssl server with s2n-tls s2nc client for X25519MLKEM768:X25519 | ||
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. Add a comment explaining how all this works. It's not immediately apparent what all these workarounds do. e.g. the |
||
cd "${scratch_folder}/s2n-tls" | ||
./aws-lc/build/tool/bssl s_server -curves X25519MLKEM768:X25519 -accept 45000 -debug &> s_server_out & | ||
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. Don't test against the purely classical |
||
sleep 2 | ||
S_PID=$! | ||
./build-with-lc/bin/s2nc -c default_pq -i localhost 45000 &> s2nc_out | ||
wait $S_PID || true | ||
grep "libcrypto" s2nc_out | grep "AWS-LC" | ||
grep "CONNECTED" s2nc_out | ||
|
||
# handshake test 2 - s2n-tls s2nd server with aws-lc bssl client for X25519MLKEM768:X25519 | ||
cd "${scratch_folder}/s2n-tls" | ||
./build-with-lc/bin/s2nd -c default_pq -i localhost 45000 &> s2nd_out & | ||
sleep 2 | ||
S_PID=$! | ||
./aws-lc/build/tool/bssl s_client -curves X25519MLKEM768:X25519 -connect localhost:45000 -debug &> s_client_out & | ||
wait $S_PID || true | ||
grep "libcrypto" s2nd_out | grep "AWS-LC" | ||
grep "CONNECTED" s2nd_out | ||
|
||
# handshake test 3 - aws-lc bssl server with s2n-tls s2nc client for SecP256r1MLKEM768 | ||
cd "${scratch_folder}/s2n-tls" | ||
./aws-lc/build/tool/bssl s_server -curves SecP256r1MLKEM768 -accept 45000 -debug &> s_server_out & | ||
sleep 2 | ||
S_PID=$! | ||
./build-with-lc/bin/s2nc -c default_pq -i localhost 45000 &> s2nc_out | ||
wait $S_PID || true | ||
grep "libcrypto" s2nc_out | grep "AWS-LC" | ||
grep "CONNECTED" s2nc_out | ||
|
||
# handshake test 4 - s2n-tls s2nd server with aws-lc bssl client for SecP256r1MLKEM768 | ||
cd "${scratch_folder}/s2n-tls" | ||
./build-with-lc/bin/s2nd -c default_pq -i localhost 45000 &> s2nd_out & | ||
sleep 2 | ||
S_PID=$! | ||
./aws-lc/build/tool/bssl s_client -curves SecP256r1MLKEM768 -connect localhost:45000 -debug &> s_client_out & | ||
wait $S_PID || true | ||
grep "libcrypto" s2nd_out | grep "AWS-LC" | ||
grep "CONNECTED" s2nd_out | ||
|
||
rm -rf "${scratch_folder:?}"/* |
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.
Rename this to be more generic across PQ-TLS implementations. e.g.
run_pq_tls_interop_test.sh
.