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 | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 21 | O_SRV="$OPENSSL_CMD s_server -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" |
| 24 | G_CLI="$GNUTLS_CLI" |
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 | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 30 | CONFIG_H='../include/polarssl/config.h' |
| 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 | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 38 | echo -e " -h|--help\tPrint this help." |
| 39 | echo -e " -m|--memcheck\tCheck memory leaks and errors." |
| 40 | echo -e " -f|--filter\tOnly matching tests are executed (default: '$FILTER')" |
| 41 | echo -e " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')" |
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 | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 85 | # skip next test if GnuTLS isn't available |
| 86 | requires_gnutls() { |
| 87 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
| 88 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null; then |
| 89 | GNUTLS_AVAILABLE="YES" |
| 90 | else |
| 91 | GNUTLS_AVAILABLE="NO" |
| 92 | fi |
| 93 | fi |
| 94 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 95 | SKIP_NEXT="YES" |
| 96 | fi |
| 97 | } |
| 98 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 99 | # skip next test if IPv6 isn't available on this host |
| 100 | requires_ipv6() { |
| 101 | if [ -z "${HAS_IPV6:-}" ]; then |
| 102 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 103 | SRV_PID=$! |
| 104 | sleep 1 |
| 105 | kill $SRV_PID >/dev/null 2>&1 |
| 106 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 107 | HAS_IPV6="NO" |
| 108 | else |
| 109 | HAS_IPV6="YES" |
| 110 | fi |
| 111 | rm -r $SRV_OUT |
| 112 | fi |
| 113 | |
| 114 | if [ "$HAS_IPV6" = "NO" ]; then |
| 115 | SKIP_NEXT="YES" |
| 116 | fi |
| 117 | } |
| 118 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 119 | # multiply the client timeout delay by the given factor for the next test |
| 120 | needs_more_time() { |
| 121 | CLI_DELAY_FACTOR=$1 |
| 122 | } |
| 123 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 124 | # print_name <name> |
| 125 | print_name() { |
| 126 | echo -n "$1 " |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 127 | LEN=$(( 72 - `echo "$1" | wc -c` )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 128 | for i in `seq 1 $LEN`; do echo -n '.'; done |
| 129 | echo -n ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 130 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 131 | TESTS=$(( $TESTS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | # fail <message> |
| 135 | fail() { |
| 136 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 137 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 138 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 139 | mv $SRV_OUT o-srv-${TESTS}.log |
| 140 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 141 | if [ -n "$PXY_CMD" ]; then |
| 142 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 143 | fi |
| 144 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 145 | |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 146 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot ]; then |
| 147 | echo " ! server output:" |
| 148 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 149 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 150 | echo " ! client output:" |
| 151 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 152 | if [ -n "$PXY_CMD" ]; then |
| 153 | echo " ! ========================================================" |
| 154 | echo " ! proxy output:" |
| 155 | cat o-pxy-${TESTS}.log |
| 156 | fi |
| 157 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 158 | fi |
| 159 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 160 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 161 | } |
| 162 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 163 | # is_polar <cmd_line> |
| 164 | is_polar() { |
| 165 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 166 | } |
| 167 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | # has_mem_err <log_file_name> |
| 169 | has_mem_err() { |
| 170 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 171 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 172 | then |
| 173 | return 1 # false: does not have errors |
| 174 | else |
| 175 | return 0 # true: has errors |
| 176 | fi |
| 177 | } |
| 178 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 179 | # wait for server to start: two versions depending on lsof availability |
| 180 | wait_server_start() { |
| 181 | if which lsof >/dev/null; then |
| 182 | # make sure we don't loop forever |
| 183 | ( sleep "$DOG_DELAY"; echo "SERVERSTART TIMEOUT"; kill $MAIN_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 184 | DOG_PID=$! |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 185 | |
| 186 | # 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] | 187 | if [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 188 | until lsof -nbi UDP:"$SRV_PORT" | grep UDP >/dev/null; do :; done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 189 | else |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 190 | until lsof -nbi TCP:"$SRV_PORT" | grep LISTEN >/dev/null; do :; done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 191 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 192 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 193 | kill $DOG_PID >/dev/null 2>&1 |
| 194 | wait $DOG_PID |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 195 | else |
| 196 | sleep "$START_DELAY" |
| 197 | fi |
| 198 | } |
| 199 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 200 | # wait for client to terminate and set CLI_EXIT |
| 201 | # must be called right after starting the client |
| 202 | wait_client_done() { |
| 203 | CLI_PID=$! |
| 204 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 205 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 206 | CLI_DELAY_FACTOR=1 |
| 207 | |
| 208 | ( sleep $CLI_DELAY; echo "TIMEOUT" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 209 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 210 | |
| 211 | wait $CLI_PID |
| 212 | CLI_EXIT=$? |
| 213 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 214 | kill $DOG_PID >/dev/null 2>&1 |
| 215 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 216 | |
| 217 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
| 218 | } |
| 219 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 220 | # check if the given command uses dtls and sets global variable DTLS |
| 221 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 222 | 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] | 223 | DTLS=1 |
| 224 | else |
| 225 | DTLS=0 |
| 226 | fi |
| 227 | } |
| 228 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 229 | # 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] | 230 | # Options: -s pattern pattern that must be present in server output |
| 231 | # -c pattern pattern that must be present in client output |
| 232 | # -S pattern pattern that must be absent in server output |
| 233 | # -C pattern pattern that must be absent in client output |
| 234 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 235 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 236 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 237 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 238 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 239 | else |
| 240 | return |
| 241 | fi |
| 242 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 243 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 244 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 245 | # should we skip? |
| 246 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 247 | SKIP_NEXT="NO" |
| 248 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 249 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 250 | return |
| 251 | fi |
| 252 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 253 | # does this test use a proxy? |
| 254 | if [ "X$1" = "X-p" ]; then |
| 255 | PXY_CMD="$2" |
| 256 | shift 2 |
| 257 | else |
| 258 | PXY_CMD="" |
| 259 | fi |
| 260 | |
| 261 | # get commands and client output |
| 262 | SRV_CMD="$1" |
| 263 | CLI_CMD="$2" |
| 264 | CLI_EXPECT="$3" |
| 265 | shift 3 |
| 266 | |
| 267 | # fix client port |
| 268 | if [ -n "$PXY_CMD" ]; then |
| 269 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 270 | else |
| 271 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 272 | fi |
| 273 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 274 | # update DTLS variable |
| 275 | detect_dtls "$SRV_CMD" |
| 276 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 277 | # prepend valgrind to our commands if active |
| 278 | if [ "$MEMCHECK" -gt 0 ]; then |
| 279 | if is_polar "$SRV_CMD"; then |
| 280 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 281 | fi |
| 282 | if is_polar "$CLI_CMD"; then |
| 283 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 284 | fi |
| 285 | fi |
| 286 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 287 | # run the commands |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 288 | if [ -n "$PXY_CMD" ]; then |
| 289 | echo "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 290 | $PXY_CMD >> $PXY_OUT 2>&1 & |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 291 | PXY_PID=$! |
| 292 | # assume proxy starts faster than server |
| 293 | fi |
| 294 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 295 | echo "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 296 | # "yes" is for servers without -www (openssl with DTLS) |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 297 | yes blabla | $SRV_CMD >> $SRV_OUT 2>&1 & |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 298 | SRV_PID=$! |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 299 | wait_server_start |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 300 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 301 | echo "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 302 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 303 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 304 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 305 | # terminate the server (and the proxy) |
Manuel Pégourié-Gonnard | 74b1170 | 2014-08-14 15:47:33 +0200 | [diff] [blame] | 306 | kill $SRV_PID |
| 307 | wait $SRV_PID |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 308 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 309 | kill $PXY_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 310 | wait $PXY_PID |
| 311 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 312 | |
| 313 | # 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] | 314 | # (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] | 315 | # expected client exit to incorrectly succeed in case of catastrophic |
| 316 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 317 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 318 | 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] | 319 | else |
| 320 | fail "server failed to start" |
| 321 | return |
| 322 | fi |
| 323 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 324 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 325 | 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] | 326 | else |
| 327 | fail "client failed to start" |
| 328 | return |
| 329 | fi |
| 330 | fi |
| 331 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 332 | # check server exit code |
| 333 | if [ $? != 0 ]; then |
| 334 | fail "server fail" |
| 335 | return |
| 336 | fi |
| 337 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 338 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 339 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 340 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 341 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 342 | 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] | 343 | return |
| 344 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 345 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 346 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 347 | # lines beginning with == are added by valgrind, ignore them |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 348 | while [ $# -gt 0 ] |
| 349 | do |
| 350 | case $1 in |
| 351 | "-s") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 352 | 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] | 353 | fail "-s $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 354 | return |
| 355 | fi |
| 356 | ;; |
| 357 | |
| 358 | "-c") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 359 | 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] | 360 | fail "-c $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 361 | return |
| 362 | fi |
| 363 | ;; |
| 364 | |
| 365 | "-S") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 366 | if grep -v '^==' $SRV_OUT | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 367 | fail "-S $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 368 | return |
| 369 | fi |
| 370 | ;; |
| 371 | |
| 372 | "-C") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 373 | if grep -v '^==' $CLI_OUT | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 374 | fail "-C $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 375 | return |
| 376 | fi |
| 377 | ;; |
| 378 | |
| 379 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 380 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 381 | exit 1 |
| 382 | esac |
| 383 | shift 2 |
| 384 | done |
| 385 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 386 | # check valgrind's results |
| 387 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 388 | 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] | 389 | fail "Server has memory errors" |
| 390 | return |
| 391 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 392 | 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] | 393 | fail "Client has memory errors" |
| 394 | return |
| 395 | fi |
| 396 | fi |
| 397 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 398 | # if we're here, everything is ok |
| 399 | echo "PASS" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 400 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 401 | } |
| 402 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 403 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 404 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame^] | 405 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 406 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 407 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 408 | 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] | 409 | exit 1 |
| 410 | } |
| 411 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 412 | # |
| 413 | # MAIN |
| 414 | # |
| 415 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 416 | get_options "$@" |
| 417 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 418 | # sanity checks, avoid an avalanche of errors |
| 419 | if [ ! -x "$P_SRV" ]; then |
| 420 | echo "Command '$P_SRV' is not an executable file" |
| 421 | exit 1 |
| 422 | fi |
| 423 | if [ ! -x "$P_CLI" ]; then |
| 424 | echo "Command '$P_CLI' is not an executable file" |
| 425 | exit 1 |
| 426 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 427 | if [ ! -x "$P_PXY" ]; then |
| 428 | echo "Command '$P_PXY' is not an executable file" |
| 429 | exit 1 |
| 430 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 431 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 432 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 433 | exit 1 |
| 434 | fi |
| 435 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 436 | # used by watchdog |
| 437 | MAIN_PID="$$" |
| 438 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 439 | # be more patient with valgrind |
| 440 | if [ "$MEMCHECK" -gt 0 ]; then |
| 441 | START_DELAY=3 |
| 442 | DOG_DELAY=30 |
| 443 | else |
| 444 | START_DELAY=1 |
| 445 | DOG_DELAY=10 |
| 446 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 447 | CLI_DELAY_FACTOR=1 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 448 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 449 | # Pick a "unique" server port in the range 10000-19999, and a proxy port |
| 450 | PORT_BASE="0000$$" |
| 451 | PORT_BASE="$( echo -n $PORT_BASE | tail -c 4 )" |
| 452 | SRV_PORT="1$PORT_BASE" |
| 453 | PXY_PORT="2$PORT_BASE" |
| 454 | unset PORT_BASE |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 455 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 456 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 457 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 458 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 459 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT" |
| 460 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 461 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 462 | G_SRV="$G_SRV -p $SRV_PORT" |
| 463 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 464 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 465 | # Also pick a unique name for intermediate files |
| 466 | SRV_OUT="srv_out.$$" |
| 467 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 468 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 469 | SESSION="session.$$" |
| 470 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 471 | SKIP_NEXT="NO" |
| 472 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 473 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 474 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 475 | # Basic test |
| 476 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 477 | # Checks that: |
| 478 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 479 | # - the expected (highest security) parameters are selected |
| 480 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 481 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 482 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 483 | "$P_CLI" \ |
| 484 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 485 | -s "Protocol is TLSv1.2" \ |
| 486 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 487 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 488 | -s "ECDHE curve: secp521r1" \ |
| 489 | -S "error" \ |
| 490 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 491 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 492 | # Test for SSLv2 ClientHello |
| 493 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 494 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 495 | run_test "SSLv2 ClientHello: reference" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 496 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 497 | "$O_CLI -no_ssl2" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 498 | 0 \ |
| 499 | -S "parse client hello v2" \ |
| 500 | -S "ssl_handshake returned" |
| 501 | |
| 502 | # 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] | 503 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 504 | run_test "SSLv2 ClientHello: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 505 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 506 | "$O_CLI -cipher 'DES-CBC-MD5:ALL'" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 507 | 0 \ |
| 508 | -s "parse client hello v2" \ |
| 509 | -S "ssl_handshake returned" |
| 510 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 511 | # Tests for Truncated HMAC extension |
| 512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 513 | run_test "Truncated HMAC: reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 514 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 515 | "$P_CLI trunc_hmac=0 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 516 | 0 \ |
| 517 | -s "dumping 'computed mac' (20 bytes)" |
| 518 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 519 | run_test "Truncated HMAC: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 520 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 521 | "$P_CLI trunc_hmac=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 522 | 0 \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 523 | -s "dumping 'computed mac' (10 bytes)" |
| 524 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 525 | # Tests for Session Tickets |
| 526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 527 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 528 | "$P_SRV debug_level=3 tickets=1" \ |
| 529 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 530 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 531 | -c "client hello, adding session ticket extension" \ |
| 532 | -s "found session ticket extension" \ |
| 533 | -s "server hello, adding session ticket extension" \ |
| 534 | -c "found session_ticket extension" \ |
| 535 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 536 | -S "session successfully restored from cache" \ |
| 537 | -s "session successfully restored from ticket" \ |
| 538 | -s "a session has been resumed" \ |
| 539 | -c "a session has been resumed" |
| 540 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 541 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 542 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 543 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 544 | 0 \ |
| 545 | -c "client hello, adding session ticket extension" \ |
| 546 | -s "found session ticket extension" \ |
| 547 | -s "server hello, adding session ticket extension" \ |
| 548 | -c "found session_ticket extension" \ |
| 549 | -c "parse new session ticket" \ |
| 550 | -S "session successfully restored from cache" \ |
| 551 | -s "session successfully restored from ticket" \ |
| 552 | -s "a session has been resumed" \ |
| 553 | -c "a session has been resumed" |
| 554 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 555 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 556 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 557 | "$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] | 558 | 0 \ |
| 559 | -c "client hello, adding session ticket extension" \ |
| 560 | -s "found session ticket extension" \ |
| 561 | -s "server hello, adding session ticket extension" \ |
| 562 | -c "found session_ticket extension" \ |
| 563 | -c "parse new session ticket" \ |
| 564 | -S "session successfully restored from cache" \ |
| 565 | -S "session successfully restored from ticket" \ |
| 566 | -S "a session has been resumed" \ |
| 567 | -C "a session has been resumed" |
| 568 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 569 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 570 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 571 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 572 | 0 \ |
| 573 | -c "client hello, adding session ticket extension" \ |
| 574 | -c "found session_ticket extension" \ |
| 575 | -c "parse new session ticket" \ |
| 576 | -c "a session has been resumed" |
| 577 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 578 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 579 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 580 | "( $O_CLI -sess_out $SESSION; \ |
| 581 | $O_CLI -sess_in $SESSION; \ |
| 582 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 583 | 0 \ |
| 584 | -s "found session ticket extension" \ |
| 585 | -s "server hello, adding session ticket extension" \ |
| 586 | -S "session successfully restored from cache" \ |
| 587 | -s "session successfully restored from ticket" \ |
| 588 | -s "a session has been resumed" |
| 589 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 590 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 591 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 592 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 593 | "$P_SRV debug_level=3 tickets=0" \ |
| 594 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 595 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 596 | -c "client hello, adding session ticket extension" \ |
| 597 | -s "found session ticket extension" \ |
| 598 | -S "server hello, adding session ticket extension" \ |
| 599 | -C "found session_ticket extension" \ |
| 600 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 601 | -s "session successfully restored from cache" \ |
| 602 | -S "session successfully restored from ticket" \ |
| 603 | -s "a session has been resumed" \ |
| 604 | -c "a session has been resumed" |
| 605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 606 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 607 | "$P_SRV debug_level=3 tickets=1" \ |
| 608 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 609 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 610 | -C "client hello, adding session ticket extension" \ |
| 611 | -S "found session ticket extension" \ |
| 612 | -S "server hello, adding session ticket extension" \ |
| 613 | -C "found session_ticket extension" \ |
| 614 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 615 | -s "session successfully restored from cache" \ |
| 616 | -S "session successfully restored from ticket" \ |
| 617 | -s "a session has been resumed" \ |
| 618 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 619 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 620 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 621 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 622 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 623 | 0 \ |
| 624 | -S "session successfully restored from cache" \ |
| 625 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 626 | -S "a session has been resumed" \ |
| 627 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 629 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 630 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 631 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 632 | 0 \ |
| 633 | -s "session successfully restored from cache" \ |
| 634 | -S "session successfully restored from ticket" \ |
| 635 | -s "a session has been resumed" \ |
| 636 | -c "a session has been resumed" |
| 637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 638 | run_test "Session resume using cache: timemout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 639 | "$P_SRV debug_level=3 tickets=0" \ |
| 640 | "$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] | 641 | 0 \ |
| 642 | -s "session successfully restored from cache" \ |
| 643 | -S "session successfully restored from ticket" \ |
| 644 | -s "a session has been resumed" \ |
| 645 | -c "a session has been resumed" |
| 646 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 647 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 648 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 649 | "$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] | 650 | 0 \ |
| 651 | -S "session successfully restored from cache" \ |
| 652 | -S "session successfully restored from ticket" \ |
| 653 | -S "a session has been resumed" \ |
| 654 | -C "a session has been resumed" |
| 655 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 656 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 657 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 658 | "$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] | 659 | 0 \ |
| 660 | -s "session successfully restored from cache" \ |
| 661 | -S "session successfully restored from ticket" \ |
| 662 | -s "a session has been resumed" \ |
| 663 | -c "a session has been resumed" |
| 664 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 665 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 666 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 667 | "( $O_CLI -sess_out $SESSION; \ |
| 668 | $O_CLI -sess_in $SESSION; \ |
| 669 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 670 | 0 \ |
| 671 | -s "found session ticket extension" \ |
| 672 | -S "server hello, adding session ticket extension" \ |
| 673 | -s "session successfully restored from cache" \ |
| 674 | -S "session successfully restored from ticket" \ |
| 675 | -s "a session has been resumed" |
| 676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 677 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 678 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 679 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 680 | 0 \ |
| 681 | -C "found session_ticket extension" \ |
| 682 | -C "parse new session ticket" \ |
| 683 | -c "a session has been resumed" |
| 684 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 685 | # Tests for Max Fragment Length extension |
| 686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 687 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 688 | "$P_SRV debug_level=3" \ |
| 689 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 690 | 0 \ |
| 691 | -C "client hello, adding max_fragment_length extension" \ |
| 692 | -S "found max fragment length extension" \ |
| 693 | -S "server hello, max_fragment_length extension" \ |
| 694 | -C "found max_fragment_length extension" |
| 695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 696 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 697 | "$P_SRV debug_level=3" \ |
| 698 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 699 | 0 \ |
| 700 | -c "client hello, adding max_fragment_length extension" \ |
| 701 | -s "found max fragment length extension" \ |
| 702 | -s "server hello, max_fragment_length extension" \ |
| 703 | -c "found max_fragment_length extension" |
| 704 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 705 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 706 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 707 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 708 | 0 \ |
| 709 | -C "client hello, adding max_fragment_length extension" \ |
| 710 | -S "found max fragment length extension" \ |
| 711 | -S "server hello, max_fragment_length extension" \ |
| 712 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 714 | requires_gnutls |
| 715 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 716 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 717 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 718 | 0 \ |
| 719 | -c "client hello, adding max_fragment_length extension" \ |
| 720 | -c "found max_fragment_length extension" |
| 721 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 722 | # Tests for renegotiation |
| 723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 724 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 725 | "$P_SRV debug_level=3 exchanges=2" \ |
| 726 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 727 | 0 \ |
| 728 | -C "client hello, adding renegotiation extension" \ |
| 729 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 730 | -S "found renegotiation extension" \ |
| 731 | -s "server hello, secure renegotiation extension" \ |
| 732 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 733 | -C "=> renegotiate" \ |
| 734 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 735 | -S "write hello request" |
| 736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 737 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 738 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1" \ |
| 739 | "$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] | 740 | 0 \ |
| 741 | -c "client hello, adding renegotiation extension" \ |
| 742 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 743 | -s "found renegotiation extension" \ |
| 744 | -s "server hello, secure renegotiation extension" \ |
| 745 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 746 | -c "=> renegotiate" \ |
| 747 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 748 | -S "write hello request" |
| 749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 750 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 751 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 752 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 753 | 0 \ |
| 754 | -c "client hello, adding renegotiation extension" \ |
| 755 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 756 | -s "found renegotiation extension" \ |
| 757 | -s "server hello, secure renegotiation extension" \ |
| 758 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 759 | -c "=> renegotiate" \ |
| 760 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 761 | -s "write hello request" |
| 762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 763 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 764 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 765 | "$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] | 766 | 0 \ |
| 767 | -c "client hello, adding renegotiation extension" \ |
| 768 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 769 | -s "found renegotiation extension" \ |
| 770 | -s "server hello, secure renegotiation extension" \ |
| 771 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 772 | -c "=> renegotiate" \ |
| 773 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 774 | -s "write hello request" |
| 775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 776 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 777 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0" \ |
| 778 | "$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] | 779 | 1 \ |
| 780 | -c "client hello, adding renegotiation extension" \ |
| 781 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 782 | -S "found renegotiation extension" \ |
| 783 | -s "server hello, secure renegotiation extension" \ |
| 784 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 785 | -c "=> renegotiate" \ |
| 786 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 787 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 788 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 789 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 790 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 791 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 792 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 793 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 794 | 0 \ |
| 795 | -C "client hello, adding renegotiation extension" \ |
| 796 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 797 | -S "found renegotiation extension" \ |
| 798 | -s "server hello, secure renegotiation extension" \ |
| 799 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 800 | -C "=> renegotiate" \ |
| 801 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 802 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 803 | -S "SSL - An unexpected message was received from our peer" \ |
| 804 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 806 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 807 | "$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] | 808 | renego_delay=-1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 809 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 810 | 0 \ |
| 811 | -C "client hello, adding renegotiation extension" \ |
| 812 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 813 | -S "found renegotiation extension" \ |
| 814 | -s "server hello, secure renegotiation extension" \ |
| 815 | -c "found renegotiation extension" \ |
| 816 | -C "=> renegotiate" \ |
| 817 | -S "=> renegotiate" \ |
| 818 | -s "write hello request" \ |
| 819 | -S "SSL - An unexpected message was received from our peer" \ |
| 820 | -S "failed" |
| 821 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 822 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 823 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 824 | "$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] | 825 | renego_delay=2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 826 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 827 | 0 \ |
| 828 | -C "client hello, adding renegotiation extension" \ |
| 829 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 830 | -S "found renegotiation extension" \ |
| 831 | -s "server hello, secure renegotiation extension" \ |
| 832 | -c "found renegotiation extension" \ |
| 833 | -C "=> renegotiate" \ |
| 834 | -S "=> renegotiate" \ |
| 835 | -s "write hello request" \ |
| 836 | -S "SSL - An unexpected message was received from our peer" \ |
| 837 | -S "failed" |
| 838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 839 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 840 | "$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] | 841 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 842 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 843 | 0 \ |
| 844 | -C "client hello, adding renegotiation extension" \ |
| 845 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 846 | -S "found renegotiation extension" \ |
| 847 | -s "server hello, secure renegotiation extension" \ |
| 848 | -c "found renegotiation extension" \ |
| 849 | -C "=> renegotiate" \ |
| 850 | -S "=> renegotiate" \ |
| 851 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 852 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 853 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 854 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 855 | "$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] | 856 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 857 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 858 | 0 \ |
| 859 | -c "client hello, adding renegotiation extension" \ |
| 860 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 861 | -s "found renegotiation extension" \ |
| 862 | -s "server hello, secure renegotiation extension" \ |
| 863 | -c "found renegotiation extension" \ |
| 864 | -c "=> renegotiate" \ |
| 865 | -s "=> renegotiate" \ |
| 866 | -s "write hello request" \ |
| 867 | -S "SSL - An unexpected message was received from our peer" \ |
| 868 | -S "failed" |
| 869 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 870 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 871 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
| 872 | "$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] | 873 | 0 \ |
| 874 | -c "client hello, adding renegotiation extension" \ |
| 875 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 876 | -s "found renegotiation extension" \ |
| 877 | -s "server hello, secure renegotiation extension" \ |
| 878 | -c "found renegotiation extension" \ |
| 879 | -c "=> renegotiate" \ |
| 880 | -s "=> renegotiate" \ |
| 881 | -S "write hello request" |
| 882 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 883 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 884 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 885 | "$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] | 886 | 0 \ |
| 887 | -c "client hello, adding renegotiation extension" \ |
| 888 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 889 | -s "found renegotiation extension" \ |
| 890 | -s "server hello, secure renegotiation extension" \ |
| 891 | -c "found renegotiation extension" \ |
| 892 | -c "=> renegotiate" \ |
| 893 | -s "=> renegotiate" \ |
| 894 | -s "write hello request" |
| 895 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 896 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 897 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 898 | "$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] | 899 | 0 \ |
| 900 | -c "client hello, adding renegotiation extension" \ |
| 901 | -c "found renegotiation extension" \ |
| 902 | -c "=> renegotiate" \ |
| 903 | -C "ssl_handshake returned" \ |
| 904 | -C "error" \ |
| 905 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 907 | run_test "Renegotiation: gnutls server, client-initiated" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 908 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 909 | "$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] | 910 | 0 \ |
| 911 | -c "client hello, adding renegotiation extension" \ |
| 912 | -c "found renegotiation extension" \ |
| 913 | -c "=> renegotiate" \ |
| 914 | -C "ssl_handshake returned" \ |
| 915 | -C "error" \ |
| 916 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 917 | |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 918 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 919 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 920 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 921 | 0 \ |
| 922 | -c "client hello, adding renegotiation extension" \ |
| 923 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 924 | -s "found renegotiation extension" \ |
| 925 | -s "server hello, secure renegotiation extension" \ |
| 926 | -c "found renegotiation extension" \ |
| 927 | -c "=> renegotiate" \ |
| 928 | -s "=> renegotiate" \ |
| 929 | -S "write hello request" |
| 930 | |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 931 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 932 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 933 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 934 | 0 \ |
| 935 | -c "client hello, adding renegotiation extension" \ |
| 936 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 937 | -s "found renegotiation extension" \ |
| 938 | -s "server hello, secure renegotiation extension" \ |
| 939 | -c "found renegotiation extension" \ |
| 940 | -c "=> renegotiate" \ |
| 941 | -s "=> renegotiate" \ |
| 942 | -s "write hello request" |
| 943 | |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 944 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 945 | "$G_SRV -u --mtu 4096" \ |
| 946 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 947 | 0 \ |
| 948 | -c "client hello, adding renegotiation extension" \ |
| 949 | -c "found renegotiation extension" \ |
| 950 | -c "=> renegotiate" \ |
| 951 | -C "ssl_handshake returned" \ |
| 952 | -C "error" \ |
| 953 | -s "Extra-header:" |
| 954 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 955 | # Tests for auth_mode |
| 956 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 957 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 958 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 959 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 960 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 961 | 1 \ |
| 962 | -c "x509_verify_cert() returned" \ |
| 963 | -c "! self-signed or not signed by a trusted CA" \ |
| 964 | -c "! ssl_handshake returned" \ |
| 965 | -c "X509 - Certificate verification failed" |
| 966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 967 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 968 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 969 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 970 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 971 | 0 \ |
| 972 | -c "x509_verify_cert() returned" \ |
| 973 | -c "! self-signed or not signed by a trusted CA" \ |
| 974 | -C "! ssl_handshake returned" \ |
| 975 | -C "X509 - Certificate verification failed" |
| 976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 977 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 978 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 979 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 980 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 981 | 0 \ |
| 982 | -C "x509_verify_cert() returned" \ |
| 983 | -C "! self-signed or not signed by a trusted CA" \ |
| 984 | -C "! ssl_handshake returned" \ |
| 985 | -C "X509 - Certificate verification failed" |
| 986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 987 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 988 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 989 | "$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] | 990 | key_file=data_files/server5.key" \ |
| 991 | 1 \ |
| 992 | -S "skip write certificate request" \ |
| 993 | -C "skip parse certificate request" \ |
| 994 | -c "got a certificate request" \ |
| 995 | -C "skip write certificate" \ |
| 996 | -C "skip write certificate verify" \ |
| 997 | -S "skip parse certificate verify" \ |
| 998 | -s "x509_verify_cert() returned" \ |
| 999 | -S "! self-signed or not signed by a trusted CA" \ |
| 1000 | -s "! ssl_handshake returned" \ |
| 1001 | -c "! ssl_handshake returned" \ |
| 1002 | -s "X509 - Certificate verification failed" |
| 1003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1004 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1005 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1006 | "$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] | 1007 | key_file=data_files/server5.key" \ |
| 1008 | 0 \ |
| 1009 | -S "skip write certificate request" \ |
| 1010 | -C "skip parse certificate request" \ |
| 1011 | -c "got a certificate request" \ |
| 1012 | -C "skip write certificate" \ |
| 1013 | -C "skip write certificate verify" \ |
| 1014 | -S "skip parse certificate verify" \ |
| 1015 | -s "x509_verify_cert() returned" \ |
| 1016 | -s "! self-signed or not signed by a trusted CA" \ |
| 1017 | -S "! ssl_handshake returned" \ |
| 1018 | -C "! ssl_handshake returned" \ |
| 1019 | -S "X509 - Certificate verification failed" |
| 1020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1021 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1022 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1023 | "$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] | 1024 | key_file=data_files/server5.key" \ |
| 1025 | 0 \ |
| 1026 | -s "skip write certificate request" \ |
| 1027 | -C "skip parse certificate request" \ |
| 1028 | -c "got no certificate request" \ |
| 1029 | -c "skip write certificate" \ |
| 1030 | -c "skip write certificate verify" \ |
| 1031 | -s "skip parse certificate verify" \ |
| 1032 | -S "x509_verify_cert() returned" \ |
| 1033 | -S "! self-signed or not signed by a trusted CA" \ |
| 1034 | -S "! ssl_handshake returned" \ |
| 1035 | -C "! ssl_handshake returned" \ |
| 1036 | -S "X509 - Certificate verification failed" |
| 1037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1038 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1039 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1040 | "$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] | 1041 | 0 \ |
| 1042 | -S "skip write certificate request" \ |
| 1043 | -C "skip parse certificate request" \ |
| 1044 | -c "got a certificate request" \ |
| 1045 | -C "skip write certificate$" \ |
| 1046 | -C "got no certificate to send" \ |
| 1047 | -S "SSLv3 client has no certificate" \ |
| 1048 | -c "skip write certificate verify" \ |
| 1049 | -s "skip parse certificate verify" \ |
| 1050 | -s "! no client certificate sent" \ |
| 1051 | -S "! ssl_handshake returned" \ |
| 1052 | -C "! ssl_handshake returned" \ |
| 1053 | -S "X509 - Certificate verification failed" |
| 1054 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1055 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1056 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1057 | "$O_CLI" \ |
| 1058 | 0 \ |
| 1059 | -S "skip write certificate request" \ |
| 1060 | -s "skip parse certificate verify" \ |
| 1061 | -s "! no client certificate sent" \ |
| 1062 | -S "! ssl_handshake returned" \ |
| 1063 | -S "X509 - Certificate verification failed" |
| 1064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1065 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1066 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1067 | "$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] | 1068 | 0 \ |
| 1069 | -C "skip parse certificate request" \ |
| 1070 | -c "got a certificate request" \ |
| 1071 | -C "skip write certificate$" \ |
| 1072 | -c "skip write certificate verify" \ |
| 1073 | -C "! ssl_handshake returned" |
| 1074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1075 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1076 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
| 1077 | "$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] | 1078 | 0 \ |
| 1079 | -S "skip write certificate request" \ |
| 1080 | -C "skip parse certificate request" \ |
| 1081 | -c "got a certificate request" \ |
| 1082 | -C "skip write certificate$" \ |
| 1083 | -c "skip write certificate verify" \ |
| 1084 | -c "got no certificate to send" \ |
| 1085 | -s "SSLv3 client has no certificate" \ |
| 1086 | -s "skip parse certificate verify" \ |
| 1087 | -s "! no client certificate sent" \ |
| 1088 | -S "! ssl_handshake returned" \ |
| 1089 | -C "! ssl_handshake returned" \ |
| 1090 | -S "X509 - Certificate verification failed" |
| 1091 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1092 | # tests for SNI |
| 1093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1094 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1095 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1096 | 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] | 1097 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1098 | 0 \ |
| 1099 | -S "parse ServerName extension" \ |
| 1100 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1101 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1102 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1103 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1104 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1105 | 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] | 1106 | 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] | 1107 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1108 | 0 \ |
| 1109 | -s "parse ServerName extension" \ |
| 1110 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1111 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1113 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1114 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1115 | 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] | 1116 | 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] | 1117 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1118 | 0 \ |
| 1119 | -s "parse ServerName extension" \ |
| 1120 | -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] | 1121 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1123 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1124 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1125 | 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] | 1126 | 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] | 1127 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1128 | 1 \ |
| 1129 | -s "parse ServerName extension" \ |
| 1130 | -s "ssl_sni_wrapper() returned" \ |
| 1131 | -s "ssl_handshake returned" \ |
| 1132 | -c "ssl_handshake returned" \ |
| 1133 | -c "SSL - A fatal alert message was received from our peer" |
| 1134 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1135 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1137 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1138 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1139 | "$P_CLI nbio=2 tickets=0" \ |
| 1140 | 0 \ |
| 1141 | -S "ssl_handshake returned" \ |
| 1142 | -C "ssl_handshake returned" \ |
| 1143 | -c "Read from server: .* bytes read" |
| 1144 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1145 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1146 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1147 | "$P_CLI nbio=2 tickets=0" \ |
| 1148 | 0 \ |
| 1149 | -S "ssl_handshake returned" \ |
| 1150 | -C "ssl_handshake returned" \ |
| 1151 | -c "Read from server: .* bytes read" |
| 1152 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1153 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1154 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1155 | "$P_CLI nbio=2 tickets=1" \ |
| 1156 | 0 \ |
| 1157 | -S "ssl_handshake returned" \ |
| 1158 | -C "ssl_handshake returned" \ |
| 1159 | -c "Read from server: .* bytes read" |
| 1160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1161 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1162 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1163 | "$P_CLI nbio=2 tickets=1" \ |
| 1164 | 0 \ |
| 1165 | -S "ssl_handshake returned" \ |
| 1166 | -C "ssl_handshake returned" \ |
| 1167 | -c "Read from server: .* bytes read" |
| 1168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1169 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1170 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1171 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1172 | 0 \ |
| 1173 | -S "ssl_handshake returned" \ |
| 1174 | -C "ssl_handshake returned" \ |
| 1175 | -c "Read from server: .* bytes read" |
| 1176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1177 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1178 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1179 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1180 | 0 \ |
| 1181 | -S "ssl_handshake returned" \ |
| 1182 | -C "ssl_handshake returned" \ |
| 1183 | -c "Read from server: .* bytes read" |
| 1184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1185 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1186 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1187 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1188 | 0 \ |
| 1189 | -S "ssl_handshake returned" \ |
| 1190 | -C "ssl_handshake returned" \ |
| 1191 | -c "Read from server: .* bytes read" |
| 1192 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1193 | # Tests for version negotiation |
| 1194 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1195 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1196 | "$P_SRV" \ |
| 1197 | "$P_CLI" \ |
| 1198 | 0 \ |
| 1199 | -S "ssl_handshake returned" \ |
| 1200 | -C "ssl_handshake returned" \ |
| 1201 | -s "Protocol is TLSv1.2" \ |
| 1202 | -c "Protocol is TLSv1.2" |
| 1203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1204 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1205 | "$P_SRV" \ |
| 1206 | "$P_CLI max_version=tls1_1" \ |
| 1207 | 0 \ |
| 1208 | -S "ssl_handshake returned" \ |
| 1209 | -C "ssl_handshake returned" \ |
| 1210 | -s "Protocol is TLSv1.1" \ |
| 1211 | -c "Protocol is TLSv1.1" |
| 1212 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1213 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1214 | "$P_SRV max_version=tls1_1" \ |
| 1215 | "$P_CLI" \ |
| 1216 | 0 \ |
| 1217 | -S "ssl_handshake returned" \ |
| 1218 | -C "ssl_handshake returned" \ |
| 1219 | -s "Protocol is TLSv1.1" \ |
| 1220 | -c "Protocol is TLSv1.1" |
| 1221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1222 | 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] | 1223 | "$P_SRV max_version=tls1_1" \ |
| 1224 | "$P_CLI max_version=tls1_1" \ |
| 1225 | 0 \ |
| 1226 | -S "ssl_handshake returned" \ |
| 1227 | -C "ssl_handshake returned" \ |
| 1228 | -s "Protocol is TLSv1.1" \ |
| 1229 | -c "Protocol is TLSv1.1" |
| 1230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1231 | 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] | 1232 | "$P_SRV min_version=tls1_1" \ |
| 1233 | "$P_CLI max_version=tls1_1" \ |
| 1234 | 0 \ |
| 1235 | -S "ssl_handshake returned" \ |
| 1236 | -C "ssl_handshake returned" \ |
| 1237 | -s "Protocol is TLSv1.1" \ |
| 1238 | -c "Protocol is TLSv1.1" |
| 1239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1240 | 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] | 1241 | "$P_SRV max_version=tls1_1" \ |
| 1242 | "$P_CLI min_version=tls1_1" \ |
| 1243 | 0 \ |
| 1244 | -S "ssl_handshake returned" \ |
| 1245 | -C "ssl_handshake returned" \ |
| 1246 | -s "Protocol is TLSv1.1" \ |
| 1247 | -c "Protocol is TLSv1.1" |
| 1248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1249 | 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] | 1250 | "$P_SRV max_version=tls1_1" \ |
| 1251 | "$P_CLI min_version=tls1_2" \ |
| 1252 | 1 \ |
| 1253 | -s "ssl_handshake returned" \ |
| 1254 | -c "ssl_handshake returned" \ |
| 1255 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1257 | 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] | 1258 | "$P_SRV min_version=tls1_2" \ |
| 1259 | "$P_CLI max_version=tls1_1" \ |
| 1260 | 1 \ |
| 1261 | -s "ssl_handshake returned" \ |
| 1262 | -c "ssl_handshake returned" \ |
| 1263 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1264 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1265 | # Tests for ALPN extension |
| 1266 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1267 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1268 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1269 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1270 | "$P_SRV debug_level=3" \ |
| 1271 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1272 | 0 \ |
| 1273 | -C "client hello, adding alpn extension" \ |
| 1274 | -S "found alpn extension" \ |
| 1275 | -C "got an alert message, type: \\[2:120]" \ |
| 1276 | -S "server hello, adding alpn extension" \ |
| 1277 | -C "found alpn extension " \ |
| 1278 | -C "Application Layer Protocol is" \ |
| 1279 | -S "Application Layer Protocol is" |
| 1280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1281 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1282 | "$P_SRV debug_level=3" \ |
| 1283 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1284 | 0 \ |
| 1285 | -c "client hello, adding alpn extension" \ |
| 1286 | -s "found alpn extension" \ |
| 1287 | -C "got an alert message, type: \\[2:120]" \ |
| 1288 | -S "server hello, adding alpn extension" \ |
| 1289 | -C "found alpn extension " \ |
| 1290 | -c "Application Layer Protocol is (none)" \ |
| 1291 | -S "Application Layer Protocol is" |
| 1292 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1293 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1294 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1295 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1296 | 0 \ |
| 1297 | -C "client hello, adding alpn extension" \ |
| 1298 | -S "found alpn extension" \ |
| 1299 | -C "got an alert message, type: \\[2:120]" \ |
| 1300 | -S "server hello, adding alpn extension" \ |
| 1301 | -C "found alpn extension " \ |
| 1302 | -C "Application Layer Protocol is" \ |
| 1303 | -s "Application Layer Protocol is (none)" |
| 1304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1305 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1306 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1307 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1308 | 0 \ |
| 1309 | -c "client hello, adding alpn extension" \ |
| 1310 | -s "found alpn extension" \ |
| 1311 | -C "got an alert message, type: \\[2:120]" \ |
| 1312 | -s "server hello, adding alpn extension" \ |
| 1313 | -c "found alpn extension" \ |
| 1314 | -c "Application Layer Protocol is abc" \ |
| 1315 | -s "Application Layer Protocol is abc" |
| 1316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1317 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1318 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1319 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1320 | 0 \ |
| 1321 | -c "client hello, adding alpn extension" \ |
| 1322 | -s "found alpn extension" \ |
| 1323 | -C "got an alert message, type: \\[2:120]" \ |
| 1324 | -s "server hello, adding alpn extension" \ |
| 1325 | -c "found alpn extension" \ |
| 1326 | -c "Application Layer Protocol is abc" \ |
| 1327 | -s "Application Layer Protocol is abc" |
| 1328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1329 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1330 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1331 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1332 | 0 \ |
| 1333 | -c "client hello, adding alpn extension" \ |
| 1334 | -s "found alpn extension" \ |
| 1335 | -C "got an alert message, type: \\[2:120]" \ |
| 1336 | -s "server hello, adding alpn extension" \ |
| 1337 | -c "found alpn extension" \ |
| 1338 | -c "Application Layer Protocol is 1234" \ |
| 1339 | -s "Application Layer Protocol is 1234" |
| 1340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1341 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1342 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1343 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1344 | 1 \ |
| 1345 | -c "client hello, adding alpn extension" \ |
| 1346 | -s "found alpn extension" \ |
| 1347 | -c "got an alert message, type: \\[2:120]" \ |
| 1348 | -S "server hello, adding alpn extension" \ |
| 1349 | -C "found alpn extension" \ |
| 1350 | -C "Application Layer Protocol is 1234" \ |
| 1351 | -S "Application Layer Protocol is 1234" |
| 1352 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1353 | fi |
| 1354 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1355 | # Tests for keyUsage in leaf certificates, part 1: |
| 1356 | # server-side certificate/suite selection |
| 1357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1358 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1359 | "$P_SRV key_file=data_files/server2.key \ |
| 1360 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1361 | "$P_CLI" \ |
| 1362 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1363 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1364 | |
| 1365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1366 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1367 | "$P_SRV key_file=data_files/server2.key \ |
| 1368 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1369 | "$P_CLI" \ |
| 1370 | 0 \ |
| 1371 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1373 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1374 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1375 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1376 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1377 | 1 \ |
| 1378 | -C "Ciphersuite is " |
| 1379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1380 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1381 | "$P_SRV key_file=data_files/server5.key \ |
| 1382 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1383 | "$P_CLI" \ |
| 1384 | 0 \ |
| 1385 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1386 | |
| 1387 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1388 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1389 | "$P_SRV key_file=data_files/server5.key \ |
| 1390 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1391 | "$P_CLI" \ |
| 1392 | 0 \ |
| 1393 | -c "Ciphersuite is TLS-ECDH-" |
| 1394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1395 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1396 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1397 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1398 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1399 | 1 \ |
| 1400 | -C "Ciphersuite is " |
| 1401 | |
| 1402 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1403 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1405 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1406 | "$O_SRV -key data_files/server2.key \ |
| 1407 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1408 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1409 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1410 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1411 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1412 | -C "Processing of the Certificate handshake message failed" \ |
| 1413 | -c "Ciphersuite is TLS-" |
| 1414 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1415 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1416 | "$O_SRV -key data_files/server2.key \ |
| 1417 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1418 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1419 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1420 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1421 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1422 | -C "Processing of the Certificate handshake message failed" \ |
| 1423 | -c "Ciphersuite is TLS-" |
| 1424 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1425 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1426 | "$O_SRV -key data_files/server2.key \ |
| 1427 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1428 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1429 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1430 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1431 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1432 | -C "Processing of the Certificate handshake message failed" \ |
| 1433 | -c "Ciphersuite is TLS-" |
| 1434 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1435 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1436 | "$O_SRV -key data_files/server2.key \ |
| 1437 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1438 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1439 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1440 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1441 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1442 | -c "Processing of the Certificate handshake message failed" \ |
| 1443 | -C "Ciphersuite is TLS-" |
| 1444 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1445 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1446 | "$O_SRV -key data_files/server2.key \ |
| 1447 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1448 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1449 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1450 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1451 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1452 | -C "Processing of the Certificate handshake message failed" \ |
| 1453 | -c "Ciphersuite is TLS-" |
| 1454 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1455 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1456 | "$O_SRV -key data_files/server2.key \ |
| 1457 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1458 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1459 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1460 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1461 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1462 | -c "Processing of the Certificate handshake message failed" \ |
| 1463 | -C "Ciphersuite is TLS-" |
| 1464 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1465 | # Tests for keyUsage in leaf certificates, part 3: |
| 1466 | # server-side checking of client cert |
| 1467 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1468 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1469 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1470 | "$O_CLI -key data_files/server2.key \ |
| 1471 | -cert data_files/server2.ku-ds.crt" \ |
| 1472 | 0 \ |
| 1473 | -S "bad certificate (usage extensions)" \ |
| 1474 | -S "Processing of the Certificate handshake message failed" |
| 1475 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1476 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1477 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1478 | "$O_CLI -key data_files/server2.key \ |
| 1479 | -cert data_files/server2.ku-ke.crt" \ |
| 1480 | 0 \ |
| 1481 | -s "bad certificate (usage extensions)" \ |
| 1482 | -S "Processing of the Certificate handshake message failed" |
| 1483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1484 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1485 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1486 | "$O_CLI -key data_files/server2.key \ |
| 1487 | -cert data_files/server2.ku-ke.crt" \ |
| 1488 | 1 \ |
| 1489 | -s "bad certificate (usage extensions)" \ |
| 1490 | -s "Processing of the Certificate handshake message failed" |
| 1491 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1492 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1493 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1494 | "$O_CLI -key data_files/server5.key \ |
| 1495 | -cert data_files/server5.ku-ds.crt" \ |
| 1496 | 0 \ |
| 1497 | -S "bad certificate (usage extensions)" \ |
| 1498 | -S "Processing of the Certificate handshake message failed" |
| 1499 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1500 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1501 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1502 | "$O_CLI -key data_files/server5.key \ |
| 1503 | -cert data_files/server5.ku-ka.crt" \ |
| 1504 | 0 \ |
| 1505 | -s "bad certificate (usage extensions)" \ |
| 1506 | -S "Processing of the Certificate handshake message failed" |
| 1507 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1508 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1509 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1510 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1511 | "$P_SRV key_file=data_files/server5.key \ |
| 1512 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1513 | "$P_CLI" \ |
| 1514 | 0 |
| 1515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1516 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1517 | "$P_SRV key_file=data_files/server5.key \ |
| 1518 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1519 | "$P_CLI" \ |
| 1520 | 0 |
| 1521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1522 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1523 | "$P_SRV key_file=data_files/server5.key \ |
| 1524 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1525 | "$P_CLI" \ |
| 1526 | 0 |
| 1527 | |
| 1528 | # 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] | 1529 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1530 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1531 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1532 | "$P_CLI psk=badbad" \ |
| 1533 | 1 |
| 1534 | |
| 1535 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1536 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1537 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1538 | "$O_SRV -key data_files/server5.key \ |
| 1539 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1540 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1541 | 0 \ |
| 1542 | -C "bad certificate (usage extensions)" \ |
| 1543 | -C "Processing of the Certificate handshake message failed" \ |
| 1544 | -c "Ciphersuite is TLS-" |
| 1545 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1546 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1547 | "$O_SRV -key data_files/server5.key \ |
| 1548 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1549 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1550 | 0 \ |
| 1551 | -C "bad certificate (usage extensions)" \ |
| 1552 | -C "Processing of the Certificate handshake message failed" \ |
| 1553 | -c "Ciphersuite is TLS-" |
| 1554 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1555 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1556 | "$O_SRV -key data_files/server5.key \ |
| 1557 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1558 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1559 | 0 \ |
| 1560 | -C "bad certificate (usage extensions)" \ |
| 1561 | -C "Processing of the Certificate handshake message failed" \ |
| 1562 | -c "Ciphersuite is TLS-" |
| 1563 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1564 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1565 | "$O_SRV -key data_files/server5.key \ |
| 1566 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1567 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1568 | 1 \ |
| 1569 | -c "bad certificate (usage extensions)" \ |
| 1570 | -c "Processing of the Certificate handshake message failed" \ |
| 1571 | -C "Ciphersuite is TLS-" |
| 1572 | |
| 1573 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 1574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1575 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1576 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1577 | "$O_CLI -key data_files/server5.key \ |
| 1578 | -cert data_files/server5.eku-cli.crt" \ |
| 1579 | 0 \ |
| 1580 | -S "bad certificate (usage extensions)" \ |
| 1581 | -S "Processing of the Certificate handshake message failed" |
| 1582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1583 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1584 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1585 | "$O_CLI -key data_files/server5.key \ |
| 1586 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 1587 | 0 \ |
| 1588 | -S "bad certificate (usage extensions)" \ |
| 1589 | -S "Processing of the Certificate handshake message failed" |
| 1590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1591 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1592 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1593 | "$O_CLI -key data_files/server5.key \ |
| 1594 | -cert data_files/server5.eku-cs_any.crt" \ |
| 1595 | 0 \ |
| 1596 | -S "bad certificate (usage extensions)" \ |
| 1597 | -S "Processing of the Certificate handshake message failed" |
| 1598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1599 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1600 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1601 | "$O_CLI -key data_files/server5.key \ |
| 1602 | -cert data_files/server5.eku-cs.crt" \ |
| 1603 | 0 \ |
| 1604 | -s "bad certificate (usage extensions)" \ |
| 1605 | -S "Processing of the Certificate handshake message failed" |
| 1606 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1607 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1608 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1609 | "$O_CLI -key data_files/server5.key \ |
| 1610 | -cert data_files/server5.eku-cs.crt" \ |
| 1611 | 1 \ |
| 1612 | -s "bad certificate (usage extensions)" \ |
| 1613 | -s "Processing of the Certificate handshake message failed" |
| 1614 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1615 | # Tests for DHM parameters loading |
| 1616 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1617 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1618 | "$P_SRV" \ |
| 1619 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1620 | debug_level=3" \ |
| 1621 | 0 \ |
| 1622 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 1623 | -c "value of 'DHM: G ' (2048 bits)" |
| 1624 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1625 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1626 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 1627 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1628 | debug_level=3" \ |
| 1629 | 0 \ |
| 1630 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 1631 | -c "value of 'DHM: G ' (2 bits)" |
| 1632 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1633 | # Tests for PSK callback |
| 1634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1635 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1636 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 1637 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1638 | psk_identity=foo psk=abc123" \ |
| 1639 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1640 | -S "SSL - The server has no ciphersuites in common" \ |
| 1641 | -S "SSL - Unknown identity received" \ |
| 1642 | -S "SSL - Verification of the message MAC failed" |
| 1643 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1644 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1645 | "$P_SRV" \ |
| 1646 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1647 | psk_identity=foo psk=abc123" \ |
| 1648 | 1 \ |
| 1649 | -s "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1650 | -S "SSL - Unknown identity received" \ |
| 1651 | -S "SSL - Verification of the message MAC failed" |
| 1652 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1653 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1654 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 1655 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1656 | psk_identity=foo psk=abc123" \ |
| 1657 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1658 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1659 | -s "SSL - Unknown identity received" \ |
| 1660 | -S "SSL - Verification of the message MAC failed" |
| 1661 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1662 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1663 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1664 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1665 | psk_identity=abc psk=dead" \ |
| 1666 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1667 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1668 | -S "SSL - Unknown identity received" \ |
| 1669 | -S "SSL - Verification of the message MAC failed" |
| 1670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1671 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1672 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1673 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1674 | psk_identity=def psk=beef" \ |
| 1675 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1676 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1677 | -S "SSL - Unknown identity received" \ |
| 1678 | -S "SSL - Verification of the message MAC failed" |
| 1679 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1680 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1681 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1682 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1683 | psk_identity=ghi psk=beef" \ |
| 1684 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1685 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1686 | -s "SSL - Unknown identity received" \ |
| 1687 | -S "SSL - Verification of the message MAC failed" |
| 1688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1689 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1690 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1691 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1692 | psk_identity=abc psk=beef" \ |
| 1693 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1694 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1695 | -S "SSL - Unknown identity received" \ |
| 1696 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1697 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1698 | # Tests for ciphersuites per version |
| 1699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1700 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1701 | "$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" \ |
| 1702 | "$P_CLI force_version=ssl3" \ |
| 1703 | 0 \ |
| 1704 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 1705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1706 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1707 | "$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" \ |
| 1708 | "$P_CLI force_version=tls1" \ |
| 1709 | 0 \ |
| 1710 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 1711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1712 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1713 | "$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" \ |
| 1714 | "$P_CLI force_version=tls1_1" \ |
| 1715 | 0 \ |
| 1716 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 1717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1718 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1719 | "$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" \ |
| 1720 | "$P_CLI force_version=tls1_2" \ |
| 1721 | 0 \ |
| 1722 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 1723 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1724 | # Tests for ssl_get_bytes_avail() |
| 1725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1726 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1727 | "$P_SRV" \ |
| 1728 | "$P_CLI request_size=100" \ |
| 1729 | 0 \ |
| 1730 | -s "Read from client: 100 bytes read$" |
| 1731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1732 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1733 | "$P_SRV" \ |
| 1734 | "$P_CLI request_size=500" \ |
| 1735 | 0 \ |
| 1736 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1737 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1738 | # Tests for small packets |
| 1739 | |
| 1740 | run_test "Small packet SSLv3 BlockCipher" \ |
| 1741 | "$P_SRV" \ |
| 1742 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1743 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1744 | 0 \ |
| 1745 | -s "Read from client: 1 bytes read" |
| 1746 | |
| 1747 | run_test "Small packet SSLv3 StreamCipher" \ |
| 1748 | "$P_SRV" \ |
| 1749 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1750 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1751 | 0 \ |
| 1752 | -s "Read from client: 1 bytes read" |
| 1753 | |
| 1754 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 1755 | "$P_SRV" \ |
| 1756 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1757 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1758 | 0 \ |
| 1759 | -s "Read from client: 1 bytes read" |
| 1760 | |
| 1761 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1762 | "$P_SRV" \ |
| 1763 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1764 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1765 | trunc_hmac=1" \ |
| 1766 | 0 \ |
| 1767 | -s "Read from client: 1 bytes read" |
| 1768 | |
| 1769 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
| 1770 | "$P_SRV" \ |
| 1771 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1772 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1773 | trunc_hmac=1" \ |
| 1774 | 0 \ |
| 1775 | -s "Read from client: 1 bytes read" |
| 1776 | |
| 1777 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 1778 | "$P_SRV" \ |
| 1779 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1780 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1781 | 0 \ |
| 1782 | -s "Read from client: 1 bytes read" |
| 1783 | |
| 1784 | run_test "Small packet TLS 1.1 StreamCipher" \ |
| 1785 | "$P_SRV" \ |
| 1786 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1787 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1788 | 0 \ |
| 1789 | -s "Read from client: 1 bytes read" |
| 1790 | |
| 1791 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1792 | "$P_SRV" \ |
| 1793 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1794 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1795 | trunc_hmac=1" \ |
| 1796 | 0 \ |
| 1797 | -s "Read from client: 1 bytes read" |
| 1798 | |
| 1799 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
| 1800 | "$P_SRV" \ |
| 1801 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1802 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1803 | trunc_hmac=1" \ |
| 1804 | 0 \ |
| 1805 | -s "Read from client: 1 bytes read" |
| 1806 | |
| 1807 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 1808 | "$P_SRV" \ |
| 1809 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1810 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1811 | 0 \ |
| 1812 | -s "Read from client: 1 bytes read" |
| 1813 | |
| 1814 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 1815 | "$P_SRV" \ |
| 1816 | "$P_CLI request_size=1 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1817 | 0 \ |
| 1818 | -s "Read from client: 1 bytes read" |
| 1819 | |
| 1820 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1821 | "$P_SRV" \ |
| 1822 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1823 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1824 | trunc_hmac=1" \ |
| 1825 | 0 \ |
| 1826 | -s "Read from client: 1 bytes read" |
| 1827 | |
| 1828 | run_test "Small packet TLS 1.2 StreamCipher" \ |
| 1829 | "$P_SRV" \ |
| 1830 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1831 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1832 | 0 \ |
| 1833 | -s "Read from client: 1 bytes read" |
| 1834 | |
| 1835 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
| 1836 | "$P_SRV" \ |
| 1837 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1838 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1839 | trunc_hmac=1" \ |
| 1840 | 0 \ |
| 1841 | -s "Read from client: 1 bytes read" |
| 1842 | |
| 1843 | run_test "Small packet TLS 1.2 AEAD" \ |
| 1844 | "$P_SRV" \ |
| 1845 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1847 | 0 \ |
| 1848 | -s "Read from client: 1 bytes read" |
| 1849 | |
| 1850 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 1851 | "$P_SRV" \ |
| 1852 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1854 | 0 \ |
| 1855 | -s "Read from client: 1 bytes read" |
| 1856 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1857 | # Test for large packets |
| 1858 | |
| 1859 | run_test "Large packet SSLv3 BlockCipher" \ |
| 1860 | "$P_SRV" \ |
| 1861 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1862 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1863 | 0 \ |
| 1864 | -s "Read from client: 16384 bytes read" |
| 1865 | |
| 1866 | run_test "Large packet SSLv3 StreamCipher" \ |
| 1867 | "$P_SRV" \ |
| 1868 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1869 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1870 | 0 \ |
| 1871 | -s "Read from client: 16384 bytes read" |
| 1872 | |
| 1873 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 1874 | "$P_SRV" \ |
| 1875 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1876 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1877 | 0 \ |
| 1878 | -s "Read from client: 16384 bytes read" |
| 1879 | |
| 1880 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1881 | "$P_SRV" \ |
| 1882 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1883 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1884 | trunc_hmac=1" \ |
| 1885 | 0 \ |
| 1886 | -s "Read from client: 16384 bytes read" |
| 1887 | |
| 1888 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
| 1889 | "$P_SRV" \ |
| 1890 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1891 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1892 | trunc_hmac=1" \ |
| 1893 | 0 \ |
| 1894 | -s "Read from client: 16384 bytes read" |
| 1895 | |
| 1896 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 1897 | "$P_SRV" \ |
| 1898 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1899 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1900 | 0 \ |
| 1901 | -s "Read from client: 16384 bytes read" |
| 1902 | |
| 1903 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 1904 | "$P_SRV" \ |
| 1905 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1906 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1907 | 0 \ |
| 1908 | -s "Read from client: 16384 bytes read" |
| 1909 | |
| 1910 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1911 | "$P_SRV" \ |
| 1912 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1914 | trunc_hmac=1" \ |
| 1915 | 0 \ |
| 1916 | -s "Read from client: 16384 bytes read" |
| 1917 | |
| 1918 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
| 1919 | "$P_SRV" \ |
| 1920 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1921 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1922 | trunc_hmac=1" \ |
| 1923 | 0 \ |
| 1924 | -s "Read from client: 16384 bytes read" |
| 1925 | |
| 1926 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 1927 | "$P_SRV" \ |
| 1928 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1929 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1930 | 0 \ |
| 1931 | -s "Read from client: 16384 bytes read" |
| 1932 | |
| 1933 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 1934 | "$P_SRV" \ |
| 1935 | "$P_CLI request_size=16384 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1936 | 0 \ |
| 1937 | -s "Read from client: 16384 bytes read" |
| 1938 | |
| 1939 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1940 | "$P_SRV" \ |
| 1941 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1942 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1943 | trunc_hmac=1" \ |
| 1944 | 0 \ |
| 1945 | -s "Read from client: 16384 bytes read" |
| 1946 | |
| 1947 | run_test "Large packet TLS 1.2 StreamCipher" \ |
| 1948 | "$P_SRV" \ |
| 1949 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1951 | 0 \ |
| 1952 | -s "Read from client: 16384 bytes read" |
| 1953 | |
| 1954 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
| 1955 | "$P_SRV" \ |
| 1956 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1958 | trunc_hmac=1" \ |
| 1959 | 0 \ |
| 1960 | -s "Read from client: 16384 bytes read" |
| 1961 | |
| 1962 | run_test "Large packet TLS 1.2 AEAD" \ |
| 1963 | "$P_SRV" \ |
| 1964 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1965 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1966 | 0 \ |
| 1967 | -s "Read from client: 16384 bytes read" |
| 1968 | |
| 1969 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 1970 | "$P_SRV" \ |
| 1971 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1972 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1973 | 0 \ |
| 1974 | -s "Read from client: 16384 bytes read" |
| 1975 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1976 | # Tests for DTLS HelloVerifyRequest |
| 1977 | |
| 1978 | run_test "DTLS cookie: enabled" \ |
| 1979 | "$P_SRV dtls=1 debug_level=2" \ |
| 1980 | "$P_CLI dtls=1 debug_level=2" \ |
| 1981 | 0 \ |
| 1982 | -s "cookie verification failed" \ |
| 1983 | -s "cookie verification passed" \ |
| 1984 | -S "cookie verification skipped" \ |
| 1985 | -c "received hello verify request" \ |
| 1986 | -S "SSL - The requested feature is not available" |
| 1987 | |
| 1988 | run_test "DTLS cookie: disabled" \ |
| 1989 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 1990 | "$P_CLI dtls=1 debug_level=2" \ |
| 1991 | 0 \ |
| 1992 | -S "cookie verification failed" \ |
| 1993 | -S "cookie verification passed" \ |
| 1994 | -s "cookie verification skipped" \ |
| 1995 | -C "received hello verify request" \ |
| 1996 | -S "SSL - The requested feature is not available" |
| 1997 | |
| 1998 | # wait for client having a timeout, or server sending an alert |
| 1999 | #run_test "DTLS cookie: default (failing)" \ |
| 2000 | # "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 2001 | # "$P_CLI dtls=1 debug_level=2" \ |
| 2002 | # 0 \ |
| 2003 | # -S "cookie verification failed" \ |
| 2004 | # -S "cookie verification passed" \ |
| 2005 | # -S "cookie verification skipped" \ |
| 2006 | # -C "received hello verify request" \ |
| 2007 | # -s "SSL - The requested feature is not available" |
| 2008 | |
| 2009 | requires_ipv6 |
| 2010 | run_test "DTLS cookie: enabled, IPv6" \ |
| 2011 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 2012 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 2013 | 0 \ |
| 2014 | -s "cookie verification failed" \ |
| 2015 | -s "cookie verification passed" \ |
| 2016 | -S "cookie verification skipped" \ |
| 2017 | -c "received hello verify request" \ |
| 2018 | -S "SSL - The requested feature is not available" |
| 2019 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 2020 | # Tests for receiving fragmented handshake messages with DTLS |
| 2021 | |
| 2022 | requires_gnutls |
| 2023 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 2024 | "$G_SRV -u --mtu 2048 -a" \ |
| 2025 | "$P_CLI dtls=1 debug_level=2" \ |
| 2026 | 0 \ |
| 2027 | -C "found fragmented DTLS handshake message" \ |
| 2028 | -C "error" |
| 2029 | |
| 2030 | requires_gnutls |
| 2031 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 2032 | "$G_SRV -u --mtu 512" \ |
| 2033 | "$P_CLI dtls=1 debug_level=2" \ |
| 2034 | 0 \ |
| 2035 | -c "found fragmented DTLS handshake message" \ |
| 2036 | -C "error" |
| 2037 | |
| 2038 | requires_gnutls |
| 2039 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 2040 | "$G_SRV -u --mtu 128" \ |
| 2041 | "$P_CLI dtls=1 debug_level=2" \ |
| 2042 | 0 \ |
| 2043 | -c "found fragmented DTLS handshake message" \ |
| 2044 | -C "error" |
| 2045 | |
| 2046 | requires_gnutls |
| 2047 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 2048 | "$G_SRV -u --mtu 128" \ |
| 2049 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2050 | 0 \ |
| 2051 | -c "found fragmented DTLS handshake message" \ |
| 2052 | -C "error" |
| 2053 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2054 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2055 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 2056 | "$G_SRV -u --mtu 256" \ |
| 2057 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2058 | 0 \ |
| 2059 | -c "found fragmented DTLS handshake message" \ |
| 2060 | -c "client hello, adding renegotiation extension" \ |
| 2061 | -c "found renegotiation extension" \ |
| 2062 | -c "=> renegotiate" \ |
| 2063 | -C "ssl_handshake returned" \ |
| 2064 | -C "error" \ |
| 2065 | -s "Extra-header:" |
| 2066 | |
| 2067 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2068 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 2069 | "$G_SRV -u --mtu 256" \ |
| 2070 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2071 | 0 \ |
| 2072 | -c "found fragmented DTLS handshake message" \ |
| 2073 | -c "client hello, adding renegotiation extension" \ |
| 2074 | -c "found renegotiation extension" \ |
| 2075 | -c "=> renegotiate" \ |
| 2076 | -C "ssl_handshake returned" \ |
| 2077 | -C "error" \ |
| 2078 | -s "Extra-header:" |
| 2079 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2080 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 2081 | "$O_SRV -dtls1 -mtu 2048" \ |
| 2082 | "$P_CLI dtls=1 debug_level=2" \ |
| 2083 | 0 \ |
| 2084 | -C "found fragmented DTLS handshake message" \ |
| 2085 | -C "error" |
| 2086 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2087 | run_test "DTLS reassembly: fragmentation (openssl server)" \ |
| 2088 | "$O_SRV -dtls1 -mtu 256" \ |
| 2089 | "$P_CLI dtls=1 debug_level=2" \ |
| 2090 | 0 \ |
| 2091 | -c "found fragmented DTLS handshake message" \ |
| 2092 | -C "error" |
| 2093 | |
| 2094 | run_test "DTLS reassembly: fragmentation (openssl server)" \ |
| 2095 | "$O_SRV -dtls1 -mtu 256" \ |
| 2096 | "$P_CLI dtls=1 debug_level=2" \ |
| 2097 | 0 \ |
| 2098 | -c "found fragmented DTLS handshake message" \ |
| 2099 | -C "error" |
| 2100 | |
| 2101 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 2102 | "$O_SRV -dtls1 -mtu 256" \ |
| 2103 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2104 | 0 \ |
| 2105 | -c "found fragmented DTLS handshake message" \ |
| 2106 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2107 | |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2108 | # Tests with UDP proxy emulating unreliable transport |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2109 | |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2110 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2111 | -p "$P_PXY" \ |
| 2112 | "$P_SRV dtls=1" \ |
| 2113 | "$P_CLI dtls=1" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2114 | 0 \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2115 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2116 | -c "HTTP/1.0 200 OK" |
| 2117 | |
| 2118 | run_test "DTLS proxy: some duplication" \ |
| 2119 | -p "$P_PXY duplicate=3" \ |
| 2120 | "$P_SRV dtls=1" \ |
| 2121 | "$P_CLI dtls=1" \ |
| 2122 | 0 \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2123 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2124 | -c "HTTP/1.0 200 OK" |
| 2125 | |
| 2126 | run_test "DTLS proxy: lots of duplication" \ |
| 2127 | -p "$P_PXY duplicate=1" \ |
| 2128 | "$P_SRV dtls=1" \ |
| 2129 | "$P_CLI dtls=1" \ |
| 2130 | 0 \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2131 | -s "Extra-header:" \ |
| 2132 | -c "HTTP/1.0 200 OK" |
| 2133 | |
| 2134 | run_test "DTLS proxy: inject invalid AD record" \ |
| 2135 | -p "$P_PXY bad_ad=1" \ |
| 2136 | "$P_SRV dtls=1" \ |
| 2137 | "$P_CLI dtls=1" \ |
| 2138 | 0 \ |
| 2139 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2140 | -c "HTTP/1.0 200 OK" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2141 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 2142 | run_test "DTLS proxy: drop a few packets" \ |
| 2143 | -p "$P_PXY drop=10" \ |
| 2144 | "$P_SRV dtls=1" \ |
| 2145 | "$P_CLI dtls=1" \ |
| 2146 | 0 \ |
| 2147 | -s "Extra-header:" \ |
| 2148 | -c "HTTP/1.0 200 OK" |
| 2149 | |
| 2150 | needs_more_time 2 |
| 2151 | run_test "DTLS proxy: drop a bit more packets" \ |
| 2152 | -p "$P_PXY drop=6" \ |
| 2153 | "$P_SRV dtls=1" \ |
| 2154 | "$P_CLI dtls=1" \ |
| 2155 | 0 \ |
| 2156 | -s "Extra-header:" \ |
| 2157 | -c "HTTP/1.0 200 OK" |
| 2158 | |
| 2159 | needs_more_time 3 |
| 2160 | run_test "DTLS proxy: drop more packets" \ |
| 2161 | -p "$P_PXY drop=3" \ |
| 2162 | "$P_SRV dtls=1" \ |
| 2163 | "$P_CLI dtls=1" \ |
| 2164 | 0 \ |
| 2165 | -s "Extra-header:" \ |
| 2166 | -c "HTTP/1.0 200 OK" |
| 2167 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2168 | # Final report |
| 2169 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2170 | echo "------------------------------------------------------------------------" |
| 2171 | |
| 2172 | if [ $FAILS = 0 ]; then |
| 2173 | echo -n "PASSED" |
| 2174 | else |
| 2175 | echo -n "FAILED" |
| 2176 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 2177 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2178 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2179 | |
| 2180 | exit $FAILS |