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