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