Skip to content

Commit 4fc362f

Browse files
authored
Fix PQ Integration tests (#2392)
The BoringSSL command moved from `${SCRATCH_FOLDER}/boring-ssl-build/tool/bssl` to `${SCRATCH_FOLDER}/boring-ssl-build/bssl`. This PR updates the PQ integration tests to validate that required binaries are present before attempting to use them.
1 parent d34e08b commit 4fc362f

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

tests/ci/integration/run_pq_tls_integration.sh

+22-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ SCRATCH_FOLDER=${SYS_ROOT}/"pq-tls-scratch"
99

1010
AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build"
1111
AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install"
12+
AWS_LC_CMD="${AWS_LC_BUILD_FOLDER}/tool/bssl"
1213

1314
S2N_URL='https://github.com/aws/s2n-tls.git'
1415
S2N_BRANCH='main'
1516
S2N_TLS_SRC_FOLDER="${SCRATCH_FOLDER}/s2n-tls"
1617
S2N_TLS_BUILD_FOLDER="${SCRATCH_FOLDER}/s2n-tls-build"
18+
S2NC_CMD=${S2N_TLS_BUILD_FOLDER}/bin/s2nc
19+
S2ND_CMD=${S2N_TLS_BUILD_FOLDER}/bin/s2nd
1720

1821
BSSL_URL='https://github.com/google/boringssl.git'
1922
BSSL_BRANCH='main'
2023
BSSL_SRC_FOLDER="${SCRATCH_FOLDER}/boring-ssl"
2124
BSSL_BUILD_FOLDER="${SCRATCH_FOLDER}/boring-ssl-build"
25+
BSSL_CMD="${SCRATCH_FOLDER}/boring-ssl-build/bssl"
2226

2327
rm -rf "${SCRATCH_FOLDER:?}"
2428
mkdir -p "$SCRATCH_FOLDER"
@@ -27,6 +31,9 @@ echo "build and install aws-lc"
2731
# Using Debug build as it uses the '-g' compiler flag with gcc without any optimization
2832
aws_lc_build "$SRC_ROOT" "$AWS_LC_BUILD_FOLDER" "$AWS_LC_INSTALL_FOLDER" -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF
2933

34+
[[ -f ${AWS_LC_CMD} ]] || ( echo "Error building AWS-LC. ${AWS_LC_CMD} not found." && exit 1 )
35+
echo "AWS-LC build succeeded. Found ${AWS_LC_CMD}"
36+
3037
echo "clone s2n-tls"
3138
git clone --depth 1 --branch "$S2N_BRANCH" "$S2N_URL" "$S2N_TLS_SRC_FOLDER"
3239

@@ -38,14 +45,18 @@ cmake . "-B$S2N_TLS_BUILD_FOLDER" -GNinja \
3845
# Suppress stdout for build
3946
ninja -C "$S2N_TLS_BUILD_FOLDER" -j "$NUM_CPU_THREADS" > /dev/null
4047

48+
[[ -f ${S2NC_CMD} ]] || ( echo "Error building s2nc. ${S2NC_CMD} not found." && exit 1 )
49+
[[ -f ${S2ND_CMD} ]] || ( echo "Error building s2nd. ${S2ND_CMD} not found." && exit 1 )
50+
echo "s2n build succeeded. Found: ${S2NC_CMD} ${S2ND_CMD}"
51+
4152
for GROUP in X25519MLKEM768 SecP256r1MLKEM768; do
4253
echo "TLS Handshake: aws-lc server (bssl) with s2n-tls client (s2nc) for group $GROUP"
43-
"$AWS_LC_BUILD_FOLDER"/tool/bssl s_server -curves $GROUP -accept 45000 -debug \
54+
${AWS_LC_CMD} s_server -curves $GROUP -accept 45000 -debug \
4455
&> "$AWS_LC_BUILD_FOLDER"/s_server_out &
4556
sleep 5 # to allow for the server to startup in the background thread
4657
S_PID=$!
4758
# Relying on s2nc behavior that it exits after the first handshake
48-
"$S2N_TLS_BUILD_FOLDER"/bin/s2nc -c default_pq -i localhost 45000 &> "$S2N_TLS_BUILD_FOLDER"/s2nc_out
59+
${S2NC_CMD} -c default_pq -i localhost 45000 &> "$S2N_TLS_BUILD_FOLDER"/s2nc_out
4960
wait $S_PID || true
5061
cat "$AWS_LC_BUILD_FOLDER"/s_server_out
5162
cat "$S2N_TLS_BUILD_FOLDER"/s2nc_out
@@ -54,12 +65,12 @@ for GROUP in X25519MLKEM768 SecP256r1MLKEM768; do
5465
grep "KEM Group" "$S2N_TLS_BUILD_FOLDER"/s2nc_out | grep "$GROUP"
5566

5667
echo "TLS Handshake: s2n-tls server (s2nd) with aws-lc client (bssl) for group $GROUP"
57-
"$S2N_TLS_BUILD_FOLDER"/bin/s2nd -c default_pq -i localhost 45000 &> "$S2N_TLS_BUILD_FOLDER"/s2nd_out &
68+
${S2ND_CMD} -c default_pq -i localhost 45000 &> "$S2N_TLS_BUILD_FOLDER"/s2nd_out &
5869
sleep 5 # to allow for the server to startup in the background thread
5970
S_PID=$!
6071
# bssl s_client normally does not exit after a handshake, but when run as a background process
6172
# seems to exit by closing the connection after the first handshake. Relying on that behavior here.
62-
"$AWS_LC_BUILD_FOLDER"/tool/bssl s_client -curves $GROUP -connect localhost:45000 -debug \
73+
${AWS_LC_CMD} s_client -curves $GROUP -connect localhost:45000 -debug \
6374
&> "$AWS_LC_BUILD_FOLDER"/s_client_out &
6475
wait $S_PID || true
6576
cat "$S2N_TLS_BUILD_FOLDER"/s2nd_out
@@ -82,14 +93,17 @@ cmake . "-B$BSSL_BUILD_FOLDER" -GNinja -DCMAKE_BUILD_TYPE=Debug
8293
# Suppress stdout for build
8394
ninja -C "$BSSL_BUILD_FOLDER" -j "$NUM_CPU_THREADS" >/dev/null
8495

96+
[[ -f ${BSSL_CMD} ]] || ( echo "Error building BoringSSL. ${BSSL_CMD} not found." && exit 1 )
97+
echo "BoringSSL build succeeded. Found ${BSSL_CMD}"
98+
8599
# BoringSSL supports only X25519MLKEM768 but not SecP256r1MLKEM768 for key exchange
86100
for GROUP in X25519MLKEM768; do
87101
echo "TLS Handshake: aws-lc server (bssl) with boring-ssl client (bssl) for group $GROUP"
88-
"$AWS_LC_BUILD_FOLDER"/tool/bssl s_server -curves $GROUP -accept 45000 -debug \
102+
${AWS_LC_CMD} s_server -curves $GROUP -accept 45000 -debug \
89103
&> "$AWS_LC_BUILD_FOLDER"/s_server_out &
90104
sleep 5 # to allow for the server to startup in the background thread
91105
S_PID=$!
92-
"$BSSL_BUILD_FOLDER"/tool/bssl s_client -curves $GROUP -connect localhost:45000 -debug \
106+
${BSSL_CMD} s_client -curves $GROUP -connect localhost:45000 -debug \
93107
&> "$BSSL_BUILD_FOLDER"/s_client_out &
94108
wait $S_PID || true
95109
cat "$AWS_LC_BUILD_FOLDER"/s_server_out
@@ -101,11 +115,11 @@ for GROUP in X25519MLKEM768; do
101115
grep "subject" "$BSSL_BUILD_FOLDER"/s_client_out | grep "BoringSSL"
102116

103117
echo "TLS Handshake: boring-ssl server (bssl) with aws-lc client (bssl) for group $GROUP"
104-
"$BSSL_BUILD_FOLDER"/tool/bssl s_server -curves $GROUP -accept 45000 -debug \
118+
${BSSL_CMD} s_server -curves $GROUP -accept 45000 -debug \
105119
&> "$BSSL_BUILD_FOLDER"/s_server_out &
106120
sleep 5 # to allow for the server to startup in the background thread
107121
S_PID=$!
108-
"$AWS_LC_BUILD_FOLDER"/tool/bssl s_client -curves $GROUP -connect localhost:45000 -debug \
122+
${AWS_LC_CMD} s_client -curves $GROUP -connect localhost:45000 -debug \
109123
&> "$AWS_LC_BUILD_FOLDER"/s_client_out &
110124
wait $S_PID || true
111125
cat "$BSSL_BUILD_FOLDER"/s_server_out

0 commit comments

Comments
 (0)