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