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