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