Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Test various options that are not covered by compat.sh |
| 4 | # |
| 5 | # Here the goal is not to cover every ciphersuite/version, but |
| 6 | # rather specific options (max fragment length, truncated hmac, etc) |
| 7 | # or procedures (session resumption from cache or ticket, renego, etc). |
| 8 | # |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9 | # Assumes a build with default options. |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 10 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 11 | set -u |
| 12 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 13 | # default values, can be overriden by the environment |
| 14 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 15 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 16 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 17 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 18 | : ${GNUTLS_CLI:=gnutls-cli} |
| 19 | : ${GNUTLS_SERV:=gnutls-serv} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 21 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 22 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 23 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 24 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 25 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 26 | TESTS=0 |
| 27 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 28 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 29 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 30 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 31 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 32 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 33 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 34 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 35 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 36 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 37 | RUN_TEST_NUMBER='' |
| 38 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 39 | PRESERVE_LOGS=0 |
| 40 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 41 | print_usage() { |
| 42 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 43 | printf " -h|--help\tPrint this help.\n" |
| 44 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
| 45 | printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n" |
| 46 | printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 47 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 48 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 49 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | get_options() { |
| 53 | while [ $# -gt 0 ]; do |
| 54 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 55 | -f|--filter) |
| 56 | shift; FILTER=$1 |
| 57 | ;; |
| 58 | -e|--exclude) |
| 59 | shift; EXCLUDE=$1 |
| 60 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 61 | -m|--memcheck) |
| 62 | MEMCHECK=1 |
| 63 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 64 | -n|--number) |
| 65 | shift; RUN_TEST_NUMBER=$1 |
| 66 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 67 | -s|--show-numbers) |
| 68 | SHOW_TEST_NUMBER=1 |
| 69 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 70 | -p|--preserve-logs) |
| 71 | PRESERVE_LOGS=1 |
| 72 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 73 | -h|--help) |
| 74 | print_usage |
| 75 | exit 0 |
| 76 | ;; |
| 77 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 78 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 79 | print_usage |
| 80 | exit 1 |
| 81 | ;; |
| 82 | esac |
| 83 | shift |
| 84 | done |
| 85 | } |
| 86 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 87 | # skip next test if the flag is not enabled in config.h |
| 88 | requires_config_enabled() { |
| 89 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 90 | SKIP_NEXT="YES" |
| 91 | fi |
| 92 | } |
| 93 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 94 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 95 | requires_openssl_with_fallback_scsv() { |
| 96 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 97 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 98 | then |
| 99 | OPENSSL_HAS_FBSCSV="YES" |
| 100 | else |
| 101 | OPENSSL_HAS_FBSCSV="NO" |
| 102 | fi |
| 103 | fi |
| 104 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 105 | SKIP_NEXT="YES" |
| 106 | fi |
| 107 | } |
| 108 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 109 | # skip next test if GnuTLS isn't available |
| 110 | requires_gnutls() { |
| 111 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 112 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 113 | GNUTLS_AVAILABLE="YES" |
| 114 | else |
| 115 | GNUTLS_AVAILABLE="NO" |
| 116 | fi |
| 117 | fi |
| 118 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 119 | SKIP_NEXT="YES" |
| 120 | fi |
| 121 | } |
| 122 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 123 | # skip next test if IPv6 isn't available on this host |
| 124 | requires_ipv6() { |
| 125 | if [ -z "${HAS_IPV6:-}" ]; then |
| 126 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 127 | SRV_PID=$! |
| 128 | sleep 1 |
| 129 | kill $SRV_PID >/dev/null 2>&1 |
| 130 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 131 | HAS_IPV6="NO" |
| 132 | else |
| 133 | HAS_IPV6="YES" |
| 134 | fi |
| 135 | rm -r $SRV_OUT |
| 136 | fi |
| 137 | |
| 138 | if [ "$HAS_IPV6" = "NO" ]; then |
| 139 | SKIP_NEXT="YES" |
| 140 | fi |
| 141 | } |
| 142 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 143 | # skip the next test if valgrind is in use |
| 144 | not_with_valgrind() { |
| 145 | if [ "$MEMCHECK" -gt 0 ]; then |
| 146 | SKIP_NEXT="YES" |
| 147 | fi |
| 148 | } |
| 149 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 150 | # skip the next test if valgrind is NOT in use |
| 151 | only_with_valgrind() { |
| 152 | if [ "$MEMCHECK" -eq 0 ]; then |
| 153 | SKIP_NEXT="YES" |
| 154 | fi |
| 155 | } |
| 156 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 157 | # multiply the client timeout delay by the given factor for the next test |
| 158 | needs_more_time() { |
| 159 | CLI_DELAY_FACTOR=$1 |
| 160 | } |
| 161 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 162 | # print_name <name> |
| 163 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 164 | TESTS=$(( $TESTS + 1 )) |
| 165 | LINE="" |
| 166 | |
| 167 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 168 | LINE="$TESTS " |
| 169 | fi |
| 170 | |
| 171 | LINE="$LINE$1" |
| 172 | printf "$LINE " |
| 173 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 174 | for i in `seq 1 $LEN`; do printf '.'; done |
| 175 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 176 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | # fail <message> |
| 180 | fail() { |
| 181 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 182 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 183 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 184 | mv $SRV_OUT o-srv-${TESTS}.log |
| 185 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 186 | if [ -n "$PXY_CMD" ]; then |
| 187 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 188 | fi |
| 189 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 190 | |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 191 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot ]; then |
| 192 | echo " ! server output:" |
| 193 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 194 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 195 | echo " ! client output:" |
| 196 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 197 | if [ -n "$PXY_CMD" ]; then |
| 198 | echo " ! ========================================================" |
| 199 | echo " ! proxy output:" |
| 200 | cat o-pxy-${TESTS}.log |
| 201 | fi |
| 202 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 203 | fi |
| 204 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 205 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 206 | } |
| 207 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 208 | # is_polar <cmd_line> |
| 209 | is_polar() { |
| 210 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 211 | } |
| 212 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 213 | # openssl s_server doesn't have -www with DTLS |
| 214 | check_osrv_dtls() { |
| 215 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 216 | NEEDS_INPUT=1 |
| 217 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 218 | else |
| 219 | NEEDS_INPUT=0 |
| 220 | fi |
| 221 | } |
| 222 | |
| 223 | # provide input to commands that need it |
| 224 | provide_input() { |
| 225 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 226 | return |
| 227 | fi |
| 228 | |
| 229 | while true; do |
| 230 | echo "HTTP/1.0 200 OK" |
| 231 | sleep 1 |
| 232 | done |
| 233 | } |
| 234 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 235 | # has_mem_err <log_file_name> |
| 236 | has_mem_err() { |
| 237 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 238 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 239 | then |
| 240 | return 1 # false: does not have errors |
| 241 | else |
| 242 | return 0 # true: has errors |
| 243 | fi |
| 244 | } |
| 245 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 246 | # wait for server to start: two versions depending on lsof availability |
| 247 | wait_server_start() { |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 248 | if which lsof >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 249 | START_TIME=$( date +%s ) |
| 250 | DONE=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 251 | |
| 252 | # make a tight loop, server usually takes less than 1 sec to start |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 253 | if [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 254 | while [ $DONE -eq 0 ]; do |
| 255 | if lsof -nbi UDP:"$SRV_PORT" 2>/dev/null | grep UDP >/dev/null |
| 256 | then |
| 257 | DONE=1 |
| 258 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 259 | echo "SERVERSTART TIMEOUT" |
| 260 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 261 | DONE=1 |
| 262 | fi |
| 263 | done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 264 | else |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 265 | while [ $DONE -eq 0 ]; do |
| 266 | if lsof -nbi TCP:"$SRV_PORT" 2>/dev/null | grep LISTEN >/dev/null |
| 267 | then |
| 268 | DONE=1 |
| 269 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 270 | echo "SERVERSTART TIMEOUT" |
| 271 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 272 | DONE=1 |
| 273 | fi |
| 274 | done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 275 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 276 | else |
| 277 | sleep "$START_DELAY" |
| 278 | fi |
| 279 | } |
| 280 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 281 | # wait for client to terminate and set CLI_EXIT |
| 282 | # must be called right after starting the client |
| 283 | wait_client_done() { |
| 284 | CLI_PID=$! |
| 285 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 286 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 287 | CLI_DELAY_FACTOR=1 |
| 288 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 289 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 290 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 291 | |
| 292 | wait $CLI_PID |
| 293 | CLI_EXIT=$? |
| 294 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 295 | kill $DOG_PID >/dev/null 2>&1 |
| 296 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 297 | |
| 298 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
| 299 | } |
| 300 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 301 | # check if the given command uses dtls and sets global variable DTLS |
| 302 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 303 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 304 | DTLS=1 |
| 305 | else |
| 306 | DTLS=0 |
| 307 | fi |
| 308 | } |
| 309 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 310 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 311 | # Options: -s pattern pattern that must be present in server output |
| 312 | # -c pattern pattern that must be present in client output |
| 313 | # -S pattern pattern that must be absent in server output |
| 314 | # -C pattern pattern that must be absent in client output |
| 315 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 316 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 317 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 318 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 319 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 320 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 321 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 322 | return |
| 323 | fi |
| 324 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 325 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 326 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 327 | # Do we only run numbered tests? |
| 328 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 329 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 330 | else |
| 331 | SKIP_NEXT="YES" |
| 332 | fi |
| 333 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 334 | # should we skip? |
| 335 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 336 | SKIP_NEXT="NO" |
| 337 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 338 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 339 | return |
| 340 | fi |
| 341 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 342 | # does this test use a proxy? |
| 343 | if [ "X$1" = "X-p" ]; then |
| 344 | PXY_CMD="$2" |
| 345 | shift 2 |
| 346 | else |
| 347 | PXY_CMD="" |
| 348 | fi |
| 349 | |
| 350 | # get commands and client output |
| 351 | SRV_CMD="$1" |
| 352 | CLI_CMD="$2" |
| 353 | CLI_EXPECT="$3" |
| 354 | shift 3 |
| 355 | |
| 356 | # fix client port |
| 357 | if [ -n "$PXY_CMD" ]; then |
| 358 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 359 | else |
| 360 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 361 | fi |
| 362 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 363 | # update DTLS variable |
| 364 | detect_dtls "$SRV_CMD" |
| 365 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 366 | # prepend valgrind to our commands if active |
| 367 | if [ "$MEMCHECK" -gt 0 ]; then |
| 368 | if is_polar "$SRV_CMD"; then |
| 369 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 370 | fi |
| 371 | if is_polar "$CLI_CMD"; then |
| 372 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 373 | fi |
| 374 | fi |
| 375 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 376 | TIMES_LEFT=2 |
| 377 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 378 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 379 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 380 | # run the commands |
| 381 | if [ -n "$PXY_CMD" ]; then |
| 382 | echo "$PXY_CMD" > $PXY_OUT |
| 383 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 384 | PXY_PID=$! |
| 385 | # assume proxy starts faster than server |
| 386 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 387 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 388 | check_osrv_dtls |
| 389 | echo "$SRV_CMD" > $SRV_OUT |
| 390 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 391 | SRV_PID=$! |
| 392 | wait_server_start |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 393 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 394 | echo "$CLI_CMD" > $CLI_OUT |
| 395 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 396 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 397 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 398 | # terminate the server (and the proxy) |
| 399 | kill $SRV_PID |
| 400 | wait $SRV_PID |
| 401 | if [ -n "$PXY_CMD" ]; then |
| 402 | kill $PXY_PID >/dev/null 2>&1 |
| 403 | wait $PXY_PID |
| 404 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 405 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 406 | # retry only on timeouts |
| 407 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 408 | printf "RETRY " |
| 409 | else |
| 410 | TIMES_LEFT=0 |
| 411 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 412 | done |
| 413 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 414 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 415 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 416 | # expected client exit to incorrectly succeed in case of catastrophic |
| 417 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 418 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 419 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 420 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 421 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 422 | return |
| 423 | fi |
| 424 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 425 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 426 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 427 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 428 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 429 | return |
| 430 | fi |
| 431 | fi |
| 432 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 433 | # check server exit code |
| 434 | if [ $? != 0 ]; then |
| 435 | fail "server fail" |
| 436 | return |
| 437 | fi |
| 438 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 439 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 440 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 441 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 442 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 443 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 444 | return |
| 445 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 446 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 447 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 448 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 449 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 450 | while [ $# -gt 0 ] |
| 451 | do |
| 452 | case $1 in |
| 453 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 454 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 455 | fail "-s $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 456 | return |
| 457 | fi |
| 458 | ;; |
| 459 | |
| 460 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 461 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 462 | fail "-c $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 463 | return |
| 464 | fi |
| 465 | ;; |
| 466 | |
| 467 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 468 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 469 | fail "-S $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 470 | return |
| 471 | fi |
| 472 | ;; |
| 473 | |
| 474 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 475 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 476 | fail "-C $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 477 | return |
| 478 | fi |
| 479 | ;; |
| 480 | |
| 481 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 482 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 483 | exit 1 |
| 484 | esac |
| 485 | shift 2 |
| 486 | done |
| 487 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 488 | # check valgrind's results |
| 489 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 490 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 491 | fail "Server has memory errors" |
| 492 | return |
| 493 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 494 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 495 | fail "Client has memory errors" |
| 496 | return |
| 497 | fi |
| 498 | fi |
| 499 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 500 | # if we're here, everything is ok |
| 501 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 502 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 503 | mv $SRV_OUT o-srv-${TESTS}.log |
| 504 | mv $CLI_OUT o-cli-${TESTS}.log |
| 505 | fi |
| 506 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 507 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 508 | } |
| 509 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 510 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 511 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 512 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 513 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 514 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 515 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 516 | exit 1 |
| 517 | } |
| 518 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 519 | # |
| 520 | # MAIN |
| 521 | # |
| 522 | |
Manuel Pégourié-Gonnard | 19db8ea | 2015-03-10 13:41:04 +0000 | [diff] [blame] | 523 | if cd $( dirname $0 ); then :; else |
| 524 | echo "cd $( dirname $0 ) failed" >&2 |
| 525 | exit 1 |
| 526 | fi |
| 527 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 528 | get_options "$@" |
| 529 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 530 | # sanity checks, avoid an avalanche of errors |
| 531 | if [ ! -x "$P_SRV" ]; then |
| 532 | echo "Command '$P_SRV' is not an executable file" |
| 533 | exit 1 |
| 534 | fi |
| 535 | if [ ! -x "$P_CLI" ]; then |
| 536 | echo "Command '$P_CLI' is not an executable file" |
| 537 | exit 1 |
| 538 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 539 | if [ ! -x "$P_PXY" ]; then |
| 540 | echo "Command '$P_PXY' is not an executable file" |
| 541 | exit 1 |
| 542 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 543 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 544 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 545 | exit 1 |
| 546 | fi |
| 547 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 548 | # used by watchdog |
| 549 | MAIN_PID="$$" |
| 550 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 551 | # be more patient with valgrind |
| 552 | if [ "$MEMCHECK" -gt 0 ]; then |
| 553 | START_DELAY=3 |
| 554 | DOG_DELAY=30 |
| 555 | else |
| 556 | START_DELAY=1 |
| 557 | DOG_DELAY=10 |
| 558 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 559 | CLI_DELAY_FACTOR=1 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 560 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 561 | # Pick a "unique" server port in the range 10000-19999, and a proxy port |
| 562 | PORT_BASE="0000$$" |
Manuel Pégourié-Gonnard | 3a173f4 | 2015-01-22 13:30:33 +0000 | [diff] [blame] | 563 | PORT_BASE="$( printf $PORT_BASE | tail -c 4 )" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 564 | SRV_PORT="1$PORT_BASE" |
| 565 | PXY_PORT="2$PORT_BASE" |
| 566 | unset PORT_BASE |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 567 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 568 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 569 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 570 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 571 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 572 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 573 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 574 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 575 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 576 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 577 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 578 | # Also pick a unique name for intermediate files |
| 579 | SRV_OUT="srv_out.$$" |
| 580 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 581 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 582 | SESSION="session.$$" |
| 583 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 584 | SKIP_NEXT="NO" |
| 585 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 586 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 587 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 588 | # Basic test |
| 589 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 590 | # Checks that: |
| 591 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 592 | # - the expected (highest security) parameters are selected |
| 593 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 594 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 595 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 596 | "$P_CLI" \ |
| 597 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 598 | -s "Protocol is TLSv1.2" \ |
| 599 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 600 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 601 | -s "ECDHE curve: secp521r1" \ |
| 602 | -S "error" \ |
| 603 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 604 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 605 | run_test "Default, DTLS" \ |
| 606 | "$P_SRV dtls=1" \ |
| 607 | "$P_CLI dtls=1" \ |
| 608 | 0 \ |
| 609 | -s "Protocol is DTLSv1.2" \ |
| 610 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" |
| 611 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 612 | # Tests for rc4 option |
| 613 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame^] | 614 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 615 | run_test "RC4: server disabled, client enabled" \ |
| 616 | "$P_SRV" \ |
| 617 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 618 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 619 | -s "SSL - The server has no ciphersuites in common" |
| 620 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame^] | 621 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 622 | run_test "RC4: server half, client enabled" \ |
| 623 | "$P_SRV arc4=1" \ |
| 624 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 625 | 1 \ |
| 626 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 627 | |
| 628 | run_test "RC4: server enabled, client disabled" \ |
| 629 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 630 | "$P_CLI" \ |
| 631 | 1 \ |
| 632 | -s "SSL - The server has no ciphersuites in common" |
| 633 | |
| 634 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 635 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 636 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 637 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 638 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 639 | -S "SSL - The server has no ciphersuites in common" |
| 640 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 641 | # Tests for Truncated HMAC extension |
| 642 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 643 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 644 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 645 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 646 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 647 | -s "dumping 'computed mac' (20 bytes)" \ |
| 648 | -S "dumping 'computed mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 649 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 650 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 651 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 652 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 653 | trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 654 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 655 | -s "dumping 'computed mac' (20 bytes)" \ |
| 656 | -S "dumping 'computed mac' (10 bytes)" |
| 657 | |
| 658 | run_test "Truncated HMAC: client enabled, server default" \ |
| 659 | "$P_SRV debug_level=4" \ |
| 660 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 661 | trunc_hmac=1" \ |
| 662 | 0 \ |
Manuel Pégourié-Gonnard | 662c6e8 | 2015-05-06 17:39:23 +0100 | [diff] [blame] | 663 | -s "dumping 'computed mac' (20 bytes)" \ |
| 664 | -S "dumping 'computed mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 665 | |
| 666 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 667 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
| 668 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 669 | trunc_hmac=1" \ |
| 670 | 0 \ |
| 671 | -s "dumping 'computed mac' (20 bytes)" \ |
| 672 | -S "dumping 'computed mac' (10 bytes)" |
| 673 | |
| 674 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 675 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
| 676 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 677 | trunc_hmac=1" \ |
| 678 | 0 \ |
| 679 | -S "dumping 'computed mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 680 | -s "dumping 'computed mac' (10 bytes)" |
| 681 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 682 | # Tests for Encrypt-then-MAC extension |
| 683 | |
| 684 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 685 | "$P_SRV debug_level=3 \ |
| 686 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 687 | "$P_CLI debug_level=3" \ |
| 688 | 0 \ |
| 689 | -c "client hello, adding encrypt_then_mac extension" \ |
| 690 | -s "found encrypt then mac extension" \ |
| 691 | -s "server hello, adding encrypt then mac extension" \ |
| 692 | -c "found encrypt_then_mac extension" \ |
| 693 | -c "using encrypt then mac" \ |
| 694 | -s "using encrypt then mac" |
| 695 | |
| 696 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 697 | "$P_SRV debug_level=3 etm=0 \ |
| 698 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 699 | "$P_CLI debug_level=3 etm=1" \ |
| 700 | 0 \ |
| 701 | -c "client hello, adding encrypt_then_mac extension" \ |
| 702 | -s "found encrypt then mac extension" \ |
| 703 | -S "server hello, adding encrypt then mac extension" \ |
| 704 | -C "found encrypt_then_mac extension" \ |
| 705 | -C "using encrypt then mac" \ |
| 706 | -S "using encrypt then mac" |
| 707 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 708 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 709 | "$P_SRV debug_level=3 etm=1 \ |
| 710 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 711 | "$P_CLI debug_level=3 etm=1" \ |
| 712 | 0 \ |
| 713 | -c "client hello, adding encrypt_then_mac extension" \ |
| 714 | -s "found encrypt then mac extension" \ |
| 715 | -S "server hello, adding encrypt then mac extension" \ |
| 716 | -C "found encrypt_then_mac extension" \ |
| 717 | -C "using encrypt then mac" \ |
| 718 | -S "using encrypt then mac" |
| 719 | |
| 720 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 721 | "$P_SRV debug_level=3 etm=1 \ |
| 722 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 723 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 724 | 0 \ |
| 725 | -c "client hello, adding encrypt_then_mac extension" \ |
| 726 | -s "found encrypt then mac extension" \ |
| 727 | -S "server hello, adding encrypt then mac extension" \ |
| 728 | -C "found encrypt_then_mac extension" \ |
| 729 | -C "using encrypt then mac" \ |
| 730 | -S "using encrypt then mac" |
| 731 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 732 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 733 | "$P_SRV debug_level=3 etm=1 \ |
| 734 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 735 | "$P_CLI debug_level=3 etm=0" \ |
| 736 | 0 \ |
| 737 | -C "client hello, adding encrypt_then_mac extension" \ |
| 738 | -S "found encrypt then mac extension" \ |
| 739 | -S "server hello, adding encrypt then mac extension" \ |
| 740 | -C "found encrypt_then_mac extension" \ |
| 741 | -C "using encrypt then mac" \ |
| 742 | -S "using encrypt then mac" |
| 743 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 744 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 745 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 746 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 747 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 748 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 749 | 0 \ |
| 750 | -C "client hello, adding encrypt_then_mac extension" \ |
| 751 | -S "found encrypt then mac extension" \ |
| 752 | -S "server hello, adding encrypt then mac extension" \ |
| 753 | -C "found encrypt_then_mac extension" \ |
| 754 | -C "using encrypt then mac" \ |
| 755 | -S "using encrypt then mac" |
| 756 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 757 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 758 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 759 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 760 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 761 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 762 | 0 \ |
| 763 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 764 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 765 | -S "server hello, adding encrypt then mac extension" \ |
| 766 | -C "found encrypt_then_mac extension" \ |
| 767 | -C "using encrypt then mac" \ |
| 768 | -S "using encrypt then mac" |
| 769 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 770 | # Tests for Extended Master Secret extension |
| 771 | |
| 772 | run_test "Extended Master Secret: default" \ |
| 773 | "$P_SRV debug_level=3" \ |
| 774 | "$P_CLI debug_level=3" \ |
| 775 | 0 \ |
| 776 | -c "client hello, adding extended_master_secret extension" \ |
| 777 | -s "found extended master secret extension" \ |
| 778 | -s "server hello, adding extended master secret extension" \ |
| 779 | -c "found extended_master_secret extension" \ |
| 780 | -c "using extended master secret" \ |
| 781 | -s "using extended master secret" |
| 782 | |
| 783 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 784 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 785 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 786 | 0 \ |
| 787 | -c "client hello, adding extended_master_secret extension" \ |
| 788 | -s "found extended master secret extension" \ |
| 789 | -S "server hello, adding extended master secret extension" \ |
| 790 | -C "found extended_master_secret extension" \ |
| 791 | -C "using extended master secret" \ |
| 792 | -S "using extended master secret" |
| 793 | |
| 794 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 795 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 796 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 797 | 0 \ |
| 798 | -C "client hello, adding extended_master_secret extension" \ |
| 799 | -S "found extended master secret extension" \ |
| 800 | -S "server hello, adding extended master secret extension" \ |
| 801 | -C "found extended_master_secret extension" \ |
| 802 | -C "using extended master secret" \ |
| 803 | -S "using extended master secret" |
| 804 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 805 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 806 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 807 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 808 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 809 | 0 \ |
| 810 | -C "client hello, adding extended_master_secret extension" \ |
| 811 | -S "found extended master secret extension" \ |
| 812 | -S "server hello, adding extended master secret extension" \ |
| 813 | -C "found extended_master_secret extension" \ |
| 814 | -C "using extended master secret" \ |
| 815 | -S "using extended master secret" |
| 816 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 817 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 818 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 819 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 820 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 821 | 0 \ |
| 822 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 823 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 824 | -S "server hello, adding extended master secret extension" \ |
| 825 | -C "found extended_master_secret extension" \ |
| 826 | -C "using extended master secret" \ |
| 827 | -S "using extended master secret" |
| 828 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 829 | # Tests for FALLBACK_SCSV |
| 830 | |
| 831 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 832 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 833 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 834 | 0 \ |
| 835 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 836 | -S "received FALLBACK_SCSV" \ |
| 837 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 838 | -C "is a fatal alert message (msg 86)" |
| 839 | |
| 840 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 841 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 842 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 843 | 0 \ |
| 844 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 845 | -S "received FALLBACK_SCSV" \ |
| 846 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 847 | -C "is a fatal alert message (msg 86)" |
| 848 | |
| 849 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 850 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 851 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 852 | 1 \ |
| 853 | -c "adding FALLBACK_SCSV" \ |
| 854 | -s "received FALLBACK_SCSV" \ |
| 855 | -s "inapropriate fallback" \ |
| 856 | -c "is a fatal alert message (msg 86)" |
| 857 | |
| 858 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 859 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 860 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 861 | 0 \ |
| 862 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 863 | -s "received FALLBACK_SCSV" \ |
| 864 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 865 | -C "is a fatal alert message (msg 86)" |
| 866 | |
| 867 | requires_openssl_with_fallback_scsv |
| 868 | run_test "Fallback SCSV: default, openssl server" \ |
| 869 | "$O_SRV" \ |
| 870 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 871 | 0 \ |
| 872 | -C "adding FALLBACK_SCSV" \ |
| 873 | -C "is a fatal alert message (msg 86)" |
| 874 | |
| 875 | requires_openssl_with_fallback_scsv |
| 876 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 877 | "$O_SRV" \ |
| 878 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 879 | 1 \ |
| 880 | -c "adding FALLBACK_SCSV" \ |
| 881 | -c "is a fatal alert message (msg 86)" |
| 882 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 883 | requires_openssl_with_fallback_scsv |
| 884 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 885 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 886 | "$O_CLI -tls1_1" \ |
| 887 | 0 \ |
| 888 | -S "received FALLBACK_SCSV" \ |
| 889 | -S "inapropriate fallback" |
| 890 | |
| 891 | requires_openssl_with_fallback_scsv |
| 892 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 893 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 894 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 895 | 1 \ |
| 896 | -s "received FALLBACK_SCSV" \ |
| 897 | -s "inapropriate fallback" |
| 898 | |
| 899 | requires_openssl_with_fallback_scsv |
| 900 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 901 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 902 | "$O_CLI -fallback_scsv" \ |
| 903 | 0 \ |
| 904 | -s "received FALLBACK_SCSV" \ |
| 905 | -S "inapropriate fallback" |
| 906 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 907 | # Tests for CBC 1/n-1 record splitting |
| 908 | |
| 909 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 910 | "$P_SRV" \ |
| 911 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 912 | request_size=123 force_version=tls1_2" \ |
| 913 | 0 \ |
| 914 | -s "Read from client: 123 bytes read" \ |
| 915 | -S "Read from client: 1 bytes read" \ |
| 916 | -S "122 bytes read" |
| 917 | |
| 918 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 919 | "$P_SRV" \ |
| 920 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 921 | request_size=123 force_version=tls1_1" \ |
| 922 | 0 \ |
| 923 | -s "Read from client: 123 bytes read" \ |
| 924 | -S "Read from client: 1 bytes read" \ |
| 925 | -S "122 bytes read" |
| 926 | |
| 927 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 928 | "$P_SRV" \ |
| 929 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 930 | request_size=123 force_version=tls1" \ |
| 931 | 0 \ |
| 932 | -S "Read from client: 123 bytes read" \ |
| 933 | -s "Read from client: 1 bytes read" \ |
| 934 | -s "122 bytes read" |
| 935 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 936 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 937 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 938 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 939 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 940 | request_size=123 force_version=ssl3" \ |
| 941 | 0 \ |
| 942 | -S "Read from client: 123 bytes read" \ |
| 943 | -s "Read from client: 1 bytes read" \ |
| 944 | -s "122 bytes read" |
| 945 | |
| 946 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 947 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 948 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 949 | request_size=123 force_version=tls1" \ |
| 950 | 0 \ |
| 951 | -s "Read from client: 123 bytes read" \ |
| 952 | -S "Read from client: 1 bytes read" \ |
| 953 | -S "122 bytes read" |
| 954 | |
| 955 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 956 | "$P_SRV" \ |
| 957 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 958 | request_size=123 force_version=tls1 recsplit=0" \ |
| 959 | 0 \ |
| 960 | -s "Read from client: 123 bytes read" \ |
| 961 | -S "Read from client: 1 bytes read" \ |
| 962 | -S "122 bytes read" |
| 963 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 964 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 965 | "$P_SRV nbio=2" \ |
| 966 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 967 | request_size=123 force_version=tls1" \ |
| 968 | 0 \ |
| 969 | -S "Read from client: 123 bytes read" \ |
| 970 | -s "Read from client: 1 bytes read" \ |
| 971 | -s "122 bytes read" |
| 972 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 973 | # Tests for Session Tickets |
| 974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 975 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 976 | "$P_SRV debug_level=3 tickets=1" \ |
| 977 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 978 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 979 | -c "client hello, adding session ticket extension" \ |
| 980 | -s "found session ticket extension" \ |
| 981 | -s "server hello, adding session ticket extension" \ |
| 982 | -c "found session_ticket extension" \ |
| 983 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 984 | -S "session successfully restored from cache" \ |
| 985 | -s "session successfully restored from ticket" \ |
| 986 | -s "a session has been resumed" \ |
| 987 | -c "a session has been resumed" |
| 988 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 989 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 990 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 991 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 992 | 0 \ |
| 993 | -c "client hello, adding session ticket extension" \ |
| 994 | -s "found session ticket extension" \ |
| 995 | -s "server hello, adding session ticket extension" \ |
| 996 | -c "found session_ticket extension" \ |
| 997 | -c "parse new session ticket" \ |
| 998 | -S "session successfully restored from cache" \ |
| 999 | -s "session successfully restored from ticket" \ |
| 1000 | -s "a session has been resumed" \ |
| 1001 | -c "a session has been resumed" |
| 1002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1003 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1004 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1005 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1006 | 0 \ |
| 1007 | -c "client hello, adding session ticket extension" \ |
| 1008 | -s "found session ticket extension" \ |
| 1009 | -s "server hello, adding session ticket extension" \ |
| 1010 | -c "found session_ticket extension" \ |
| 1011 | -c "parse new session ticket" \ |
| 1012 | -S "session successfully restored from cache" \ |
| 1013 | -S "session successfully restored from ticket" \ |
| 1014 | -S "a session has been resumed" \ |
| 1015 | -C "a session has been resumed" |
| 1016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1017 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1018 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1019 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1020 | 0 \ |
| 1021 | -c "client hello, adding session ticket extension" \ |
| 1022 | -c "found session_ticket extension" \ |
| 1023 | -c "parse new session ticket" \ |
| 1024 | -c "a session has been resumed" |
| 1025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1026 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1027 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1028 | "( $O_CLI -sess_out $SESSION; \ |
| 1029 | $O_CLI -sess_in $SESSION; \ |
| 1030 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1031 | 0 \ |
| 1032 | -s "found session ticket extension" \ |
| 1033 | -s "server hello, adding session ticket extension" \ |
| 1034 | -S "session successfully restored from cache" \ |
| 1035 | -s "session successfully restored from ticket" \ |
| 1036 | -s "a session has been resumed" |
| 1037 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1038 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1040 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1041 | "$P_SRV debug_level=3 tickets=0" \ |
| 1042 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1043 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1044 | -c "client hello, adding session ticket extension" \ |
| 1045 | -s "found session ticket extension" \ |
| 1046 | -S "server hello, adding session ticket extension" \ |
| 1047 | -C "found session_ticket extension" \ |
| 1048 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1049 | -s "session successfully restored from cache" \ |
| 1050 | -S "session successfully restored from ticket" \ |
| 1051 | -s "a session has been resumed" \ |
| 1052 | -c "a session has been resumed" |
| 1053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1054 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1055 | "$P_SRV debug_level=3 tickets=1" \ |
| 1056 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1057 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1058 | -C "client hello, adding session ticket extension" \ |
| 1059 | -S "found session ticket extension" \ |
| 1060 | -S "server hello, adding session ticket extension" \ |
| 1061 | -C "found session_ticket extension" \ |
| 1062 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1063 | -s "session successfully restored from cache" \ |
| 1064 | -S "session successfully restored from ticket" \ |
| 1065 | -s "a session has been resumed" \ |
| 1066 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1068 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1069 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1070 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1071 | 0 \ |
| 1072 | -S "session successfully restored from cache" \ |
| 1073 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1074 | -S "a session has been resumed" \ |
| 1075 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1077 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1078 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1079 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1080 | 0 \ |
| 1081 | -s "session successfully restored from cache" \ |
| 1082 | -S "session successfully restored from ticket" \ |
| 1083 | -s "a session has been resumed" \ |
| 1084 | -c "a session has been resumed" |
| 1085 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1086 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1087 | "$P_SRV debug_level=3 tickets=0" \ |
| 1088 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1089 | 0 \ |
| 1090 | -s "session successfully restored from cache" \ |
| 1091 | -S "session successfully restored from ticket" \ |
| 1092 | -s "a session has been resumed" \ |
| 1093 | -c "a session has been resumed" |
| 1094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1095 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1096 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1097 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1098 | 0 \ |
| 1099 | -S "session successfully restored from cache" \ |
| 1100 | -S "session successfully restored from ticket" \ |
| 1101 | -S "a session has been resumed" \ |
| 1102 | -C "a session has been resumed" |
| 1103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1104 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1105 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1106 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1107 | 0 \ |
| 1108 | -s "session successfully restored from cache" \ |
| 1109 | -S "session successfully restored from ticket" \ |
| 1110 | -s "a session has been resumed" \ |
| 1111 | -c "a session has been resumed" |
| 1112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1113 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1114 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1115 | "( $O_CLI -sess_out $SESSION; \ |
| 1116 | $O_CLI -sess_in $SESSION; \ |
| 1117 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1118 | 0 \ |
| 1119 | -s "found session ticket extension" \ |
| 1120 | -S "server hello, adding session ticket extension" \ |
| 1121 | -s "session successfully restored from cache" \ |
| 1122 | -S "session successfully restored from ticket" \ |
| 1123 | -s "a session has been resumed" |
| 1124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1125 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1126 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1127 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1128 | 0 \ |
| 1129 | -C "found session_ticket extension" \ |
| 1130 | -C "parse new session ticket" \ |
| 1131 | -c "a session has been resumed" |
| 1132 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1133 | # Tests for Max Fragment Length extension |
| 1134 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1135 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1136 | "$P_SRV debug_level=3" \ |
| 1137 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1138 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1139 | -c "Maximum fragment length is 16384" \ |
| 1140 | -s "Maximum fragment length is 16384" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1141 | -C "client hello, adding max_fragment_length extension" \ |
| 1142 | -S "found max fragment length extension" \ |
| 1143 | -S "server hello, max_fragment_length extension" \ |
| 1144 | -C "found max_fragment_length extension" |
| 1145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1146 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1147 | "$P_SRV debug_level=3" \ |
| 1148 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1149 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1150 | -c "Maximum fragment length is 4096" \ |
| 1151 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1152 | -c "client hello, adding max_fragment_length extension" \ |
| 1153 | -s "found max fragment length extension" \ |
| 1154 | -s "server hello, max_fragment_length extension" \ |
| 1155 | -c "found max_fragment_length extension" |
| 1156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1157 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1158 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1159 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1160 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1161 | -c "Maximum fragment length is 16384" \ |
| 1162 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1163 | -C "client hello, adding max_fragment_length extension" \ |
| 1164 | -S "found max fragment length extension" \ |
| 1165 | -S "server hello, max_fragment_length extension" \ |
| 1166 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1167 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1168 | requires_gnutls |
| 1169 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1170 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1171 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1172 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1173 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1174 | -c "client hello, adding max_fragment_length extension" \ |
| 1175 | -c "found max_fragment_length extension" |
| 1176 | |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1177 | run_test "Max fragment length: client, message just fits" \ |
| 1178 | "$P_SRV debug_level=3" \ |
| 1179 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1180 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1181 | -c "Maximum fragment length is 2048" \ |
| 1182 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1183 | -c "client hello, adding max_fragment_length extension" \ |
| 1184 | -s "found max fragment length extension" \ |
| 1185 | -s "server hello, max_fragment_length extension" \ |
| 1186 | -c "found max_fragment_length extension" \ |
| 1187 | -c "2048 bytes written in 1 fragments" \ |
| 1188 | -s "2048 bytes read" |
| 1189 | |
| 1190 | run_test "Max fragment length: client, larger message" \ |
| 1191 | "$P_SRV debug_level=3" \ |
| 1192 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1193 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1194 | -c "Maximum fragment length is 2048" \ |
| 1195 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1196 | -c "client hello, adding max_fragment_length extension" \ |
| 1197 | -s "found max fragment length extension" \ |
| 1198 | -s "server hello, max_fragment_length extension" \ |
| 1199 | -c "found max_fragment_length extension" \ |
| 1200 | -c "2345 bytes written in 2 fragments" \ |
| 1201 | -s "2048 bytes read" \ |
| 1202 | -s "297 bytes read" |
| 1203 | |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1204 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1205 | "$P_SRV debug_level=3 dtls=1" \ |
| 1206 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1207 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1208 | -c "Maximum fragment length is 2048" \ |
| 1209 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1210 | -c "client hello, adding max_fragment_length extension" \ |
| 1211 | -s "found max fragment length extension" \ |
| 1212 | -s "server hello, max_fragment_length extension" \ |
| 1213 | -c "found max_fragment_length extension" \ |
| 1214 | -c "fragment larger than.*maximum" |
| 1215 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1216 | # Tests for renegotiation |
| 1217 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1218 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1219 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1220 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1221 | 0 \ |
| 1222 | -C "client hello, adding renegotiation extension" \ |
| 1223 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1224 | -S "found renegotiation extension" \ |
| 1225 | -s "server hello, secure renegotiation extension" \ |
| 1226 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1227 | -C "=> renegotiate" \ |
| 1228 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1229 | -S "write hello request" |
| 1230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1231 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1232 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1233 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1234 | 0 \ |
| 1235 | -c "client hello, adding renegotiation extension" \ |
| 1236 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1237 | -s "found renegotiation extension" \ |
| 1238 | -s "server hello, secure renegotiation extension" \ |
| 1239 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1240 | -c "=> renegotiate" \ |
| 1241 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1242 | -S "write hello request" |
| 1243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1244 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1245 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1246 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1247 | 0 \ |
| 1248 | -c "client hello, adding renegotiation extension" \ |
| 1249 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1250 | -s "found renegotiation extension" \ |
| 1251 | -s "server hello, secure renegotiation extension" \ |
| 1252 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1253 | -c "=> renegotiate" \ |
| 1254 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1255 | -s "write hello request" |
| 1256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1257 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1258 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1259 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1260 | 0 \ |
| 1261 | -c "client hello, adding renegotiation extension" \ |
| 1262 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1263 | -s "found renegotiation extension" \ |
| 1264 | -s "server hello, secure renegotiation extension" \ |
| 1265 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1266 | -c "=> renegotiate" \ |
| 1267 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1268 | -s "write hello request" |
| 1269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1270 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1271 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1272 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1273 | 1 \ |
| 1274 | -c "client hello, adding renegotiation extension" \ |
| 1275 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1276 | -S "found renegotiation extension" \ |
| 1277 | -s "server hello, secure renegotiation extension" \ |
| 1278 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1279 | -c "=> renegotiate" \ |
| 1280 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1281 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1282 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1283 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1285 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1286 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1287 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1288 | 0 \ |
| 1289 | -C "client hello, adding renegotiation extension" \ |
| 1290 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1291 | -S "found renegotiation extension" \ |
| 1292 | -s "server hello, secure renegotiation extension" \ |
| 1293 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1294 | -C "=> renegotiate" \ |
| 1295 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1296 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1297 | -S "SSL - An unexpected message was received from our peer" \ |
| 1298 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1300 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1301 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1302 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1303 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1304 | 0 \ |
| 1305 | -C "client hello, adding renegotiation extension" \ |
| 1306 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1307 | -S "found renegotiation extension" \ |
| 1308 | -s "server hello, secure renegotiation extension" \ |
| 1309 | -c "found renegotiation extension" \ |
| 1310 | -C "=> renegotiate" \ |
| 1311 | -S "=> renegotiate" \ |
| 1312 | -s "write hello request" \ |
| 1313 | -S "SSL - An unexpected message was received from our peer" \ |
| 1314 | -S "failed" |
| 1315 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1316 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1317 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1318 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1319 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1320 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1321 | 0 \ |
| 1322 | -C "client hello, adding renegotiation extension" \ |
| 1323 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1324 | -S "found renegotiation extension" \ |
| 1325 | -s "server hello, secure renegotiation extension" \ |
| 1326 | -c "found renegotiation extension" \ |
| 1327 | -C "=> renegotiate" \ |
| 1328 | -S "=> renegotiate" \ |
| 1329 | -s "write hello request" \ |
| 1330 | -S "SSL - An unexpected message was received from our peer" \ |
| 1331 | -S "failed" |
| 1332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1333 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1334 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1335 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1336 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1337 | 0 \ |
| 1338 | -C "client hello, adding renegotiation extension" \ |
| 1339 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1340 | -S "found renegotiation extension" \ |
| 1341 | -s "server hello, secure renegotiation extension" \ |
| 1342 | -c "found renegotiation extension" \ |
| 1343 | -C "=> renegotiate" \ |
| 1344 | -S "=> renegotiate" \ |
| 1345 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1346 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1347 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1348 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1349 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1350 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1351 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1352 | 0 \ |
| 1353 | -c "client hello, adding renegotiation extension" \ |
| 1354 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1355 | -s "found renegotiation extension" \ |
| 1356 | -s "server hello, secure renegotiation extension" \ |
| 1357 | -c "found renegotiation extension" \ |
| 1358 | -c "=> renegotiate" \ |
| 1359 | -s "=> renegotiate" \ |
| 1360 | -s "write hello request" \ |
| 1361 | -S "SSL - An unexpected message was received from our peer" \ |
| 1362 | -S "failed" |
| 1363 | |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1364 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1365 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1366 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1367 | 0 \ |
| 1368 | -C "client hello, adding renegotiation extension" \ |
| 1369 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1370 | -S "found renegotiation extension" \ |
| 1371 | -s "server hello, secure renegotiation extension" \ |
| 1372 | -c "found renegotiation extension" \ |
| 1373 | -S "record counter limit reached: renegotiate" \ |
| 1374 | -C "=> renegotiate" \ |
| 1375 | -S "=> renegotiate" \ |
| 1376 | -S "write hello request" \ |
| 1377 | -S "SSL - An unexpected message was received from our peer" \ |
| 1378 | -S "failed" |
| 1379 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1380 | # one extra exchange to be able to complete renego |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1381 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1382 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1383 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1384 | 0 \ |
| 1385 | -c "client hello, adding renegotiation extension" \ |
| 1386 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1387 | -s "found renegotiation extension" \ |
| 1388 | -s "server hello, secure renegotiation extension" \ |
| 1389 | -c "found renegotiation extension" \ |
| 1390 | -s "record counter limit reached: renegotiate" \ |
| 1391 | -c "=> renegotiate" \ |
| 1392 | -s "=> renegotiate" \ |
| 1393 | -s "write hello request" \ |
| 1394 | -S "SSL - An unexpected message was received from our peer" \ |
| 1395 | -S "failed" |
| 1396 | |
| 1397 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1398 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1399 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1400 | 0 \ |
| 1401 | -c "client hello, adding renegotiation extension" \ |
| 1402 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1403 | -s "found renegotiation extension" \ |
| 1404 | -s "server hello, secure renegotiation extension" \ |
| 1405 | -c "found renegotiation extension" \ |
| 1406 | -s "record counter limit reached: renegotiate" \ |
| 1407 | -c "=> renegotiate" \ |
| 1408 | -s "=> renegotiate" \ |
| 1409 | -s "write hello request" \ |
| 1410 | -S "SSL - An unexpected message was received from our peer" \ |
| 1411 | -S "failed" |
| 1412 | |
| 1413 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1414 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1415 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1416 | 0 \ |
| 1417 | -C "client hello, adding renegotiation extension" \ |
| 1418 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1419 | -S "found renegotiation extension" \ |
| 1420 | -s "server hello, secure renegotiation extension" \ |
| 1421 | -c "found renegotiation extension" \ |
| 1422 | -S "record counter limit reached: renegotiate" \ |
| 1423 | -C "=> renegotiate" \ |
| 1424 | -S "=> renegotiate" \ |
| 1425 | -S "write hello request" \ |
| 1426 | -S "SSL - An unexpected message was received from our peer" \ |
| 1427 | -S "failed" |
| 1428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1429 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1430 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1431 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 1432 | 0 \ |
| 1433 | -c "client hello, adding renegotiation extension" \ |
| 1434 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1435 | -s "found renegotiation extension" \ |
| 1436 | -s "server hello, secure renegotiation extension" \ |
| 1437 | -c "found renegotiation extension" \ |
| 1438 | -c "=> renegotiate" \ |
| 1439 | -s "=> renegotiate" \ |
| 1440 | -S "write hello request" |
| 1441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1442 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1443 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1444 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 1445 | 0 \ |
| 1446 | -c "client hello, adding renegotiation extension" \ |
| 1447 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1448 | -s "found renegotiation extension" \ |
| 1449 | -s "server hello, secure renegotiation extension" \ |
| 1450 | -c "found renegotiation extension" \ |
| 1451 | -c "=> renegotiate" \ |
| 1452 | -s "=> renegotiate" \ |
| 1453 | -s "write hello request" |
| 1454 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1455 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1456 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1457 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1458 | 0 \ |
| 1459 | -c "client hello, adding renegotiation extension" \ |
| 1460 | -c "found renegotiation extension" \ |
| 1461 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1462 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1463 | -C "error" \ |
| 1464 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1465 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1466 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1467 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1468 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1469 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1470 | 0 \ |
| 1471 | -c "client hello, adding renegotiation extension" \ |
| 1472 | -c "found renegotiation extension" \ |
| 1473 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1474 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1475 | -C "error" \ |
| 1476 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1477 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1478 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1479 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1480 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1481 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1482 | 1 \ |
| 1483 | -c "client hello, adding renegotiation extension" \ |
| 1484 | -C "found renegotiation extension" \ |
| 1485 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1486 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1487 | -c "error" \ |
| 1488 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1489 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1490 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1491 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1492 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1493 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1494 | allow_legacy=0" \ |
| 1495 | 1 \ |
| 1496 | -c "client hello, adding renegotiation extension" \ |
| 1497 | -C "found renegotiation extension" \ |
| 1498 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1499 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1500 | -c "error" \ |
| 1501 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1502 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1503 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1504 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1505 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1506 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1507 | allow_legacy=1" \ |
| 1508 | 0 \ |
| 1509 | -c "client hello, adding renegotiation extension" \ |
| 1510 | -C "found renegotiation extension" \ |
| 1511 | -c "=> renegotiate" \ |
| 1512 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1513 | -C "error" \ |
| 1514 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1515 | |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1516 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1517 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1518 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1519 | 0 \ |
| 1520 | -c "client hello, adding renegotiation extension" \ |
| 1521 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1522 | -s "found renegotiation extension" \ |
| 1523 | -s "server hello, secure renegotiation extension" \ |
| 1524 | -c "found renegotiation extension" \ |
| 1525 | -c "=> renegotiate" \ |
| 1526 | -s "=> renegotiate" \ |
| 1527 | -S "write hello request" |
| 1528 | |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1529 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1530 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | df9a0a8 | 2014-10-02 14:17:18 +0200 | [diff] [blame] | 1531 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1532 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1533 | 0 \ |
| 1534 | -c "client hello, adding renegotiation extension" \ |
| 1535 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1536 | -s "found renegotiation extension" \ |
| 1537 | -s "server hello, secure renegotiation extension" \ |
| 1538 | -c "found renegotiation extension" \ |
| 1539 | -c "=> renegotiate" \ |
| 1540 | -s "=> renegotiate" \ |
| 1541 | -s "write hello request" |
| 1542 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 1543 | requires_gnutls |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1544 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 1545 | "$G_SRV -u --mtu 4096" \ |
| 1546 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1547 | 0 \ |
| 1548 | -c "client hello, adding renegotiation extension" \ |
| 1549 | -c "found renegotiation extension" \ |
| 1550 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1551 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1552 | -C "error" \ |
| 1553 | -s "Extra-header:" |
| 1554 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1555 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 1556 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1557 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1558 | run_test "Renego ext: gnutls server strict, client default" \ |
| 1559 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1560 | "$P_CLI debug_level=3" \ |
| 1561 | 0 \ |
| 1562 | -c "found renegotiation extension" \ |
| 1563 | -C "error" \ |
| 1564 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1565 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1566 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1567 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 1568 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1569 | "$P_CLI debug_level=3" \ |
| 1570 | 0 \ |
| 1571 | -C "found renegotiation extension" \ |
| 1572 | -C "error" \ |
| 1573 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1574 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1575 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1576 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 1577 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1578 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 1579 | 1 \ |
| 1580 | -C "found renegotiation extension" \ |
| 1581 | -c "error" \ |
| 1582 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1583 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1584 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1585 | run_test "Renego ext: gnutls client strict, server default" \ |
| 1586 | "$P_SRV debug_level=3" \ |
| 1587 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1588 | 0 \ |
| 1589 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1590 | -s "server hello, secure renegotiation extension" |
| 1591 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1592 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1593 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 1594 | "$P_SRV debug_level=3" \ |
| 1595 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1596 | 0 \ |
| 1597 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1598 | -S "server hello, secure renegotiation extension" |
| 1599 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1600 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1601 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 1602 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 1603 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1604 | 1 \ |
| 1605 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1606 | -S "server hello, secure renegotiation extension" |
| 1607 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 1608 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 1609 | |
| 1610 | requires_gnutls |
| 1611 | run_test "DER format: no trailing bytes" \ |
| 1612 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 1613 | key_file=data_files/server5.key" \ |
| 1614 | "$G_CLI " \ |
| 1615 | 0 \ |
| 1616 | -c "Handshake was completed" \ |
| 1617 | |
| 1618 | requires_gnutls |
| 1619 | run_test "DER format: with a trailing zero byte" \ |
| 1620 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 1621 | key_file=data_files/server5.key" \ |
| 1622 | "$G_CLI " \ |
| 1623 | 0 \ |
| 1624 | -c "Handshake was completed" \ |
| 1625 | |
| 1626 | requires_gnutls |
| 1627 | run_test "DER format: with a trailing random byte" \ |
| 1628 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 1629 | key_file=data_files/server5.key" \ |
| 1630 | "$G_CLI " \ |
| 1631 | 0 \ |
| 1632 | -c "Handshake was completed" \ |
| 1633 | |
| 1634 | requires_gnutls |
| 1635 | run_test "DER format: with 2 trailing random bytes" \ |
| 1636 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 1637 | key_file=data_files/server5.key" \ |
| 1638 | "$G_CLI " \ |
| 1639 | 0 \ |
| 1640 | -c "Handshake was completed" \ |
| 1641 | |
| 1642 | requires_gnutls |
| 1643 | run_test "DER format: with 4 trailing random bytes" \ |
| 1644 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 1645 | key_file=data_files/server5.key" \ |
| 1646 | "$G_CLI " \ |
| 1647 | 0 \ |
| 1648 | -c "Handshake was completed" \ |
| 1649 | |
| 1650 | requires_gnutls |
| 1651 | run_test "DER format: with 8 trailing random bytes" \ |
| 1652 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 1653 | key_file=data_files/server5.key" \ |
| 1654 | "$G_CLI " \ |
| 1655 | 0 \ |
| 1656 | -c "Handshake was completed" \ |
| 1657 | |
| 1658 | requires_gnutls |
| 1659 | run_test "DER format: with 9 trailing random bytes" \ |
| 1660 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 1661 | key_file=data_files/server5.key" \ |
| 1662 | "$G_CLI " \ |
| 1663 | 0 \ |
| 1664 | -c "Handshake was completed" \ |
| 1665 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1666 | # Tests for auth_mode |
| 1667 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1668 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1669 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1670 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1671 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1672 | 1 \ |
| 1673 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1674 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1675 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1676 | -c "X509 - Certificate verification failed" |
| 1677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1678 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1679 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1680 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1681 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1682 | 0 \ |
| 1683 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1684 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1685 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1686 | -C "X509 - Certificate verification failed" |
| 1687 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1688 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1689 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1690 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1691 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1692 | 0 \ |
| 1693 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1694 | -C "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1695 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1696 | -C "X509 - Certificate verification failed" |
| 1697 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1698 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1699 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 1700 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1701 | key_file=data_files/server5.key" \ |
| 1702 | 1 \ |
| 1703 | -S "skip write certificate request" \ |
| 1704 | -C "skip parse certificate request" \ |
| 1705 | -c "got a certificate request" \ |
| 1706 | -C "skip write certificate" \ |
| 1707 | -C "skip write certificate verify" \ |
| 1708 | -S "skip parse certificate verify" \ |
| 1709 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1710 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1711 | -s "! mbedtls_ssl_handshake returned" \ |
| 1712 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1713 | -s "X509 - Certificate verification failed" |
| 1714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1715 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1716 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1717 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1718 | key_file=data_files/server5.key" \ |
| 1719 | 0 \ |
| 1720 | -S "skip write certificate request" \ |
| 1721 | -C "skip parse certificate request" \ |
| 1722 | -c "got a certificate request" \ |
| 1723 | -C "skip write certificate" \ |
| 1724 | -C "skip write certificate verify" \ |
| 1725 | -S "skip parse certificate verify" \ |
| 1726 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1727 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1728 | -S "! mbedtls_ssl_handshake returned" \ |
| 1729 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1730 | -S "X509 - Certificate verification failed" |
| 1731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1732 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1733 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1734 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1735 | key_file=data_files/server5.key" \ |
| 1736 | 0 \ |
| 1737 | -s "skip write certificate request" \ |
| 1738 | -C "skip parse certificate request" \ |
| 1739 | -c "got no certificate request" \ |
| 1740 | -c "skip write certificate" \ |
| 1741 | -c "skip write certificate verify" \ |
| 1742 | -s "skip parse certificate verify" \ |
| 1743 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1744 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1745 | -S "! mbedtls_ssl_handshake returned" \ |
| 1746 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1747 | -S "X509 - Certificate verification failed" |
| 1748 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1749 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1750 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1751 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1752 | 0 \ |
| 1753 | -S "skip write certificate request" \ |
| 1754 | -C "skip parse certificate request" \ |
| 1755 | -c "got a certificate request" \ |
| 1756 | -C "skip write certificate$" \ |
| 1757 | -C "got no certificate to send" \ |
| 1758 | -S "SSLv3 client has no certificate" \ |
| 1759 | -c "skip write certificate verify" \ |
| 1760 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1761 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1762 | -S "! mbedtls_ssl_handshake returned" \ |
| 1763 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1764 | -S "X509 - Certificate verification failed" |
| 1765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1766 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1767 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1768 | "$O_CLI" \ |
| 1769 | 0 \ |
| 1770 | -S "skip write certificate request" \ |
| 1771 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1772 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1773 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1774 | -S "X509 - Certificate verification failed" |
| 1775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1776 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1777 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1778 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1779 | 0 \ |
| 1780 | -C "skip parse certificate request" \ |
| 1781 | -c "got a certificate request" \ |
| 1782 | -C "skip write certificate$" \ |
| 1783 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1784 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1785 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1786 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1787 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1788 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 1789 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1790 | 0 \ |
| 1791 | -S "skip write certificate request" \ |
| 1792 | -C "skip parse certificate request" \ |
| 1793 | -c "got a certificate request" \ |
| 1794 | -C "skip write certificate$" \ |
| 1795 | -c "skip write certificate verify" \ |
| 1796 | -c "got no certificate to send" \ |
| 1797 | -s "SSLv3 client has no certificate" \ |
| 1798 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1799 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1800 | -S "! mbedtls_ssl_handshake returned" \ |
| 1801 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1802 | -S "X509 - Certificate verification failed" |
| 1803 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 1804 | # Tests for certificate selection based on SHA verson |
| 1805 | |
| 1806 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 1807 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1808 | key_file=data_files/server5.key \ |
| 1809 | crt_file2=data_files/server5-sha1.crt \ |
| 1810 | key_file2=data_files/server5.key" \ |
| 1811 | "$P_CLI force_version=tls1_2" \ |
| 1812 | 0 \ |
| 1813 | -c "signed using.*ECDSA with SHA256" \ |
| 1814 | -C "signed using.*ECDSA with SHA1" |
| 1815 | |
| 1816 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 1817 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1818 | key_file=data_files/server5.key \ |
| 1819 | crt_file2=data_files/server5-sha1.crt \ |
| 1820 | key_file2=data_files/server5.key" \ |
| 1821 | "$P_CLI force_version=tls1_1" \ |
| 1822 | 0 \ |
| 1823 | -C "signed using.*ECDSA with SHA256" \ |
| 1824 | -c "signed using.*ECDSA with SHA1" |
| 1825 | |
| 1826 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 1827 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1828 | key_file=data_files/server5.key \ |
| 1829 | crt_file2=data_files/server5-sha1.crt \ |
| 1830 | key_file2=data_files/server5.key" \ |
| 1831 | "$P_CLI force_version=tls1" \ |
| 1832 | 0 \ |
| 1833 | -C "signed using.*ECDSA with SHA256" \ |
| 1834 | -c "signed using.*ECDSA with SHA1" |
| 1835 | |
| 1836 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 1837 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1838 | key_file=data_files/server5.key \ |
| 1839 | crt_file2=data_files/server6.crt \ |
| 1840 | key_file2=data_files/server6.key" \ |
| 1841 | "$P_CLI force_version=tls1_1" \ |
| 1842 | 0 \ |
| 1843 | -c "serial number.*09" \ |
| 1844 | -c "signed using.*ECDSA with SHA256" \ |
| 1845 | -C "signed using.*ECDSA with SHA1" |
| 1846 | |
| 1847 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 1848 | "$P_SRV crt_file=data_files/server6.crt \ |
| 1849 | key_file=data_files/server6.key \ |
| 1850 | crt_file2=data_files/server5.crt \ |
| 1851 | key_file2=data_files/server5.key" \ |
| 1852 | "$P_CLI force_version=tls1_1" \ |
| 1853 | 0 \ |
| 1854 | -c "serial number.*0A" \ |
| 1855 | -c "signed using.*ECDSA with SHA256" \ |
| 1856 | -C "signed using.*ECDSA with SHA1" |
| 1857 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1858 | # tests for SNI |
| 1859 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1860 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1861 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1862 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1863 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1864 | 0 \ |
| 1865 | -S "parse ServerName extension" \ |
| 1866 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1867 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1869 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1870 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1871 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1872 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1873 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1874 | 0 \ |
| 1875 | -s "parse ServerName extension" \ |
| 1876 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1877 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1879 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1880 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1881 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1882 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1883 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1884 | 0 \ |
| 1885 | -s "parse ServerName extension" \ |
| 1886 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1887 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1888 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1889 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1890 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1891 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1892 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1893 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1894 | 1 \ |
| 1895 | -s "parse ServerName extension" \ |
| 1896 | -s "ssl_sni_wrapper() returned" \ |
| 1897 | -s "mbedtls_ssl_handshake returned" \ |
| 1898 | -c "mbedtls_ssl_handshake returned" \ |
| 1899 | -c "SSL - A fatal alert message was received from our peer" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1900 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1901 | run_test "SNI: client auth no override: optional" \ |
| 1902 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1903 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1904 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 1905 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1906 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1907 | -S "skip write certificate request" \ |
| 1908 | -C "skip parse certificate request" \ |
| 1909 | -c "got a certificate request" \ |
| 1910 | -C "skip write certificate" \ |
| 1911 | -C "skip write certificate verify" \ |
| 1912 | -S "skip parse certificate verify" |
| 1913 | |
| 1914 | run_test "SNI: client auth override: none -> optional" \ |
| 1915 | "$P_SRV debug_level=3 auth_mode=none \ |
| 1916 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1917 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 1918 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1919 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1920 | -S "skip write certificate request" \ |
| 1921 | -C "skip parse certificate request" \ |
| 1922 | -c "got a certificate request" \ |
| 1923 | -C "skip write certificate" \ |
| 1924 | -C "skip write certificate verify" \ |
| 1925 | -S "skip parse certificate verify" |
| 1926 | |
| 1927 | run_test "SNI: client auth override: optional -> none" \ |
| 1928 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1929 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1930 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 1931 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1932 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1933 | -s "skip write certificate request" \ |
| 1934 | -C "skip parse certificate request" \ |
| 1935 | -c "got no certificate request" \ |
| 1936 | -c "skip write certificate" \ |
| 1937 | -c "skip write certificate verify" \ |
| 1938 | -s "skip parse certificate verify" |
| 1939 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1940 | run_test "SNI: CA no override" \ |
| 1941 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1942 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1943 | ca_file=data_files/test-ca.crt \ |
| 1944 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 1945 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1946 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1947 | 1 \ |
| 1948 | -S "skip write certificate request" \ |
| 1949 | -C "skip parse certificate request" \ |
| 1950 | -c "got a certificate request" \ |
| 1951 | -C "skip write certificate" \ |
| 1952 | -C "skip write certificate verify" \ |
| 1953 | -S "skip parse certificate verify" \ |
| 1954 | -s "x509_verify_cert() returned" \ |
| 1955 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 1956 | -S "The certificate has been revoked (is on a CRL)" |
| 1957 | |
| 1958 | run_test "SNI: CA override" \ |
| 1959 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1960 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1961 | ca_file=data_files/test-ca.crt \ |
| 1962 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 1963 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1964 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1965 | 0 \ |
| 1966 | -S "skip write certificate request" \ |
| 1967 | -C "skip parse certificate request" \ |
| 1968 | -c "got a certificate request" \ |
| 1969 | -C "skip write certificate" \ |
| 1970 | -C "skip write certificate verify" \ |
| 1971 | -S "skip parse certificate verify" \ |
| 1972 | -S "x509_verify_cert() returned" \ |
| 1973 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 1974 | -S "The certificate has been revoked (is on a CRL)" |
| 1975 | |
| 1976 | run_test "SNI: CA override with CRL" \ |
| 1977 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1978 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1979 | ca_file=data_files/test-ca.crt \ |
| 1980 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 1981 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1982 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1983 | 1 \ |
| 1984 | -S "skip write certificate request" \ |
| 1985 | -C "skip parse certificate request" \ |
| 1986 | -c "got a certificate request" \ |
| 1987 | -C "skip write certificate" \ |
| 1988 | -C "skip write certificate verify" \ |
| 1989 | -S "skip parse certificate verify" \ |
| 1990 | -s "x509_verify_cert() returned" \ |
| 1991 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 1992 | -s "The certificate has been revoked (is on a CRL)" |
| 1993 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1994 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1996 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1997 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1998 | "$P_CLI nbio=2 tickets=0" \ |
| 1999 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2000 | -S "mbedtls_ssl_handshake returned" \ |
| 2001 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2002 | -c "Read from server: .* bytes read" |
| 2003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2004 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2005 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2006 | "$P_CLI nbio=2 tickets=0" \ |
| 2007 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2008 | -S "mbedtls_ssl_handshake returned" \ |
| 2009 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2010 | -c "Read from server: .* bytes read" |
| 2011 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2012 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2013 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2014 | "$P_CLI nbio=2 tickets=1" \ |
| 2015 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2016 | -S "mbedtls_ssl_handshake returned" \ |
| 2017 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2018 | -c "Read from server: .* bytes read" |
| 2019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2020 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2021 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2022 | "$P_CLI nbio=2 tickets=1" \ |
| 2023 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2024 | -S "mbedtls_ssl_handshake returned" \ |
| 2025 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2026 | -c "Read from server: .* bytes read" |
| 2027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2028 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2029 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2030 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2031 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2032 | -S "mbedtls_ssl_handshake returned" \ |
| 2033 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2034 | -c "Read from server: .* bytes read" |
| 2035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2036 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2037 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2038 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2039 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2040 | -S "mbedtls_ssl_handshake returned" \ |
| 2041 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2042 | -c "Read from server: .* bytes read" |
| 2043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2044 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2045 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2046 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 2047 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2048 | -S "mbedtls_ssl_handshake returned" \ |
| 2049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2050 | -c "Read from server: .* bytes read" |
| 2051 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2052 | # Tests for version negotiation |
| 2053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2054 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2055 | "$P_SRV" \ |
| 2056 | "$P_CLI" \ |
| 2057 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2058 | -S "mbedtls_ssl_handshake returned" \ |
| 2059 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2060 | -s "Protocol is TLSv1.2" \ |
| 2061 | -c "Protocol is TLSv1.2" |
| 2062 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2063 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2064 | "$P_SRV" \ |
| 2065 | "$P_CLI max_version=tls1_1" \ |
| 2066 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2067 | -S "mbedtls_ssl_handshake returned" \ |
| 2068 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2069 | -s "Protocol is TLSv1.1" \ |
| 2070 | -c "Protocol is TLSv1.1" |
| 2071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2072 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2073 | "$P_SRV max_version=tls1_1" \ |
| 2074 | "$P_CLI" \ |
| 2075 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2076 | -S "mbedtls_ssl_handshake returned" \ |
| 2077 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2078 | -s "Protocol is TLSv1.1" \ |
| 2079 | -c "Protocol is TLSv1.1" |
| 2080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2081 | run_test "Version check: cli+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2082 | "$P_SRV max_version=tls1_1" \ |
| 2083 | "$P_CLI max_version=tls1_1" \ |
| 2084 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2085 | -S "mbedtls_ssl_handshake returned" \ |
| 2086 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2087 | -s "Protocol is TLSv1.1" \ |
| 2088 | -c "Protocol is TLSv1.1" |
| 2089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2090 | run_test "Version check: cli max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2091 | "$P_SRV min_version=tls1_1" \ |
| 2092 | "$P_CLI max_version=tls1_1" \ |
| 2093 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2094 | -S "mbedtls_ssl_handshake returned" \ |
| 2095 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2096 | -s "Protocol is TLSv1.1" \ |
| 2097 | -c "Protocol is TLSv1.1" |
| 2098 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2099 | run_test "Version check: cli min 1.1, srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2100 | "$P_SRV max_version=tls1_1" \ |
| 2101 | "$P_CLI min_version=tls1_1" \ |
| 2102 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2103 | -S "mbedtls_ssl_handshake returned" \ |
| 2104 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2105 | -s "Protocol is TLSv1.1" \ |
| 2106 | -c "Protocol is TLSv1.1" |
| 2107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2108 | run_test "Version check: cli min 1.2, srv max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2109 | "$P_SRV max_version=tls1_1" \ |
| 2110 | "$P_CLI min_version=tls1_2" \ |
| 2111 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2112 | -s "mbedtls_ssl_handshake returned" \ |
| 2113 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2114 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 2115 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2116 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2117 | "$P_SRV min_version=tls1_2" \ |
| 2118 | "$P_CLI max_version=tls1_1" \ |
| 2119 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2120 | -s "mbedtls_ssl_handshake returned" \ |
| 2121 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2122 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 2123 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2124 | # Tests for ALPN extension |
| 2125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2126 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2127 | "$P_SRV debug_level=3" \ |
| 2128 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2129 | 0 \ |
| 2130 | -C "client hello, adding alpn extension" \ |
| 2131 | -S "found alpn extension" \ |
| 2132 | -C "got an alert message, type: \\[2:120]" \ |
| 2133 | -S "server hello, adding alpn extension" \ |
| 2134 | -C "found alpn extension " \ |
| 2135 | -C "Application Layer Protocol is" \ |
| 2136 | -S "Application Layer Protocol is" |
| 2137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2138 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2139 | "$P_SRV debug_level=3" \ |
| 2140 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2141 | 0 \ |
| 2142 | -c "client hello, adding alpn extension" \ |
| 2143 | -s "found alpn extension" \ |
| 2144 | -C "got an alert message, type: \\[2:120]" \ |
| 2145 | -S "server hello, adding alpn extension" \ |
| 2146 | -C "found alpn extension " \ |
| 2147 | -c "Application Layer Protocol is (none)" \ |
| 2148 | -S "Application Layer Protocol is" |
| 2149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2150 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2151 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2152 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2153 | 0 \ |
| 2154 | -C "client hello, adding alpn extension" \ |
| 2155 | -S "found alpn extension" \ |
| 2156 | -C "got an alert message, type: \\[2:120]" \ |
| 2157 | -S "server hello, adding alpn extension" \ |
| 2158 | -C "found alpn extension " \ |
| 2159 | -C "Application Layer Protocol is" \ |
| 2160 | -s "Application Layer Protocol is (none)" |
| 2161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2162 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2163 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2164 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2165 | 0 \ |
| 2166 | -c "client hello, adding alpn extension" \ |
| 2167 | -s "found alpn extension" \ |
| 2168 | -C "got an alert message, type: \\[2:120]" \ |
| 2169 | -s "server hello, adding alpn extension" \ |
| 2170 | -c "found alpn extension" \ |
| 2171 | -c "Application Layer Protocol is abc" \ |
| 2172 | -s "Application Layer Protocol is abc" |
| 2173 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2174 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2175 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2176 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2177 | 0 \ |
| 2178 | -c "client hello, adding alpn extension" \ |
| 2179 | -s "found alpn extension" \ |
| 2180 | -C "got an alert message, type: \\[2:120]" \ |
| 2181 | -s "server hello, adding alpn extension" \ |
| 2182 | -c "found alpn extension" \ |
| 2183 | -c "Application Layer Protocol is abc" \ |
| 2184 | -s "Application Layer Protocol is abc" |
| 2185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2186 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2187 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2188 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2189 | 0 \ |
| 2190 | -c "client hello, adding alpn extension" \ |
| 2191 | -s "found alpn extension" \ |
| 2192 | -C "got an alert message, type: \\[2:120]" \ |
| 2193 | -s "server hello, adding alpn extension" \ |
| 2194 | -c "found alpn extension" \ |
| 2195 | -c "Application Layer Protocol is 1234" \ |
| 2196 | -s "Application Layer Protocol is 1234" |
| 2197 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2198 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2199 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 2200 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2201 | 1 \ |
| 2202 | -c "client hello, adding alpn extension" \ |
| 2203 | -s "found alpn extension" \ |
| 2204 | -c "got an alert message, type: \\[2:120]" \ |
| 2205 | -S "server hello, adding alpn extension" \ |
| 2206 | -C "found alpn extension" \ |
| 2207 | -C "Application Layer Protocol is 1234" \ |
| 2208 | -S "Application Layer Protocol is 1234" |
| 2209 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2210 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2211 | # Tests for keyUsage in leaf certificates, part 1: |
| 2212 | # server-side certificate/suite selection |
| 2213 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2214 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2215 | "$P_SRV key_file=data_files/server2.key \ |
| 2216 | crt_file=data_files/server2.ku-ds.crt" \ |
| 2217 | "$P_CLI" \ |
| 2218 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2219 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2220 | |
| 2221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2222 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2223 | "$P_SRV key_file=data_files/server2.key \ |
| 2224 | crt_file=data_files/server2.ku-ke.crt" \ |
| 2225 | "$P_CLI" \ |
| 2226 | 0 \ |
| 2227 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 2228 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2229 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2230 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2231 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2232 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2233 | 1 \ |
| 2234 | -C "Ciphersuite is " |
| 2235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2236 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2237 | "$P_SRV key_file=data_files/server5.key \ |
| 2238 | crt_file=data_files/server5.ku-ds.crt" \ |
| 2239 | "$P_CLI" \ |
| 2240 | 0 \ |
| 2241 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 2242 | |
| 2243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2244 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2245 | "$P_SRV key_file=data_files/server5.key \ |
| 2246 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2247 | "$P_CLI" \ |
| 2248 | 0 \ |
| 2249 | -c "Ciphersuite is TLS-ECDH-" |
| 2250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2251 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2252 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2253 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2254 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2255 | 1 \ |
| 2256 | -C "Ciphersuite is " |
| 2257 | |
| 2258 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2259 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2260 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2261 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2262 | "$O_SRV -key data_files/server2.key \ |
| 2263 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2264 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2265 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2266 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2267 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2268 | -C "Processing of the Certificate handshake message failed" \ |
| 2269 | -c "Ciphersuite is TLS-" |
| 2270 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2271 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2272 | "$O_SRV -key data_files/server2.key \ |
| 2273 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2274 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2275 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2276 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2277 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2278 | -C "Processing of the Certificate handshake message failed" \ |
| 2279 | -c "Ciphersuite is TLS-" |
| 2280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2281 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2282 | "$O_SRV -key data_files/server2.key \ |
| 2283 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2284 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2285 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2286 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2287 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2288 | -C "Processing of the Certificate handshake message failed" \ |
| 2289 | -c "Ciphersuite is TLS-" |
| 2290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2291 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2292 | "$O_SRV -key data_files/server2.key \ |
| 2293 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2294 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2295 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2296 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2297 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2298 | -c "Processing of the Certificate handshake message failed" \ |
| 2299 | -C "Ciphersuite is TLS-" |
| 2300 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2301 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 2302 | "$O_SRV -key data_files/server2.key \ |
| 2303 | -cert data_files/server2.ku-ke.crt" \ |
| 2304 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2305 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2306 | 0 \ |
| 2307 | -c "bad certificate (usage extensions)" \ |
| 2308 | -C "Processing of the Certificate handshake message failed" \ |
| 2309 | -c "Ciphersuite is TLS-" \ |
| 2310 | -c "! Usage does not match the keyUsage extension" |
| 2311 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2312 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2313 | "$O_SRV -key data_files/server2.key \ |
| 2314 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2315 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2316 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2317 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2318 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2319 | -C "Processing of the Certificate handshake message failed" \ |
| 2320 | -c "Ciphersuite is TLS-" |
| 2321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2322 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2323 | "$O_SRV -key data_files/server2.key \ |
| 2324 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2325 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2326 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2327 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2328 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2329 | -c "Processing of the Certificate handshake message failed" \ |
| 2330 | -C "Ciphersuite is TLS-" |
| 2331 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2332 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 2333 | "$O_SRV -key data_files/server2.key \ |
| 2334 | -cert data_files/server2.ku-ds.crt" \ |
| 2335 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2336 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2337 | 0 \ |
| 2338 | -c "bad certificate (usage extensions)" \ |
| 2339 | -C "Processing of the Certificate handshake message failed" \ |
| 2340 | -c "Ciphersuite is TLS-" \ |
| 2341 | -c "! Usage does not match the keyUsage extension" |
| 2342 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2343 | # Tests for keyUsage in leaf certificates, part 3: |
| 2344 | # server-side checking of client cert |
| 2345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2346 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2347 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2348 | "$O_CLI -key data_files/server2.key \ |
| 2349 | -cert data_files/server2.ku-ds.crt" \ |
| 2350 | 0 \ |
| 2351 | -S "bad certificate (usage extensions)" \ |
| 2352 | -S "Processing of the Certificate handshake message failed" |
| 2353 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2354 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2355 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2356 | "$O_CLI -key data_files/server2.key \ |
| 2357 | -cert data_files/server2.ku-ke.crt" \ |
| 2358 | 0 \ |
| 2359 | -s "bad certificate (usage extensions)" \ |
| 2360 | -S "Processing of the Certificate handshake message failed" |
| 2361 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2362 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2363 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2364 | "$O_CLI -key data_files/server2.key \ |
| 2365 | -cert data_files/server2.ku-ke.crt" \ |
| 2366 | 1 \ |
| 2367 | -s "bad certificate (usage extensions)" \ |
| 2368 | -s "Processing of the Certificate handshake message failed" |
| 2369 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2370 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2371 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2372 | "$O_CLI -key data_files/server5.key \ |
| 2373 | -cert data_files/server5.ku-ds.crt" \ |
| 2374 | 0 \ |
| 2375 | -S "bad certificate (usage extensions)" \ |
| 2376 | -S "Processing of the Certificate handshake message failed" |
| 2377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2378 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2379 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2380 | "$O_CLI -key data_files/server5.key \ |
| 2381 | -cert data_files/server5.ku-ka.crt" \ |
| 2382 | 0 \ |
| 2383 | -s "bad certificate (usage extensions)" \ |
| 2384 | -S "Processing of the Certificate handshake message failed" |
| 2385 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2386 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 2387 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2388 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2389 | "$P_SRV key_file=data_files/server5.key \ |
| 2390 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2391 | "$P_CLI" \ |
| 2392 | 0 |
| 2393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2394 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2395 | "$P_SRV key_file=data_files/server5.key \ |
| 2396 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2397 | "$P_CLI" \ |
| 2398 | 0 |
| 2399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2400 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2401 | "$P_SRV key_file=data_files/server5.key \ |
| 2402 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 2403 | "$P_CLI" \ |
| 2404 | 0 |
| 2405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2406 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2407 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2408 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2409 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2410 | 1 |
| 2411 | |
| 2412 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 2413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2414 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2415 | "$O_SRV -key data_files/server5.key \ |
| 2416 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2417 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2418 | 0 \ |
| 2419 | -C "bad certificate (usage extensions)" \ |
| 2420 | -C "Processing of the Certificate handshake message failed" \ |
| 2421 | -c "Ciphersuite is TLS-" |
| 2422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2423 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2424 | "$O_SRV -key data_files/server5.key \ |
| 2425 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2426 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2427 | 0 \ |
| 2428 | -C "bad certificate (usage extensions)" \ |
| 2429 | -C "Processing of the Certificate handshake message failed" \ |
| 2430 | -c "Ciphersuite is TLS-" |
| 2431 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2432 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2433 | "$O_SRV -key data_files/server5.key \ |
| 2434 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2435 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2436 | 0 \ |
| 2437 | -C "bad certificate (usage extensions)" \ |
| 2438 | -C "Processing of the Certificate handshake message failed" \ |
| 2439 | -c "Ciphersuite is TLS-" |
| 2440 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2441 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2442 | "$O_SRV -key data_files/server5.key \ |
| 2443 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2444 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2445 | 1 \ |
| 2446 | -c "bad certificate (usage extensions)" \ |
| 2447 | -c "Processing of the Certificate handshake message failed" \ |
| 2448 | -C "Ciphersuite is TLS-" |
| 2449 | |
| 2450 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 2451 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2452 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2453 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2454 | "$O_CLI -key data_files/server5.key \ |
| 2455 | -cert data_files/server5.eku-cli.crt" \ |
| 2456 | 0 \ |
| 2457 | -S "bad certificate (usage extensions)" \ |
| 2458 | -S "Processing of the Certificate handshake message failed" |
| 2459 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2460 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2461 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2462 | "$O_CLI -key data_files/server5.key \ |
| 2463 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 2464 | 0 \ |
| 2465 | -S "bad certificate (usage extensions)" \ |
| 2466 | -S "Processing of the Certificate handshake message failed" |
| 2467 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2468 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2469 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2470 | "$O_CLI -key data_files/server5.key \ |
| 2471 | -cert data_files/server5.eku-cs_any.crt" \ |
| 2472 | 0 \ |
| 2473 | -S "bad certificate (usage extensions)" \ |
| 2474 | -S "Processing of the Certificate handshake message failed" |
| 2475 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2476 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2477 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2478 | "$O_CLI -key data_files/server5.key \ |
| 2479 | -cert data_files/server5.eku-cs.crt" \ |
| 2480 | 0 \ |
| 2481 | -s "bad certificate (usage extensions)" \ |
| 2482 | -S "Processing of the Certificate handshake message failed" |
| 2483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2484 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2485 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2486 | "$O_CLI -key data_files/server5.key \ |
| 2487 | -cert data_files/server5.eku-cs.crt" \ |
| 2488 | 1 \ |
| 2489 | -s "bad certificate (usage extensions)" \ |
| 2490 | -s "Processing of the Certificate handshake message failed" |
| 2491 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2492 | # Tests for DHM parameters loading |
| 2493 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2494 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2495 | "$P_SRV" \ |
| 2496 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2497 | debug_level=3" \ |
| 2498 | 0 \ |
| 2499 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 2500 | -c "value of 'DHM: G ' (2048 bits)" |
| 2501 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2502 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2503 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2504 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2505 | debug_level=3" \ |
| 2506 | 0 \ |
| 2507 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 2508 | -c "value of 'DHM: G ' (2 bits)" |
| 2509 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 2510 | # Tests for DHM client-side size checking |
| 2511 | |
| 2512 | run_test "DHM size: server default, client default, OK" \ |
| 2513 | "$P_SRV" \ |
| 2514 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2515 | debug_level=1" \ |
| 2516 | 0 \ |
| 2517 | -C "DHM prime too short:" |
| 2518 | |
| 2519 | run_test "DHM size: server default, client 2048, OK" \ |
| 2520 | "$P_SRV" \ |
| 2521 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2522 | debug_level=1 dhmlen=2048" \ |
| 2523 | 0 \ |
| 2524 | -C "DHM prime too short:" |
| 2525 | |
| 2526 | run_test "DHM size: server 1024, client default, OK" \ |
| 2527 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2528 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2529 | debug_level=1" \ |
| 2530 | 0 \ |
| 2531 | -C "DHM prime too short:" |
| 2532 | |
| 2533 | run_test "DHM size: server 1000, client default, rejected" \ |
| 2534 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 2535 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2536 | debug_level=1" \ |
| 2537 | 1 \ |
| 2538 | -c "DHM prime too short:" |
| 2539 | |
| 2540 | run_test "DHM size: server default, client 2049, rejected" \ |
| 2541 | "$P_SRV" \ |
| 2542 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2543 | debug_level=1 dhmlen=2049" \ |
| 2544 | 1 \ |
| 2545 | -c "DHM prime too short:" |
| 2546 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2547 | # Tests for PSK callback |
| 2548 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2549 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2550 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 2551 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2552 | psk_identity=foo psk=abc123" \ |
| 2553 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2554 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2555 | -S "SSL - Unknown identity received" \ |
| 2556 | -S "SSL - Verification of the message MAC failed" |
| 2557 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2558 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2559 | "$P_SRV" \ |
| 2560 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2561 | psk_identity=foo psk=abc123" \ |
| 2562 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2563 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2564 | -S "SSL - Unknown identity received" \ |
| 2565 | -S "SSL - Verification of the message MAC failed" |
| 2566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2567 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2568 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 2569 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2570 | psk_identity=foo psk=abc123" \ |
| 2571 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2572 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2573 | -s "SSL - Unknown identity received" \ |
| 2574 | -S "SSL - Verification of the message MAC failed" |
| 2575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2576 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2577 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2578 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2579 | psk_identity=abc psk=dead" \ |
| 2580 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2581 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2582 | -S "SSL - Unknown identity received" \ |
| 2583 | -S "SSL - Verification of the message MAC failed" |
| 2584 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2585 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2586 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2587 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2588 | psk_identity=def psk=beef" \ |
| 2589 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2590 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2591 | -S "SSL - Unknown identity received" \ |
| 2592 | -S "SSL - Verification of the message MAC failed" |
| 2593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2594 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2595 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2596 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2597 | psk_identity=ghi psk=beef" \ |
| 2598 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2599 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2600 | -s "SSL - Unknown identity received" \ |
| 2601 | -S "SSL - Verification of the message MAC failed" |
| 2602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2603 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2604 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2605 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2606 | psk_identity=abc psk=beef" \ |
| 2607 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2608 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2609 | -S "SSL - Unknown identity received" \ |
| 2610 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2611 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2612 | # Tests for EC J-PAKE |
| 2613 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2615 | run_test "ECJPAKE: client not configured" \ |
| 2616 | "$P_SRV debug_level=3" \ |
| 2617 | "$P_CLI debug_level=3" \ |
| 2618 | 0 \ |
| 2619 | -C "add ciphersuite: c0ff" \ |
| 2620 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2621 | -S "found ecjpake kkpp extension" \ |
| 2622 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2623 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 2624 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 2625 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2626 | -S "None of the common ciphersuites is usable" |
| 2627 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2628 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2629 | run_test "ECJPAKE: server not configured" \ |
| 2630 | "$P_SRV debug_level=3" \ |
| 2631 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 2632 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2633 | 1 \ |
| 2634 | -c "add ciphersuite: c0ff" \ |
| 2635 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2636 | -s "found ecjpake kkpp extension" \ |
| 2637 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2638 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 2639 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 2640 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 2641 | -s "None of the common ciphersuites is usable" |
| 2642 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2643 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2644 | run_test "ECJPAKE: working, TLS" \ |
| 2645 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 2646 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 2647 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 2648 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2649 | -c "add ciphersuite: c0ff" \ |
| 2650 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 2651 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2652 | -s "found ecjpake kkpp extension" \ |
| 2653 | -S "skip ecjpake kkpp extension" \ |
| 2654 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 2655 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 2656 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2657 | -S "None of the common ciphersuites is usable" \ |
| 2658 | -S "SSL - Verification of the message MAC failed" |
| 2659 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2660 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2661 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 2662 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 2663 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 2664 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2665 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 2666 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2667 | -s "SSL - Verification of the message MAC failed" |
| 2668 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2669 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2670 | run_test "ECJPAKE: working, DTLS" \ |
| 2671 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 2672 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 2673 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2674 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 2675 | -c "re-using cached ecjpake parameters" \ |
| 2676 | -S "SSL - Verification of the message MAC failed" |
| 2677 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2678 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 2679 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 2680 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 2681 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 2682 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2683 | 0 \ |
| 2684 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2685 | -S "SSL - Verification of the message MAC failed" |
| 2686 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2687 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2688 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 2689 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 2690 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 2691 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2692 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 2693 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 2694 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 2695 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 2696 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 2697 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 2698 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 2699 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 2700 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 2701 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 2702 | 0 |
| 2703 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2704 | # Tests for ciphersuites per version |
| 2705 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2707 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2708 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2709 | "$P_CLI force_version=ssl3" \ |
| 2710 | 0 \ |
| 2711 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2712 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2713 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2714 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2715 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2716 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2717 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2718 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2719 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2720 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2721 | "$P_CLI force_version=tls1_1" \ |
| 2722 | 0 \ |
| 2723 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2725 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2726 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2727 | "$P_CLI force_version=tls1_2" \ |
| 2728 | 0 \ |
| 2729 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2730 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 2731 | # Test for ClientHello without extensions |
| 2732 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 2733 | requires_gnutls |
| 2734 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 2735 | "$P_SRV debug_level=3" \ |
| 2736 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2737 | 0 \ |
| 2738 | -s "dumping 'client hello extensions' (0 bytes)" |
| 2739 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2740 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2741 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2742 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2743 | "$P_SRV" \ |
| 2744 | "$P_CLI request_size=100" \ |
| 2745 | 0 \ |
| 2746 | -s "Read from client: 100 bytes read$" |
| 2747 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2748 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2749 | "$P_SRV" \ |
| 2750 | "$P_CLI request_size=500" \ |
| 2751 | 0 \ |
| 2752 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2753 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2754 | # Tests for small packets |
| 2755 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2757 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2758 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2759 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2760 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2761 | 0 \ |
| 2762 | -s "Read from client: 1 bytes read" |
| 2763 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2764 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2765 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2766 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2767 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2768 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2769 | 0 \ |
| 2770 | -s "Read from client: 1 bytes read" |
| 2771 | |
| 2772 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2773 | "$P_SRV" \ |
| 2774 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2775 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2776 | 0 \ |
| 2777 | -s "Read from client: 1 bytes read" |
| 2778 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2779 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2780 | "$P_SRV" \ |
| 2781 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2782 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2783 | 0 \ |
| 2784 | -s "Read from client: 1 bytes read" |
| 2785 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2786 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2787 | "$P_SRV" \ |
| 2788 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2789 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2790 | trunc_hmac=1" \ |
| 2791 | 0 \ |
| 2792 | -s "Read from client: 1 bytes read" |
| 2793 | |
| 2794 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2795 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2796 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2798 | trunc_hmac=1" \ |
| 2799 | 0 \ |
| 2800 | -s "Read from client: 1 bytes read" |
| 2801 | |
| 2802 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2803 | "$P_SRV" \ |
| 2804 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2805 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2806 | 0 \ |
| 2807 | -s "Read from client: 1 bytes read" |
| 2808 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2809 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2810 | "$P_SRV" \ |
| 2811 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2812 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2813 | 0 \ |
| 2814 | -s "Read from client: 1 bytes read" |
| 2815 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2816 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2817 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2818 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2819 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2820 | 0 \ |
| 2821 | -s "Read from client: 1 bytes read" |
| 2822 | |
| 2823 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2824 | "$P_SRV" \ |
| 2825 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2826 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2827 | trunc_hmac=1" \ |
| 2828 | 0 \ |
| 2829 | -s "Read from client: 1 bytes read" |
| 2830 | |
| 2831 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2832 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2833 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2834 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2835 | trunc_hmac=1" \ |
| 2836 | 0 \ |
| 2837 | -s "Read from client: 1 bytes read" |
| 2838 | |
| 2839 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2840 | "$P_SRV" \ |
| 2841 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2842 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2843 | 0 \ |
| 2844 | -s "Read from client: 1 bytes read" |
| 2845 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2846 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2847 | "$P_SRV" \ |
| 2848 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2849 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2850 | 0 \ |
| 2851 | -s "Read from client: 1 bytes read" |
| 2852 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2853 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2854 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2855 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2856 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2857 | 0 \ |
| 2858 | -s "Read from client: 1 bytes read" |
| 2859 | |
| 2860 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2861 | "$P_SRV" \ |
| 2862 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2864 | trunc_hmac=1" \ |
| 2865 | 0 \ |
| 2866 | -s "Read from client: 1 bytes read" |
| 2867 | |
| 2868 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2869 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2870 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2871 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2872 | 0 \ |
| 2873 | -s "Read from client: 1 bytes read" |
| 2874 | |
| 2875 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2876 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2877 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2878 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2879 | trunc_hmac=1" \ |
| 2880 | 0 \ |
| 2881 | -s "Read from client: 1 bytes read" |
| 2882 | |
| 2883 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2884 | "$P_SRV" \ |
| 2885 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2886 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2887 | 0 \ |
| 2888 | -s "Read from client: 1 bytes read" |
| 2889 | |
| 2890 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2891 | "$P_SRV" \ |
| 2892 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2894 | 0 \ |
| 2895 | -s "Read from client: 1 bytes read" |
| 2896 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2897 | # A test for extensions in SSLv3 |
| 2898 | |
| 2899 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2900 | run_test "SSLv3 with extensions, server side" \ |
| 2901 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 2902 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 2903 | 0 \ |
| 2904 | -S "dumping 'client hello extensions'" \ |
| 2905 | -S "server hello, total extension length:" |
| 2906 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2907 | # Test for large packets |
| 2908 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2909 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2910 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2911 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2912 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2914 | 0 \ |
| 2915 | -s "Read from client: 16384 bytes read" |
| 2916 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2917 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2918 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2919 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2920 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2921 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2922 | 0 \ |
| 2923 | -s "Read from client: 16384 bytes read" |
| 2924 | |
| 2925 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2926 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2927 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2928 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2929 | 0 \ |
| 2930 | -s "Read from client: 16384 bytes read" |
| 2931 | |
| 2932 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2933 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2934 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2936 | trunc_hmac=1" \ |
| 2937 | 0 \ |
| 2938 | -s "Read from client: 16384 bytes read" |
| 2939 | |
| 2940 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2941 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2942 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2943 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2944 | trunc_hmac=1" \ |
| 2945 | 0 \ |
| 2946 | -s "Read from client: 16384 bytes read" |
| 2947 | |
| 2948 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2949 | "$P_SRV" \ |
| 2950 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2952 | 0 \ |
| 2953 | -s "Read from client: 16384 bytes read" |
| 2954 | |
| 2955 | run_test "Large packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2956 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2957 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2958 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2959 | 0 \ |
| 2960 | -s "Read from client: 16384 bytes read" |
| 2961 | |
| 2962 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2963 | "$P_SRV" \ |
| 2964 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2965 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2966 | trunc_hmac=1" \ |
| 2967 | 0 \ |
| 2968 | -s "Read from client: 16384 bytes read" |
| 2969 | |
| 2970 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2971 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2972 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2973 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2974 | trunc_hmac=1" \ |
| 2975 | 0 \ |
| 2976 | -s "Read from client: 16384 bytes read" |
| 2977 | |
| 2978 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2979 | "$P_SRV" \ |
| 2980 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2981 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2982 | 0 \ |
| 2983 | -s "Read from client: 16384 bytes read" |
| 2984 | |
| 2985 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2986 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2987 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2988 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2989 | 0 \ |
| 2990 | -s "Read from client: 16384 bytes read" |
| 2991 | |
| 2992 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2993 | "$P_SRV" \ |
| 2994 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2995 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2996 | trunc_hmac=1" \ |
| 2997 | 0 \ |
| 2998 | -s "Read from client: 16384 bytes read" |
| 2999 | |
| 3000 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3001 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3002 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 3003 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3004 | 0 \ |
| 3005 | -s "Read from client: 16384 bytes read" |
| 3006 | |
| 3007 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3008 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3009 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 3010 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3011 | trunc_hmac=1" \ |
| 3012 | 0 \ |
| 3013 | -s "Read from client: 16384 bytes read" |
| 3014 | |
| 3015 | run_test "Large packet TLS 1.2 AEAD" \ |
| 3016 | "$P_SRV" \ |
| 3017 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 3018 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3019 | 0 \ |
| 3020 | -s "Read from client: 16384 bytes read" |
| 3021 | |
| 3022 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 3023 | "$P_SRV" \ |
| 3024 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 3025 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3026 | 0 \ |
| 3027 | -s "Read from client: 16384 bytes read" |
| 3028 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3029 | # Tests for DTLS HelloVerifyRequest |
| 3030 | |
| 3031 | run_test "DTLS cookie: enabled" \ |
| 3032 | "$P_SRV dtls=1 debug_level=2" \ |
| 3033 | "$P_CLI dtls=1 debug_level=2" \ |
| 3034 | 0 \ |
| 3035 | -s "cookie verification failed" \ |
| 3036 | -s "cookie verification passed" \ |
| 3037 | -S "cookie verification skipped" \ |
| 3038 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3039 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3040 | -S "SSL - The requested feature is not available" |
| 3041 | |
| 3042 | run_test "DTLS cookie: disabled" \ |
| 3043 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 3044 | "$P_CLI dtls=1 debug_level=2" \ |
| 3045 | 0 \ |
| 3046 | -S "cookie verification failed" \ |
| 3047 | -S "cookie verification passed" \ |
| 3048 | -s "cookie verification skipped" \ |
| 3049 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3050 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3051 | -S "SSL - The requested feature is not available" |
| 3052 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3053 | run_test "DTLS cookie: default (failing)" \ |
| 3054 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 3055 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 3056 | 1 \ |
| 3057 | -s "cookie verification failed" \ |
| 3058 | -S "cookie verification passed" \ |
| 3059 | -S "cookie verification skipped" \ |
| 3060 | -C "received hello verify request" \ |
| 3061 | -S "hello verification requested" \ |
| 3062 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3063 | |
| 3064 | requires_ipv6 |
| 3065 | run_test "DTLS cookie: enabled, IPv6" \ |
| 3066 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 3067 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 3068 | 0 \ |
| 3069 | -s "cookie verification failed" \ |
| 3070 | -s "cookie verification passed" \ |
| 3071 | -S "cookie verification skipped" \ |
| 3072 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3073 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3074 | -S "SSL - The requested feature is not available" |
| 3075 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 3076 | run_test "DTLS cookie: enabled, nbio" \ |
| 3077 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 3078 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 3079 | 0 \ |
| 3080 | -s "cookie verification failed" \ |
| 3081 | -s "cookie verification passed" \ |
| 3082 | -S "cookie verification skipped" \ |
| 3083 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3084 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 3085 | -S "SSL - The requested feature is not available" |
| 3086 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3087 | # Tests for client reconnecting from the same port with DTLS |
| 3088 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3089 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3090 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3091 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 3092 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3093 | 0 \ |
| 3094 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3095 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3096 | -S "Client initiated reconnection from same port" |
| 3097 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3098 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3099 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3100 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 3101 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3102 | 0 \ |
| 3103 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3104 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3105 | -s "Client initiated reconnection from same port" |
| 3106 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 3107 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 3108 | run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3109 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 3110 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3111 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3112 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3113 | -s "Client initiated reconnection from same port" |
| 3114 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 3115 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 3116 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 3117 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 3118 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 3119 | 0 \ |
| 3120 | -S "The operation timed out" \ |
| 3121 | -s "Client initiated reconnection from same port" |
| 3122 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3123 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 3124 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \ |
Manuel Pégourié-Gonnard | 6ad23b9 | 2015-09-15 12:57:46 +0200 | [diff] [blame] | 3125 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 3126 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3127 | -s "The operation timed out" \ |
| 3128 | -S "Client initiated reconnection from same port" |
| 3129 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3130 | # Tests for various cases of client authentication with DTLS |
| 3131 | # (focused on handshake flows and message parsing) |
| 3132 | |
| 3133 | run_test "DTLS client auth: required" \ |
| 3134 | "$P_SRV dtls=1 auth_mode=required" \ |
| 3135 | "$P_CLI dtls=1" \ |
| 3136 | 0 \ |
| 3137 | -s "Verifying peer X.509 certificate... ok" |
| 3138 | |
| 3139 | run_test "DTLS client auth: optional, client has no cert" \ |
| 3140 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 3141 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 3142 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3143 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3144 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3145 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3146 | "$P_SRV dtls=1 auth_mode=none" \ |
| 3147 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 3148 | 0 \ |
| 3149 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3150 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3151 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 3152 | run_test "DTLS wrong PSK: badmac alert" \ |
| 3153 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 3154 | "$P_CLI dtls=1 psk=abc124" \ |
| 3155 | 1 \ |
| 3156 | -s "SSL - Verification of the message MAC failed" \ |
| 3157 | -c "SSL - A fatal alert message was received from our peer" |
| 3158 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 3159 | # Tests for receiving fragmented handshake messages with DTLS |
| 3160 | |
| 3161 | requires_gnutls |
| 3162 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 3163 | "$G_SRV -u --mtu 2048 -a" \ |
| 3164 | "$P_CLI dtls=1 debug_level=2" \ |
| 3165 | 0 \ |
| 3166 | -C "found fragmented DTLS handshake message" \ |
| 3167 | -C "error" |
| 3168 | |
| 3169 | requires_gnutls |
| 3170 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 3171 | "$G_SRV -u --mtu 512" \ |
| 3172 | "$P_CLI dtls=1 debug_level=2" \ |
| 3173 | 0 \ |
| 3174 | -c "found fragmented DTLS handshake message" \ |
| 3175 | -C "error" |
| 3176 | |
| 3177 | requires_gnutls |
| 3178 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 3179 | "$G_SRV -u --mtu 128" \ |
| 3180 | "$P_CLI dtls=1 debug_level=2" \ |
| 3181 | 0 \ |
| 3182 | -c "found fragmented DTLS handshake message" \ |
| 3183 | -C "error" |
| 3184 | |
| 3185 | requires_gnutls |
| 3186 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 3187 | "$G_SRV -u --mtu 128" \ |
| 3188 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 3189 | 0 \ |
| 3190 | -c "found fragmented DTLS handshake message" \ |
| 3191 | -C "error" |
| 3192 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3193 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3194 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 3195 | "$G_SRV -u --mtu 256" \ |
| 3196 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 3197 | 0 \ |
| 3198 | -c "found fragmented DTLS handshake message" \ |
| 3199 | -c "client hello, adding renegotiation extension" \ |
| 3200 | -c "found renegotiation extension" \ |
| 3201 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3202 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3203 | -C "error" \ |
| 3204 | -s "Extra-header:" |
| 3205 | |
| 3206 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3207 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 3208 | "$G_SRV -u --mtu 256" \ |
| 3209 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 3210 | 0 \ |
| 3211 | -c "found fragmented DTLS handshake message" \ |
| 3212 | -c "client hello, adding renegotiation extension" \ |
| 3213 | -c "found renegotiation extension" \ |
| 3214 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3215 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3216 | -C "error" \ |
| 3217 | -s "Extra-header:" |
| 3218 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3219 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 3220 | "$O_SRV -dtls1 -mtu 2048" \ |
| 3221 | "$P_CLI dtls=1 debug_level=2" \ |
| 3222 | 0 \ |
| 3223 | -C "found fragmented DTLS handshake message" \ |
| 3224 | -C "error" |
| 3225 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3226 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 3227 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 3228 | "$P_CLI dtls=1 debug_level=2" \ |
| 3229 | 0 \ |
| 3230 | -c "found fragmented DTLS handshake message" \ |
| 3231 | -C "error" |
| 3232 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3233 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 3234 | "$O_SRV -dtls1 -mtu 256" \ |
| 3235 | "$P_CLI dtls=1 debug_level=2" \ |
| 3236 | 0 \ |
| 3237 | -c "found fragmented DTLS handshake message" \ |
| 3238 | -C "error" |
| 3239 | |
| 3240 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 3241 | "$O_SRV -dtls1 -mtu 256" \ |
| 3242 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 3243 | 0 \ |
| 3244 | -c "found fragmented DTLS handshake message" \ |
| 3245 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3246 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 3247 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 3248 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3249 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3250 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 3251 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3252 | "$P_SRV dtls=1 debug_level=2" \ |
| 3253 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3254 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3255 | -C "replayed record" \ |
| 3256 | -S "replayed record" \ |
| 3257 | -C "record from another epoch" \ |
| 3258 | -S "record from another epoch" \ |
| 3259 | -C "discarding invalid record" \ |
| 3260 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3261 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3262 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3263 | -c "HTTP/1.0 200 OK" |
| 3264 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3265 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3266 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3267 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3268 | "$P_SRV dtls=1 debug_level=2" \ |
| 3269 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3270 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3271 | -c "replayed record" \ |
| 3272 | -s "replayed record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3273 | -c "discarding invalid record" \ |
| 3274 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3275 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3276 | -s "Extra-header:" \ |
| 3277 | -c "HTTP/1.0 200 OK" |
| 3278 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3279 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 3280 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3281 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 3282 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3283 | 0 \ |
| 3284 | -c "replayed record" \ |
| 3285 | -S "replayed record" \ |
| 3286 | -c "discarding invalid record" \ |
| 3287 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3288 | -c "resend" \ |
| 3289 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3290 | -s "Extra-header:" \ |
| 3291 | -c "HTTP/1.0 200 OK" |
| 3292 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3293 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3294 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3295 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3296 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3297 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3298 | -c "discarding invalid record (mac)" \ |
| 3299 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3300 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3301 | -c "HTTP/1.0 200 OK" \ |
| 3302 | -S "too many records with bad MAC" \ |
| 3303 | -S "Verification of the message MAC failed" |
| 3304 | |
| 3305 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 3306 | -p "$P_PXY bad_ad=1" \ |
| 3307 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 3308 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 3309 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3310 | -C "discarding invalid record (mac)" \ |
| 3311 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3312 | -S "Extra-header:" \ |
| 3313 | -C "HTTP/1.0 200 OK" \ |
| 3314 | -s "too many records with bad MAC" \ |
| 3315 | -s "Verification of the message MAC failed" |
| 3316 | |
| 3317 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 3318 | -p "$P_PXY bad_ad=1" \ |
| 3319 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 3320 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 3321 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3322 | -c "discarding invalid record (mac)" \ |
| 3323 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3324 | -s "Extra-header:" \ |
| 3325 | -c "HTTP/1.0 200 OK" \ |
| 3326 | -S "too many records with bad MAC" \ |
| 3327 | -S "Verification of the message MAC failed" |
| 3328 | |
| 3329 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 3330 | -p "$P_PXY bad_ad=1" \ |
| 3331 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 3332 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 3333 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3334 | -c "discarding invalid record (mac)" \ |
| 3335 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3336 | -s "Extra-header:" \ |
| 3337 | -c "HTTP/1.0 200 OK" \ |
| 3338 | -s "too many records with bad MAC" \ |
| 3339 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3340 | |
| 3341 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3342 | -p "$P_PXY delay_ccs=1" \ |
| 3343 | "$P_SRV dtls=1 debug_level=1" \ |
| 3344 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3345 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3346 | -c "record from another epoch" \ |
| 3347 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3348 | -c "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3349 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3350 | -s "Extra-header:" \ |
| 3351 | -c "HTTP/1.0 200 OK" |
| 3352 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 3353 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3354 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3355 | needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3356 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3357 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3358 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3359 | psk=abc123" \ |
| 3360 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3361 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3362 | 0 \ |
| 3363 | -s "Extra-header:" \ |
| 3364 | -c "HTTP/1.0 200 OK" |
| 3365 | |
| 3366 | needs_more_time 2 |
| 3367 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 3368 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3369 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3370 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3371 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3372 | 0 \ |
| 3373 | -s "Extra-header:" \ |
| 3374 | -c "HTTP/1.0 200 OK" |
| 3375 | |
| 3376 | needs_more_time 2 |
| 3377 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 3378 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3379 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3380 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3381 | 0 \ |
| 3382 | -s "Extra-header:" \ |
| 3383 | -c "HTTP/1.0 200 OK" |
| 3384 | |
| 3385 | needs_more_time 2 |
| 3386 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 3387 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3388 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 3389 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3390 | 0 \ |
| 3391 | -s "Extra-header:" \ |
| 3392 | -c "HTTP/1.0 200 OK" |
| 3393 | |
| 3394 | needs_more_time 2 |
| 3395 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 3396 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3397 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 3398 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3399 | 0 \ |
| 3400 | -s "Extra-header:" \ |
| 3401 | -c "HTTP/1.0 200 OK" |
| 3402 | |
| 3403 | needs_more_time 2 |
| 3404 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 3405 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3406 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 3407 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3408 | 0 \ |
| 3409 | -s "Extra-header:" \ |
| 3410 | -c "HTTP/1.0 200 OK" |
| 3411 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3412 | needs_more_time 2 |
| 3413 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 3414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3415 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 3416 | auth_mode=required" \ |
| 3417 | "$P_CLI dtls=1 hs_timeout=250-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3418 | 0 \ |
| 3419 | -s "Extra-header:" \ |
| 3420 | -c "HTTP/1.0 200 OK" |
| 3421 | |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3422 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 3423 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 3424 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3425 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3426 | psk=abc123 debug_level=3" \ |
| 3427 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3428 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3429 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3430 | 0 \ |
| 3431 | -s "a session has been resumed" \ |
| 3432 | -c "a session has been resumed" \ |
| 3433 | -s "Extra-header:" \ |
| 3434 | -c "HTTP/1.0 200 OK" |
| 3435 | |
| 3436 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 3437 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 3438 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3439 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3440 | psk=abc123 debug_level=3 nbio=2" \ |
| 3441 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3442 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3443 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 3444 | 0 \ |
| 3445 | -s "a session has been resumed" \ |
| 3446 | -c "a session has been resumed" \ |
| 3447 | -s "Extra-header:" \ |
| 3448 | -c "HTTP/1.0 200 OK" |
| 3449 | |
| 3450 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3451 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3452 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3453 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3454 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3455 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3456 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3457 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3458 | 0 \ |
| 3459 | -c "=> renegotiate" \ |
| 3460 | -s "=> renegotiate" \ |
| 3461 | -s "Extra-header:" \ |
| 3462 | -c "HTTP/1.0 200 OK" |
| 3463 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3464 | needs_more_time 4 |
| 3465 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 3466 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3467 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3468 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3469 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3470 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3471 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3472 | 0 \ |
| 3473 | -c "=> renegotiate" \ |
| 3474 | -s "=> renegotiate" \ |
| 3475 | -s "Extra-header:" \ |
| 3476 | -c "HTTP/1.0 200 OK" |
| 3477 | |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3478 | needs_more_time 4 |
| 3479 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3480 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3481 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3482 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3483 | debug_level=2" \ |
| 3484 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3485 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3486 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3487 | 0 \ |
| 3488 | -c "=> renegotiate" \ |
| 3489 | -s "=> renegotiate" \ |
| 3490 | -s "Extra-header:" \ |
| 3491 | -c "HTTP/1.0 200 OK" |
| 3492 | |
| 3493 | needs_more_time 4 |
| 3494 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3495 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3496 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3497 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3498 | debug_level=2 nbio=2" \ |
| 3499 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3500 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3501 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3502 | 0 \ |
| 3503 | -c "=> renegotiate" \ |
| 3504 | -s "=> renegotiate" \ |
| 3505 | -s "Extra-header:" \ |
| 3506 | -c "HTTP/1.0 200 OK" |
| 3507 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3508 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3509 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3510 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3511 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3512 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3513 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3514 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3515 | -c "HTTP/1.0 200 OK" |
| 3516 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3517 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3518 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3519 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 3520 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3521 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3522 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3523 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3524 | -c "HTTP/1.0 200 OK" |
| 3525 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3526 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3527 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3528 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 3529 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3530 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3531 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3532 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3533 | -c "HTTP/1.0 200 OK" |
| 3534 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3535 | requires_gnutls |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3536 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3537 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3538 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 3539 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3540 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3541 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3542 | 0 \ |
| 3543 | -s "Extra-header:" \ |
| 3544 | -c "Extra-header:" |
| 3545 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3546 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3547 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3548 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3549 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 3550 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3551 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3552 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3553 | 0 \ |
| 3554 | -s "Extra-header:" \ |
| 3555 | -c "Extra-header:" |
| 3556 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3557 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3558 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3559 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3560 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 3561 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3562 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3563 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3564 | 0 \ |
| 3565 | -s "Extra-header:" \ |
| 3566 | -c "Extra-header:" |
| 3567 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3568 | # Final report |
| 3569 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3570 | echo "------------------------------------------------------------------------" |
| 3571 | |
| 3572 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3573 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3574 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3575 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3576 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 3577 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 3578 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3579 | |
| 3580 | exit $FAILS |