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