mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-09 07:09:12 -04:00
compat.sh: simplify code of iterating on VERIFY for PSK tests
Since PSK cipher suites do not allow client certificate verification, PSK test cases should be executed under VERIFY=NO. SUB_VERIFIES is used to constrain verification option for PSK tests. With aforementioned change, the latter check of $VERIFY=YES && $TYPE!=PSK is redundant so it's removed. Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
8332db92bd
commit
21daf2930a
@ -231,7 +231,7 @@ filter_ciphersuites()
|
|||||||
|
|
||||||
# For GnuTLS client -> mbed TLS server,
|
# For GnuTLS client -> mbed TLS server,
|
||||||
# we need to force IPv4 by connecting to 127.0.0.1 but then auth fails
|
# we need to force IPv4 by connecting to 127.0.0.1 but then auth fails
|
||||||
if is_dtls "$MODE" && [ "X$VERIFY" = "XYES" ] && [ "$TYPE" != "PSK" ]; then
|
if is_dtls "$MODE" && [ "X$VERIFY" = "XYES" ]; then
|
||||||
G_CIPHERS=""
|
G_CIPHERS=""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -947,7 +947,7 @@ setup_arguments()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "X$VERIFY" = "XYES" ] && [ "$TYPE" != "PSK" ];
|
if [ "X$VERIFY" = "XYES" ];
|
||||||
then
|
then
|
||||||
M_SERVER_ARGS="$M_SERVER_ARGS ca_file=data_files/test-ca_cat12.crt auth_mode=required"
|
M_SERVER_ARGS="$M_SERVER_ARGS ca_file=data_files/test-ca_cat12.crt auth_mode=required"
|
||||||
O_SERVER_ARGS="$O_SERVER_ARGS -CAfile data_files/test-ca_cat12.crt -Verify 10"
|
O_SERVER_ARGS="$O_SERVER_ARGS -CAfile data_files/test-ca_cat12.crt -Verify 10"
|
||||||
@ -1134,7 +1134,6 @@ wait_client_done() {
|
|||||||
run_client() {
|
run_client() {
|
||||||
# announce what we're going to do
|
# announce what we're going to do
|
||||||
TESTS=$(( $TESTS + 1 ))
|
TESTS=$(( $TESTS + 1 ))
|
||||||
VERIF=$(echo $VERIFY | tr '[:upper:]' '[:lower:]')
|
|
||||||
TITLE="`echo $1 | head -c1`->`echo $SERVER_NAME | head -c1`"
|
TITLE="`echo $1 | head -c1`->`echo $SERVER_NAME | head -c1`"
|
||||||
TITLE="$TITLE $MODE,$VERIF $2"
|
TITLE="$TITLE $MODE,$VERIF $2"
|
||||||
printf "%s " "$TITLE"
|
printf "%s " "$TITLE"
|
||||||
@ -1332,20 +1331,19 @@ SKIP_NEXT="NO"
|
|||||||
trap cleanup INT TERM HUP
|
trap cleanup INT TERM HUP
|
||||||
|
|
||||||
for MODE in $MODES; do
|
for MODE in $MODES; do
|
||||||
PSK_TESTS=""
|
for TYPE in $TYPES; do
|
||||||
for VERIFY in $VERIFIES; do
|
|
||||||
VERIF=$(echo $VERIFY | tr '[:upper:]' '[:lower:]')
|
|
||||||
for TYPE in $TYPES; do
|
|
||||||
|
|
||||||
if [ "$TYPE" = "PSK" ]; then
|
# PSK cipher suites do not allow client certificate verification.
|
||||||
if [ -z "$PSK_TESTS" ]; then
|
# This means PSK test cases with VERIFY=YES should be replaced by
|
||||||
PSK_TESTS="FINISHED"
|
# VERIFY=NO or be ignored. SUB_VERIFIES variable is used to constrain
|
||||||
VERIF="no"
|
# verification option for PSK test cases.
|
||||||
else
|
SUB_VERIFIES=$VERIFIES
|
||||||
continue;
|
if [ "$TYPE" = "PSK" ]; then
|
||||||
fi
|
SUB_VERIFIES="NO"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for VERIFY in $SUB_VERIFIES; do
|
||||||
|
VERIF=$(echo $VERIFY | tr '[:upper:]' '[:lower:]')
|
||||||
for PEER in $PEERS; do
|
for PEER in $PEERS; do
|
||||||
|
|
||||||
setup_arguments
|
setup_arguments
|
||||||
|
Loading…
x
Reference in New Issue
Block a user