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