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