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