Skip to content
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

Adding tests for the compatibility mode with OpenSSL #350

Open
wants to merge 1 commit into
base: tls13-prototype
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions tests/compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ MODES="tls1_2 dtls1_2"
VERIFIES="NO YES"
TYPES="ECDSA RSA PSK"
FILTER=""
BOXES="NO YES"
# exclude:
# - NULL: excluded from our default config
# avoid plain DES but keep 3DES-EDE-CBC (mbedTLS), DES-CBC3 (OpenSSL)
Expand All @@ -97,6 +98,7 @@ print_usage() {
printf " -p|--peers\tWhich peers to use (Default: '%s')\n" "$PEERS"
printf " \tAlso available: GnuTLS (needs v3.2.15 or higher)\n"
printf " -M|--memcheck\tCheck memory leaks and errors.\n"
printf " -C|--compatibility\tTest TLS 1.3 compatibility mode (Default: '%s')\n" "$BOXES"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: why not use -c? I don't think it is used yet.

printf " -v|--verbose\tSet verbose output.\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we sort the options alphabetically? If so we might want to move the help for -v up.

}

Expand All @@ -118,6 +120,9 @@ get_options() {
-V|--verify)
shift; VERIFIES=$1
;;
-C|--compatibility)
shift; BOXES=$1
;;
-p|--peers)
shift; PEERS=$1
;;
Expand Down Expand Up @@ -903,6 +908,16 @@ setup_arguments()
G_CLIENT_ARGS="-p $PORT --debug 3 $G_MODE"
G_CLIENT_PRIO="NONE:$G_PRIO_MODE:+COMP-NULL:+CURVE-ALL:+SIGN-ALL"


if [ "X$BOX" = "XNO" ];
then
if [ `minor_ver "$MODE"` -ge 4 ]
then
O_SERVER_ARGS="$O_SERVER_ARGS -no_middlebox"
O_CLIENT_ARGS="$O_CLIENT_ARGS -no_middlebox"
fi
fi

if [ "X$VERIFY" = "XYES" ];
then
M_SERVER_ARGS="$M_SERVER_ARGS ca_file=data_files/test-ca_cat12.crt auth_mode=required"
Expand Down Expand Up @@ -1299,27 +1314,28 @@ trap cleanup INT TERM HUP
for VERIFY in $VERIFIES; do
for MODE in $MODES; do
for TYPE in $TYPES; do
for PEER in $PEERS; do
for BOX in $BOXES; do
for PEER in $PEERS; do

setup_arguments
setup_arguments

case "$PEER" in
case "$PEER" in

[Oo]pen*)
[Oo]pen*)

if test "$OSSL_NO_DTLS" -gt 0 && is_dtls "$MODE"; then
continue;
fi
if test "$OSSL_NO_DTLS" -gt 0 && is_dtls "$MODE"; then
continue;
fi

reset_ciphersuites
if [ `minor_ver "$MODE"` -ge 4 ]
then
M_CIPHERS="$M_CIPHERS \
TLS1-3-AES-128-GCM-SHA256 \
TLS1-3-AES-256-GCM-SHA384 \
TLS1-3-AES-128-CCM-SHA256 \
TLS1-3-AES-128-CCM-8-SHA256 \
TLS1-3-CHACHA20-POLY1305-SHA256 \
TLS1-3-AES-128-GCM-SHA256 \
TLS1-3-AES-256-GCM-SHA384 \
TLS1-3-AES-128-CCM-SHA256 \
TLS1-3-AES-128-CCM-8-SHA256 \
TLS1-3-CHACHA20-POLY1305-SHA256 \
"
O_CIPHERS="$O_CIPHERS \
TLS_AES_128_GCM_SHA256 \
Expand Down Expand Up @@ -1438,8 +1454,8 @@ for VERIFY in $VERIFIES; do
exit 1
;;

esac

esac
done
done
done
done
Expand Down