Skip to content

Commit

Permalink
rearrange check and add aws-lc verification
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Feb 1, 2024
1 parent db6a639 commit 76b81c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
14 changes: 1 addition & 13 deletions ssl/ssl_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
case SSL_ERROR_WANT_CERTIFICATE_VERIFY:
case SSL_ERROR_WANT_RENEGOTIATE:
case SSL_ERROR_HANDSHAKE_HINTS_READY:
case SSL_ERROR_ZERO_RETURN:
return ssl->s3->rwstate;

case SSL_ERROR_WANT_READ: {
Expand Down Expand Up @@ -1438,19 +1439,6 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
}
}

// An EOF was observed which violates the protocol, and the underlying
// transport does not participate in the error queue.
//
// This was moved earlier in the function by BoringSSL and used to be
// wrapped with a check for |ret_code| == 0 in OpenSSL 1.0.2. Since
// OpenSSL 1.1.1, the check for |ret_code| has been removed and we've
// moved this back before the final return to gain better parity with
// OpenSSL.
// See openssl/openssl@8051ab2 for more details.
if (ssl->s3->rwstate == SSL_ERROR_ZERO_RETURN) {
return SSL_ERROR_ZERO_RETURN;
}

return SSL_ERROR_SYSCALL;
}

Expand Down
19 changes: 16 additions & 3 deletions tests/ci/integration/run_bind9_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install"

function bind9_build() {
autoreconf -fi
PKG_CONFIG_PATH="${AWS_LC_INSTALL_FOLDER}/lib/pkgconfig" ./configure --with-openssl="${AWS_LC_INSTALL_FOLDER}" --enable-dnstap --enable-dnsrps --with-cmocka --with-libxml2 --enable-leak-detection
PKG_CONFIG_PATH="${AWS_LC_INSTALL_FOLDER}/lib/pkgconfig" ./configure \
--with-openssl="${AWS_LC_INSTALL_FOLDER}" \
--enable-dnstap \
--enable-dnsrps \
--with-cmocka \
--with-libxml2 \
--enable-leak-detection
make -j ${NUM_CPU_THREADS} -k all
}

Expand All @@ -48,13 +54,20 @@ git clone https://gitlab.isc.org/isc-projects/bind9.git ${BIND9_SRC_FOLDER} --de
mkdir -p ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} ${BIND9_BUILD_FOLDER}
ls

aws_lc_build ${SRC_ROOT} ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} -DBUILD_TESTING=OFF
aws_lc_build ${SRC_ROOT} ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} -DBUILD_TESTING=OFF -DBUILD_TOOL=OFF -DBUILD_SHARED_LIBS=1
export LD_LIBRARY_PATH="${AWS_LC_INSTALL_FOLDER}/lib"

# Build bind9 from source.
pushd ${BIND9_SRC_FOLDER}

bind9_patch
bind9_build
bind9_run_tests
popd

# Iterate through all of bind's vended artifacts.
for libname in dns ns isc isccc isccfg; do
ldd "${BIND9_SRC_FOLDER}/lib/${libname}/.libs/lib${libname}.so" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libcrypto.so" || exit 1
ldd "${BIND9_SRC_FOLDER}/lib/${libname}/.libs/lib${libname}.so" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libssl.so" || exit 1
done

popd

0 comments on commit 76b81c9

Please sign in to comment.