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 | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 396 | # Tests for rc4 option |
| 397 | |
| 398 | run_test "RC4: server disabled, client enabled" \ |
| 399 | "$P_SRV" \ |
| 400 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 401 | 1 \ |
| 402 | -s "SSL - The server has no ciphersuites in common" |
| 403 | |
| 404 | run_test "RC4: server enabled, client disabled" \ |
| 405 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 406 | "$P_CLI" \ |
| 407 | 1 \ |
| 408 | -s "SSL - The server has no ciphersuites in common" |
| 409 | |
| 410 | run_test "RC4: both enabled" \ |
| 411 | "$P_SRV arc4=1" \ |
| 412 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 413 | 0 \ |
| 414 | -S "SSL - The server has no ciphersuites in common" |
| 415 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 416 | # Test for SSLv2 ClientHello |
| 417 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 418 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 419 | run_test "SSLv2 ClientHello: reference" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 420 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 421 | "$O_CLI -no_ssl2" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 422 | 0 \ |
| 423 | -S "parse client hello v2" \ |
| 424 | -S "ssl_handshake returned" |
| 425 | |
| 426 | # 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] | 427 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 428 | run_test "SSLv2 ClientHello: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 429 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 430 | "$O_CLI -cipher 'DES-CBC-MD5:ALL'" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 431 | 0 \ |
| 432 | -s "parse client hello v2" \ |
| 433 | -S "ssl_handshake returned" |
| 434 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 435 | # Tests for Truncated HMAC extension |
| 436 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 437 | run_test "Truncated HMAC: reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 438 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 439 | "$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] | 440 | 0 \ |
| 441 | -s "dumping 'computed mac' (20 bytes)" |
| 442 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 443 | run_test "Truncated HMAC: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 444 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 445 | "$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] | 446 | 0 \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 447 | -s "dumping 'computed mac' (10 bytes)" |
| 448 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 449 | # Tests for Session Tickets |
| 450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 451 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 452 | "$P_SRV debug_level=3 tickets=1" \ |
| 453 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 454 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 455 | -c "client hello, adding session ticket extension" \ |
| 456 | -s "found session ticket extension" \ |
| 457 | -s "server hello, adding session ticket extension" \ |
| 458 | -c "found session_ticket extension" \ |
| 459 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 460 | -S "session successfully restored from cache" \ |
| 461 | -s "session successfully restored from ticket" \ |
| 462 | -s "a session has been resumed" \ |
| 463 | -c "a session has been resumed" |
| 464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 465 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 466 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 467 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 468 | 0 \ |
| 469 | -c "client hello, adding session ticket extension" \ |
| 470 | -s "found session ticket extension" \ |
| 471 | -s "server hello, adding session ticket extension" \ |
| 472 | -c "found session_ticket extension" \ |
| 473 | -c "parse new session ticket" \ |
| 474 | -S "session successfully restored from cache" \ |
| 475 | -s "session successfully restored from ticket" \ |
| 476 | -s "a session has been resumed" \ |
| 477 | -c "a session has been resumed" |
| 478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 479 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 480 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 481 | "$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] | 482 | 0 \ |
| 483 | -c "client hello, adding session ticket extension" \ |
| 484 | -s "found session ticket extension" \ |
| 485 | -s "server hello, adding session ticket extension" \ |
| 486 | -c "found session_ticket extension" \ |
| 487 | -c "parse new session ticket" \ |
| 488 | -S "session successfully restored from cache" \ |
| 489 | -S "session successfully restored from ticket" \ |
| 490 | -S "a session has been resumed" \ |
| 491 | -C "a session has been resumed" |
| 492 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 493 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 494 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 495 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 496 | 0 \ |
| 497 | -c "client hello, adding session ticket extension" \ |
| 498 | -c "found session_ticket extension" \ |
| 499 | -c "parse new session ticket" \ |
| 500 | -c "a session has been resumed" |
| 501 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 502 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 503 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 504 | "( $O_CLI -sess_out $SESSION; \ |
| 505 | $O_CLI -sess_in $SESSION; \ |
| 506 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 507 | 0 \ |
| 508 | -s "found session ticket extension" \ |
| 509 | -s "server hello, adding session ticket extension" \ |
| 510 | -S "session successfully restored from cache" \ |
| 511 | -s "session successfully restored from ticket" \ |
| 512 | -s "a session has been resumed" |
| 513 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 514 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 516 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 517 | "$P_SRV debug_level=3 tickets=0" \ |
| 518 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 519 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 520 | -c "client hello, adding session ticket extension" \ |
| 521 | -s "found session ticket extension" \ |
| 522 | -S "server hello, adding session ticket extension" \ |
| 523 | -C "found session_ticket extension" \ |
| 524 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 525 | -s "session successfully restored from cache" \ |
| 526 | -S "session successfully restored from ticket" \ |
| 527 | -s "a session has been resumed" \ |
| 528 | -c "a session has been resumed" |
| 529 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 530 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 531 | "$P_SRV debug_level=3 tickets=1" \ |
| 532 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 533 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 534 | -C "client hello, adding session ticket extension" \ |
| 535 | -S "found session ticket extension" \ |
| 536 | -S "server hello, adding session ticket extension" \ |
| 537 | -C "found session_ticket extension" \ |
| 538 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 539 | -s "session successfully restored from cache" \ |
| 540 | -S "session successfully restored from ticket" \ |
| 541 | -s "a session has been resumed" \ |
| 542 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 544 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 545 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 546 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 547 | 0 \ |
| 548 | -S "session successfully restored from cache" \ |
| 549 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 550 | -S "a session has been resumed" \ |
| 551 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 553 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 554 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 555 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 556 | 0 \ |
| 557 | -s "session successfully restored from cache" \ |
| 558 | -S "session successfully restored from ticket" \ |
| 559 | -s "a session has been resumed" \ |
| 560 | -c "a session has been resumed" |
| 561 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 562 | run_test "Session resume using cache: timemout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 563 | "$P_SRV debug_level=3 tickets=0" \ |
| 564 | "$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] | 565 | 0 \ |
| 566 | -s "session successfully restored from cache" \ |
| 567 | -S "session successfully restored from ticket" \ |
| 568 | -s "a session has been resumed" \ |
| 569 | -c "a session has been resumed" |
| 570 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 571 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 572 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 573 | "$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] | 574 | 0 \ |
| 575 | -S "session successfully restored from cache" \ |
| 576 | -S "session successfully restored from ticket" \ |
| 577 | -S "a session has been resumed" \ |
| 578 | -C "a session has been resumed" |
| 579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 580 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 581 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 582 | "$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] | 583 | 0 \ |
| 584 | -s "session successfully restored from cache" \ |
| 585 | -S "session successfully restored from ticket" \ |
| 586 | -s "a session has been resumed" \ |
| 587 | -c "a session has been resumed" |
| 588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 589 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 590 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 591 | "( $O_CLI -sess_out $SESSION; \ |
| 592 | $O_CLI -sess_in $SESSION; \ |
| 593 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 594 | 0 \ |
| 595 | -s "found session ticket extension" \ |
| 596 | -S "server hello, adding session ticket extension" \ |
| 597 | -s "session successfully restored from cache" \ |
| 598 | -S "session successfully restored from ticket" \ |
| 599 | -s "a session has been resumed" |
| 600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 601 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 602 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 603 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 604 | 0 \ |
| 605 | -C "found session_ticket extension" \ |
| 606 | -C "parse new session ticket" \ |
| 607 | -c "a session has been resumed" |
| 608 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 609 | # Tests for Max Fragment Length extension |
| 610 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 611 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 612 | "$P_SRV debug_level=3" \ |
| 613 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 614 | 0 \ |
| 615 | -C "client hello, adding max_fragment_length extension" \ |
| 616 | -S "found max fragment length extension" \ |
| 617 | -S "server hello, max_fragment_length extension" \ |
| 618 | -C "found max_fragment_length extension" |
| 619 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 620 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 621 | "$P_SRV debug_level=3" \ |
| 622 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 623 | 0 \ |
| 624 | -c "client hello, adding max_fragment_length extension" \ |
| 625 | -s "found max fragment length extension" \ |
| 626 | -s "server hello, max_fragment_length extension" \ |
| 627 | -c "found max_fragment_length extension" |
| 628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 629 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 630 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 631 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 632 | 0 \ |
| 633 | -C "client hello, adding max_fragment_length extension" \ |
| 634 | -S "found max fragment length extension" \ |
| 635 | -S "server hello, max_fragment_length extension" \ |
| 636 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 638 | requires_gnutls |
| 639 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 640 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 641 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 642 | 0 \ |
| 643 | -c "client hello, adding max_fragment_length extension" \ |
| 644 | -c "found max_fragment_length extension" |
| 645 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 646 | # Tests for renegotiation |
| 647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 648 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 649 | "$P_SRV debug_level=3 exchanges=2" \ |
| 650 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 651 | 0 \ |
| 652 | -C "client hello, adding renegotiation extension" \ |
| 653 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 654 | -S "found renegotiation extension" \ |
| 655 | -s "server hello, secure renegotiation extension" \ |
| 656 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 657 | -C "=> renegotiate" \ |
| 658 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 659 | -S "write hello request" |
| 660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 661 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 662 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1" \ |
| 663 | "$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] | 664 | 0 \ |
| 665 | -c "client hello, adding renegotiation extension" \ |
| 666 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 667 | -s "found renegotiation extension" \ |
| 668 | -s "server hello, secure renegotiation extension" \ |
| 669 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 670 | -c "=> renegotiate" \ |
| 671 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 672 | -S "write hello request" |
| 673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 674 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 675 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 676 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 677 | 0 \ |
| 678 | -c "client hello, adding renegotiation extension" \ |
| 679 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 680 | -s "found renegotiation extension" \ |
| 681 | -s "server hello, secure renegotiation extension" \ |
| 682 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 683 | -c "=> renegotiate" \ |
| 684 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 685 | -s "write hello request" |
| 686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 687 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 688 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 689 | "$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] | 690 | 0 \ |
| 691 | -c "client hello, adding renegotiation extension" \ |
| 692 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 693 | -s "found renegotiation extension" \ |
| 694 | -s "server hello, secure renegotiation extension" \ |
| 695 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 696 | -c "=> renegotiate" \ |
| 697 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 698 | -s "write hello request" |
| 699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 700 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 701 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0" \ |
| 702 | "$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] | 703 | 1 \ |
| 704 | -c "client hello, adding renegotiation extension" \ |
| 705 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 706 | -S "found renegotiation extension" \ |
| 707 | -s "server hello, secure renegotiation extension" \ |
| 708 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 709 | -c "=> renegotiate" \ |
| 710 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 711 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 712 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 713 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 715 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 716 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 717 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 718 | 0 \ |
| 719 | -C "client hello, adding renegotiation extension" \ |
| 720 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 721 | -S "found renegotiation extension" \ |
| 722 | -s "server hello, secure renegotiation extension" \ |
| 723 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 724 | -C "=> renegotiate" \ |
| 725 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 726 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 727 | -S "SSL - An unexpected message was received from our peer" \ |
| 728 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 729 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 730 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 731 | "$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] | 732 | renego_delay=-1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 733 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 734 | 0 \ |
| 735 | -C "client hello, adding renegotiation extension" \ |
| 736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 737 | -S "found renegotiation extension" \ |
| 738 | -s "server hello, secure renegotiation extension" \ |
| 739 | -c "found renegotiation extension" \ |
| 740 | -C "=> renegotiate" \ |
| 741 | -S "=> renegotiate" \ |
| 742 | -s "write hello request" \ |
| 743 | -S "SSL - An unexpected message was received from our peer" \ |
| 744 | -S "failed" |
| 745 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 746 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 747 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 748 | "$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] | 749 | renego_delay=2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 750 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 751 | 0 \ |
| 752 | -C "client hello, adding renegotiation extension" \ |
| 753 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 754 | -S "found renegotiation extension" \ |
| 755 | -s "server hello, secure renegotiation extension" \ |
| 756 | -c "found renegotiation extension" \ |
| 757 | -C "=> renegotiate" \ |
| 758 | -S "=> renegotiate" \ |
| 759 | -s "write hello request" \ |
| 760 | -S "SSL - An unexpected message was received from our peer" \ |
| 761 | -S "failed" |
| 762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 763 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 764 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 765 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 766 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 767 | 0 \ |
| 768 | -C "client hello, adding renegotiation extension" \ |
| 769 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 770 | -S "found renegotiation extension" \ |
| 771 | -s "server hello, secure renegotiation extension" \ |
| 772 | -c "found renegotiation extension" \ |
| 773 | -C "=> renegotiate" \ |
| 774 | -S "=> renegotiate" \ |
| 775 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 776 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 777 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 778 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 779 | "$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] | 780 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 781 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 782 | 0 \ |
| 783 | -c "client hello, adding renegotiation extension" \ |
| 784 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 785 | -s "found renegotiation extension" \ |
| 786 | -s "server hello, secure renegotiation extension" \ |
| 787 | -c "found renegotiation extension" \ |
| 788 | -c "=> renegotiate" \ |
| 789 | -s "=> renegotiate" \ |
| 790 | -s "write hello request" \ |
| 791 | -S "SSL - An unexpected message was received from our peer" \ |
| 792 | -S "failed" |
| 793 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 794 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 795 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
| 796 | "$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] | 797 | 0 \ |
| 798 | -c "client hello, adding renegotiation extension" \ |
| 799 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 800 | -s "found renegotiation extension" \ |
| 801 | -s "server hello, secure renegotiation extension" \ |
| 802 | -c "found renegotiation extension" \ |
| 803 | -c "=> renegotiate" \ |
| 804 | -s "=> renegotiate" \ |
| 805 | -S "write hello request" |
| 806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 807 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 808 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 809 | "$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] | 810 | 0 \ |
| 811 | -c "client hello, adding renegotiation extension" \ |
| 812 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 813 | -s "found renegotiation extension" \ |
| 814 | -s "server hello, secure renegotiation extension" \ |
| 815 | -c "found renegotiation extension" \ |
| 816 | -c "=> renegotiate" \ |
| 817 | -s "=> renegotiate" \ |
| 818 | -s "write hello request" |
| 819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 820 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 821 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 822 | "$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] | 823 | 0 \ |
| 824 | -c "client hello, adding renegotiation extension" \ |
| 825 | -c "found renegotiation extension" \ |
| 826 | -c "=> renegotiate" \ |
| 827 | -C "ssl_handshake returned" \ |
| 828 | -C "error" \ |
| 829 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 830 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 831 | run_test "Renegotiation: gnutls server, client-initiated" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 832 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 833 | "$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] | 834 | 0 \ |
| 835 | -c "client hello, adding renegotiation extension" \ |
| 836 | -c "found renegotiation extension" \ |
| 837 | -c "=> renegotiate" \ |
| 838 | -C "ssl_handshake returned" \ |
| 839 | -C "error" \ |
| 840 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 841 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 842 | # Tests for auth_mode |
| 843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 844 | run_test "Authentication: server badcert, client required" \ |
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=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 848 | 1 \ |
| 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: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 855 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 856 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 857 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 858 | 0 \ |
| 859 | -c "x509_verify_cert() returned" \ |
| 860 | -c "! self-signed or not signed by a trusted CA" \ |
| 861 | -C "! ssl_handshake returned" \ |
| 862 | -C "X509 - Certificate verification failed" |
| 863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 864 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 865 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 866 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 867 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 868 | 0 \ |
| 869 | -C "x509_verify_cert() returned" \ |
| 870 | -C "! self-signed or not signed by a trusted CA" \ |
| 871 | -C "! ssl_handshake returned" \ |
| 872 | -C "X509 - Certificate verification failed" |
| 873 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 874 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 875 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 876 | "$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] | 877 | key_file=data_files/server5.key" \ |
| 878 | 1 \ |
| 879 | -S "skip write certificate request" \ |
| 880 | -C "skip parse certificate request" \ |
| 881 | -c "got a certificate request" \ |
| 882 | -C "skip write certificate" \ |
| 883 | -C "skip write certificate verify" \ |
| 884 | -S "skip parse certificate verify" \ |
| 885 | -s "x509_verify_cert() returned" \ |
| 886 | -S "! self-signed or not signed by a trusted CA" \ |
| 887 | -s "! ssl_handshake returned" \ |
| 888 | -c "! ssl_handshake returned" \ |
| 889 | -s "X509 - Certificate verification failed" |
| 890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 891 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 892 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 893 | "$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] | 894 | key_file=data_files/server5.key" \ |
| 895 | 0 \ |
| 896 | -S "skip write certificate request" \ |
| 897 | -C "skip parse certificate request" \ |
| 898 | -c "got a certificate request" \ |
| 899 | -C "skip write certificate" \ |
| 900 | -C "skip write certificate verify" \ |
| 901 | -S "skip parse certificate verify" \ |
| 902 | -s "x509_verify_cert() returned" \ |
| 903 | -s "! self-signed or not signed by a trusted CA" \ |
| 904 | -S "! ssl_handshake returned" \ |
| 905 | -C "! ssl_handshake returned" \ |
| 906 | -S "X509 - Certificate verification failed" |
| 907 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 908 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 909 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 910 | "$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] | 911 | key_file=data_files/server5.key" \ |
| 912 | 0 \ |
| 913 | -s "skip write certificate request" \ |
| 914 | -C "skip parse certificate request" \ |
| 915 | -c "got no certificate request" \ |
| 916 | -c "skip write certificate" \ |
| 917 | -c "skip write certificate verify" \ |
| 918 | -s "skip parse certificate verify" \ |
| 919 | -S "x509_verify_cert() returned" \ |
| 920 | -S "! self-signed or not signed by a trusted CA" \ |
| 921 | -S "! ssl_handshake returned" \ |
| 922 | -C "! ssl_handshake returned" \ |
| 923 | -S "X509 - Certificate verification failed" |
| 924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 925 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 926 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 927 | "$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] | 928 | 0 \ |
| 929 | -S "skip write certificate request" \ |
| 930 | -C "skip parse certificate request" \ |
| 931 | -c "got a certificate request" \ |
| 932 | -C "skip write certificate$" \ |
| 933 | -C "got no certificate to send" \ |
| 934 | -S "SSLv3 client has no certificate" \ |
| 935 | -c "skip write certificate verify" \ |
| 936 | -s "skip parse certificate verify" \ |
| 937 | -s "! no client certificate sent" \ |
| 938 | -S "! ssl_handshake returned" \ |
| 939 | -C "! ssl_handshake returned" \ |
| 940 | -S "X509 - Certificate verification failed" |
| 941 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 942 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 943 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 944 | "$O_CLI" \ |
| 945 | 0 \ |
| 946 | -S "skip write certificate request" \ |
| 947 | -s "skip parse certificate verify" \ |
| 948 | -s "! no client certificate sent" \ |
| 949 | -S "! ssl_handshake returned" \ |
| 950 | -S "X509 - Certificate verification failed" |
| 951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 952 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 953 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 954 | "$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] | 955 | 0 \ |
| 956 | -C "skip parse certificate request" \ |
| 957 | -c "got a certificate request" \ |
| 958 | -C "skip write certificate$" \ |
| 959 | -c "skip write certificate verify" \ |
| 960 | -C "! ssl_handshake returned" |
| 961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 962 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 963 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 964 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 965 | 0 \ |
| 966 | -S "skip write certificate request" \ |
| 967 | -C "skip parse certificate request" \ |
| 968 | -c "got a certificate request" \ |
| 969 | -C "skip write certificate$" \ |
| 970 | -c "skip write certificate verify" \ |
| 971 | -c "got no certificate to send" \ |
| 972 | -s "SSLv3 client has no certificate" \ |
| 973 | -s "skip parse certificate verify" \ |
| 974 | -s "! no client certificate sent" \ |
| 975 | -S "! ssl_handshake returned" \ |
| 976 | -C "! ssl_handshake returned" \ |
| 977 | -S "X509 - Certificate verification failed" |
| 978 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 979 | # tests for SNI |
| 980 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 981 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 982 | "$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] | 983 | 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] | 984 | "$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] | 985 | server_name=localhost" \ |
| 986 | 0 \ |
| 987 | -S "parse ServerName extension" \ |
| 988 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 989 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 991 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 992 | "$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] | 993 | 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] | 994 | 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] | 995 | "$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] | 996 | server_name=localhost" \ |
| 997 | 0 \ |
| 998 | -s "parse ServerName extension" \ |
| 999 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1000 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1001 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1002 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1003 | "$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] | 1004 | 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] | 1005 | 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] | 1006 | "$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] | 1007 | server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1008 | 0 \ |
| 1009 | -s "parse ServerName extension" \ |
| 1010 | -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] | 1011 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1012 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1013 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1014 | "$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] | 1015 | 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] | 1016 | 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] | 1017 | "$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] | 1018 | server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1019 | 1 \ |
| 1020 | -s "parse ServerName extension" \ |
| 1021 | -s "ssl_sni_wrapper() returned" \ |
| 1022 | -s "ssl_handshake returned" \ |
| 1023 | -c "ssl_handshake returned" \ |
| 1024 | -c "SSL - A fatal alert message was received from our peer" |
| 1025 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1026 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1028 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1029 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1030 | "$P_CLI nbio=2 tickets=0" \ |
| 1031 | 0 \ |
| 1032 | -S "ssl_handshake returned" \ |
| 1033 | -C "ssl_handshake returned" \ |
| 1034 | -c "Read from server: .* bytes read" |
| 1035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1036 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1037 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1038 | "$P_CLI nbio=2 tickets=0" \ |
| 1039 | 0 \ |
| 1040 | -S "ssl_handshake returned" \ |
| 1041 | -C "ssl_handshake returned" \ |
| 1042 | -c "Read from server: .* bytes read" |
| 1043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1044 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1045 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1046 | "$P_CLI nbio=2 tickets=1" \ |
| 1047 | 0 \ |
| 1048 | -S "ssl_handshake returned" \ |
| 1049 | -C "ssl_handshake returned" \ |
| 1050 | -c "Read from server: .* bytes read" |
| 1051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1052 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1053 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1054 | "$P_CLI nbio=2 tickets=1" \ |
| 1055 | 0 \ |
| 1056 | -S "ssl_handshake returned" \ |
| 1057 | -C "ssl_handshake returned" \ |
| 1058 | -c "Read from server: .* bytes read" |
| 1059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1060 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1061 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1062 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1063 | 0 \ |
| 1064 | -S "ssl_handshake returned" \ |
| 1065 | -C "ssl_handshake returned" \ |
| 1066 | -c "Read from server: .* bytes read" |
| 1067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1068 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1069 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1070 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1071 | 0 \ |
| 1072 | -S "ssl_handshake returned" \ |
| 1073 | -C "ssl_handshake returned" \ |
| 1074 | -c "Read from server: .* bytes read" |
| 1075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1076 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1077 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1078 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1079 | 0 \ |
| 1080 | -S "ssl_handshake returned" \ |
| 1081 | -C "ssl_handshake returned" \ |
| 1082 | -c "Read from server: .* bytes read" |
| 1083 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1084 | # Tests for version negotiation |
| 1085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1086 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1087 | "$P_SRV" \ |
| 1088 | "$P_CLI" \ |
| 1089 | 0 \ |
| 1090 | -S "ssl_handshake returned" \ |
| 1091 | -C "ssl_handshake returned" \ |
| 1092 | -s "Protocol is TLSv1.2" \ |
| 1093 | -c "Protocol is TLSv1.2" |
| 1094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1095 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1096 | "$P_SRV" \ |
| 1097 | "$P_CLI max_version=tls1_1" \ |
| 1098 | 0 \ |
| 1099 | -S "ssl_handshake returned" \ |
| 1100 | -C "ssl_handshake returned" \ |
| 1101 | -s "Protocol is TLSv1.1" \ |
| 1102 | -c "Protocol is TLSv1.1" |
| 1103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1104 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1105 | "$P_SRV max_version=tls1_1" \ |
| 1106 | "$P_CLI" \ |
| 1107 | 0 \ |
| 1108 | -S "ssl_handshake returned" \ |
| 1109 | -C "ssl_handshake returned" \ |
| 1110 | -s "Protocol is TLSv1.1" \ |
| 1111 | -c "Protocol is TLSv1.1" |
| 1112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1113 | 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] | 1114 | "$P_SRV max_version=tls1_1" \ |
| 1115 | "$P_CLI max_version=tls1_1" \ |
| 1116 | 0 \ |
| 1117 | -S "ssl_handshake returned" \ |
| 1118 | -C "ssl_handshake returned" \ |
| 1119 | -s "Protocol is TLSv1.1" \ |
| 1120 | -c "Protocol is TLSv1.1" |
| 1121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1122 | 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] | 1123 | "$P_SRV min_version=tls1_1" \ |
| 1124 | "$P_CLI max_version=tls1_1" \ |
| 1125 | 0 \ |
| 1126 | -S "ssl_handshake returned" \ |
| 1127 | -C "ssl_handshake returned" \ |
| 1128 | -s "Protocol is TLSv1.1" \ |
| 1129 | -c "Protocol is TLSv1.1" |
| 1130 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1131 | 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] | 1132 | "$P_SRV max_version=tls1_1" \ |
| 1133 | "$P_CLI min_version=tls1_1" \ |
| 1134 | 0 \ |
| 1135 | -S "ssl_handshake returned" \ |
| 1136 | -C "ssl_handshake returned" \ |
| 1137 | -s "Protocol is TLSv1.1" \ |
| 1138 | -c "Protocol is TLSv1.1" |
| 1139 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1140 | 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] | 1141 | "$P_SRV max_version=tls1_1" \ |
| 1142 | "$P_CLI min_version=tls1_2" \ |
| 1143 | 1 \ |
| 1144 | -s "ssl_handshake returned" \ |
| 1145 | -c "ssl_handshake returned" \ |
| 1146 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1148 | 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] | 1149 | "$P_SRV min_version=tls1_2" \ |
| 1150 | "$P_CLI max_version=tls1_1" \ |
| 1151 | 1 \ |
| 1152 | -s "ssl_handshake returned" \ |
| 1153 | -c "ssl_handshake returned" \ |
| 1154 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1155 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1156 | # Tests for ALPN extension |
| 1157 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1158 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1160 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1161 | "$P_SRV debug_level=3" \ |
| 1162 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1163 | 0 \ |
| 1164 | -C "client hello, adding alpn extension" \ |
| 1165 | -S "found alpn extension" \ |
| 1166 | -C "got an alert message, type: \\[2:120]" \ |
| 1167 | -S "server hello, adding alpn extension" \ |
| 1168 | -C "found alpn extension " \ |
| 1169 | -C "Application Layer Protocol is" \ |
| 1170 | -S "Application Layer Protocol is" |
| 1171 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1172 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1173 | "$P_SRV debug_level=3" \ |
| 1174 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1175 | 0 \ |
| 1176 | -c "client hello, adding alpn extension" \ |
| 1177 | -s "found alpn extension" \ |
| 1178 | -C "got an alert message, type: \\[2:120]" \ |
| 1179 | -S "server hello, adding alpn extension" \ |
| 1180 | -C "found alpn extension " \ |
| 1181 | -c "Application Layer Protocol is (none)" \ |
| 1182 | -S "Application Layer Protocol is" |
| 1183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1184 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1185 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1186 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1187 | 0 \ |
| 1188 | -C "client hello, adding alpn extension" \ |
| 1189 | -S "found alpn extension" \ |
| 1190 | -C "got an alert message, type: \\[2:120]" \ |
| 1191 | -S "server hello, adding alpn extension" \ |
| 1192 | -C "found alpn extension " \ |
| 1193 | -C "Application Layer Protocol is" \ |
| 1194 | -s "Application Layer Protocol is (none)" |
| 1195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1196 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1197 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1198 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1199 | 0 \ |
| 1200 | -c "client hello, adding alpn extension" \ |
| 1201 | -s "found alpn extension" \ |
| 1202 | -C "got an alert message, type: \\[2:120]" \ |
| 1203 | -s "server hello, adding alpn extension" \ |
| 1204 | -c "found alpn extension" \ |
| 1205 | -c "Application Layer Protocol is abc" \ |
| 1206 | -s "Application Layer Protocol is abc" |
| 1207 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1208 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1209 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1210 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1211 | 0 \ |
| 1212 | -c "client hello, adding alpn extension" \ |
| 1213 | -s "found alpn extension" \ |
| 1214 | -C "got an alert message, type: \\[2:120]" \ |
| 1215 | -s "server hello, adding alpn extension" \ |
| 1216 | -c "found alpn extension" \ |
| 1217 | -c "Application Layer Protocol is abc" \ |
| 1218 | -s "Application Layer Protocol is abc" |
| 1219 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1220 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1221 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1222 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1223 | 0 \ |
| 1224 | -c "client hello, adding alpn extension" \ |
| 1225 | -s "found alpn extension" \ |
| 1226 | -C "got an alert message, type: \\[2:120]" \ |
| 1227 | -s "server hello, adding alpn extension" \ |
| 1228 | -c "found alpn extension" \ |
| 1229 | -c "Application Layer Protocol is 1234" \ |
| 1230 | -s "Application Layer Protocol is 1234" |
| 1231 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1232 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1233 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1234 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1235 | 1 \ |
| 1236 | -c "client hello, adding alpn extension" \ |
| 1237 | -s "found alpn extension" \ |
| 1238 | -c "got an alert message, type: \\[2:120]" \ |
| 1239 | -S "server hello, adding alpn extension" \ |
| 1240 | -C "found alpn extension" \ |
| 1241 | -C "Application Layer Protocol is 1234" \ |
| 1242 | -S "Application Layer Protocol is 1234" |
| 1243 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1244 | fi |
| 1245 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1246 | # Tests for keyUsage in leaf certificates, part 1: |
| 1247 | # server-side certificate/suite selection |
| 1248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1249 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1250 | "$P_SRV key_file=data_files/server2.key \ |
| 1251 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1252 | "$P_CLI" \ |
| 1253 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1254 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1255 | |
| 1256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1257 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1258 | "$P_SRV key_file=data_files/server2.key \ |
| 1259 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1260 | "$P_CLI" \ |
| 1261 | 0 \ |
| 1262 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1263 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1264 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1265 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1266 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1267 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1268 | 1 \ |
| 1269 | -C "Ciphersuite is " |
| 1270 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1271 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1272 | "$P_SRV key_file=data_files/server5.key \ |
| 1273 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1274 | "$P_CLI" \ |
| 1275 | 0 \ |
| 1276 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1277 | |
| 1278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1279 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1280 | "$P_SRV key_file=data_files/server5.key \ |
| 1281 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1282 | "$P_CLI" \ |
| 1283 | 0 \ |
| 1284 | -c "Ciphersuite is TLS-ECDH-" |
| 1285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1286 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1287 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1288 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1289 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1290 | 1 \ |
| 1291 | -C "Ciphersuite is " |
| 1292 | |
| 1293 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1294 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1296 | run_test "keyUsage cli: DigitalSignature+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-ds_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: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
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-ds_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 | 0 \ |
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: KeyEncipherment, 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-ke.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-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: KeyEncipherment, DHE-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-ke.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-DHE-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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1336 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1337 | "$O_SRV -key data_files/server2.key \ |
| 1338 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1339 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1340 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1341 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1342 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1343 | -C "Processing of the Certificate handshake message failed" \ |
| 1344 | -c "Ciphersuite is TLS-" |
| 1345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1346 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1347 | "$O_SRV -key data_files/server2.key \ |
| 1348 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1349 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1350 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1351 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1352 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1353 | -c "Processing of the Certificate handshake message failed" \ |
| 1354 | -C "Ciphersuite is TLS-" |
| 1355 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1356 | # Tests for keyUsage in leaf certificates, part 3: |
| 1357 | # server-side checking of client cert |
| 1358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1359 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1360 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1361 | "$O_CLI -key data_files/server2.key \ |
| 1362 | -cert data_files/server2.ku-ds.crt" \ |
| 1363 | 0 \ |
| 1364 | -S "bad certificate (usage extensions)" \ |
| 1365 | -S "Processing of the Certificate handshake message failed" |
| 1366 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1367 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1368 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1369 | "$O_CLI -key data_files/server2.key \ |
| 1370 | -cert data_files/server2.ku-ke.crt" \ |
| 1371 | 0 \ |
| 1372 | -s "bad certificate (usage extensions)" \ |
| 1373 | -S "Processing of the Certificate handshake message failed" |
| 1374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1375 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1376 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1377 | "$O_CLI -key data_files/server2.key \ |
| 1378 | -cert data_files/server2.ku-ke.crt" \ |
| 1379 | 1 \ |
| 1380 | -s "bad certificate (usage extensions)" \ |
| 1381 | -s "Processing of the Certificate handshake message failed" |
| 1382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1383 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1384 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1385 | "$O_CLI -key data_files/server5.key \ |
| 1386 | -cert data_files/server5.ku-ds.crt" \ |
| 1387 | 0 \ |
| 1388 | -S "bad certificate (usage extensions)" \ |
| 1389 | -S "Processing of the Certificate handshake message failed" |
| 1390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1391 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1392 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1393 | "$O_CLI -key data_files/server5.key \ |
| 1394 | -cert data_files/server5.ku-ka.crt" \ |
| 1395 | 0 \ |
| 1396 | -s "bad certificate (usage extensions)" \ |
| 1397 | -S "Processing of the Certificate handshake message failed" |
| 1398 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1399 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1401 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1402 | "$P_SRV key_file=data_files/server5.key \ |
| 1403 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1404 | "$P_CLI" \ |
| 1405 | 0 |
| 1406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1407 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1408 | "$P_SRV key_file=data_files/server5.key \ |
| 1409 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1410 | "$P_CLI" \ |
| 1411 | 0 |
| 1412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1413 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1414 | "$P_SRV key_file=data_files/server5.key \ |
| 1415 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1416 | "$P_CLI" \ |
| 1417 | 0 |
| 1418 | |
| 1419 | # 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] | 1420 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1421 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1422 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1423 | "$P_CLI psk=badbad" \ |
| 1424 | 1 |
| 1425 | |
| 1426 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1428 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1429 | "$O_SRV -key data_files/server5.key \ |
| 1430 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1431 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1432 | 0 \ |
| 1433 | -C "bad certificate (usage extensions)" \ |
| 1434 | -C "Processing of the Certificate handshake message failed" \ |
| 1435 | -c "Ciphersuite is TLS-" |
| 1436 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1437 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1438 | "$O_SRV -key data_files/server5.key \ |
| 1439 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1440 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1441 | 0 \ |
| 1442 | -C "bad certificate (usage extensions)" \ |
| 1443 | -C "Processing of the Certificate handshake message failed" \ |
| 1444 | -c "Ciphersuite is TLS-" |
| 1445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1446 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1447 | "$O_SRV -key data_files/server5.key \ |
| 1448 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1449 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1450 | 0 \ |
| 1451 | -C "bad certificate (usage extensions)" \ |
| 1452 | -C "Processing of the Certificate handshake message failed" \ |
| 1453 | -c "Ciphersuite is TLS-" |
| 1454 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1455 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1456 | "$O_SRV -key data_files/server5.key \ |
| 1457 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1458 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1459 | 1 \ |
| 1460 | -c "bad certificate (usage extensions)" \ |
| 1461 | -c "Processing of the Certificate handshake message failed" \ |
| 1462 | -C "Ciphersuite is TLS-" |
| 1463 | |
| 1464 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 1465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1466 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1467 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1468 | "$O_CLI -key data_files/server5.key \ |
| 1469 | -cert data_files/server5.eku-cli.crt" \ |
| 1470 | 0 \ |
| 1471 | -S "bad certificate (usage extensions)" \ |
| 1472 | -S "Processing of the Certificate handshake message failed" |
| 1473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1474 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1475 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1476 | "$O_CLI -key data_files/server5.key \ |
| 1477 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 1478 | 0 \ |
| 1479 | -S "bad certificate (usage extensions)" \ |
| 1480 | -S "Processing of the Certificate handshake message failed" |
| 1481 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1482 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1483 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1484 | "$O_CLI -key data_files/server5.key \ |
| 1485 | -cert data_files/server5.eku-cs_any.crt" \ |
| 1486 | 0 \ |
| 1487 | -S "bad certificate (usage extensions)" \ |
| 1488 | -S "Processing of the Certificate handshake message failed" |
| 1489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1490 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1491 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1492 | "$O_CLI -key data_files/server5.key \ |
| 1493 | -cert data_files/server5.eku-cs.crt" \ |
| 1494 | 0 \ |
| 1495 | -s "bad certificate (usage extensions)" \ |
| 1496 | -S "Processing of the Certificate handshake message failed" |
| 1497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1498 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1499 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1500 | "$O_CLI -key data_files/server5.key \ |
| 1501 | -cert data_files/server5.eku-cs.crt" \ |
| 1502 | 1 \ |
| 1503 | -s "bad certificate (usage extensions)" \ |
| 1504 | -s "Processing of the Certificate handshake message failed" |
| 1505 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1506 | # Tests for DHM parameters loading |
| 1507 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1508 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1509 | "$P_SRV" \ |
| 1510 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1511 | debug_level=3" \ |
| 1512 | 0 \ |
| 1513 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 1514 | -c "value of 'DHM: G ' (2048 bits)" |
| 1515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1516 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1517 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 1518 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1519 | debug_level=3" \ |
| 1520 | 0 \ |
| 1521 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 1522 | -c "value of 'DHM: G ' (2 bits)" |
| 1523 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1524 | # Tests for PSK callback |
| 1525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1526 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1527 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 1528 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1529 | psk_identity=foo psk=abc123" \ |
| 1530 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1531 | -S "SSL - The server has no ciphersuites in common" \ |
| 1532 | -S "SSL - Unknown identity received" \ |
| 1533 | -S "SSL - Verification of the message MAC failed" |
| 1534 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1535 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1536 | "$P_SRV" \ |
| 1537 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1538 | psk_identity=foo psk=abc123" \ |
| 1539 | 1 \ |
| 1540 | -s "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1541 | -S "SSL - Unknown identity received" \ |
| 1542 | -S "SSL - Verification of the message MAC failed" |
| 1543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1544 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1545 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 1546 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1547 | psk_identity=foo psk=abc123" \ |
| 1548 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1549 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1550 | -s "SSL - Unknown identity received" \ |
| 1551 | -S "SSL - Verification of the message MAC failed" |
| 1552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1553 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1554 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1555 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1556 | psk_identity=abc psk=dead" \ |
| 1557 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1558 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1559 | -S "SSL - Unknown identity received" \ |
| 1560 | -S "SSL - Verification of the message MAC failed" |
| 1561 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1562 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1563 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1564 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1565 | psk_identity=def psk=beef" \ |
| 1566 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1567 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1568 | -S "SSL - Unknown identity received" \ |
| 1569 | -S "SSL - Verification of the message MAC failed" |
| 1570 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1571 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1572 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1573 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1574 | psk_identity=ghi psk=beef" \ |
| 1575 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1576 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1577 | -s "SSL - Unknown identity received" \ |
| 1578 | -S "SSL - Verification of the message MAC failed" |
| 1579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1580 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1581 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1582 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1583 | psk_identity=abc psk=beef" \ |
| 1584 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1585 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1586 | -S "SSL - Unknown identity received" \ |
| 1587 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1588 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1589 | # Tests for ciphersuites per version |
| 1590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1591 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 1592 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-RC4-128-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1593 | "$P_CLI force_version=ssl3" \ |
| 1594 | 0 \ |
| 1595 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 1596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1597 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1598 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-RC4-128-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1599 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1600 | 0 \ |
| 1601 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 1602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1603 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1604 | "$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" \ |
| 1605 | "$P_CLI force_version=tls1_1" \ |
| 1606 | 0 \ |
| 1607 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 1608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1609 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1610 | "$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" \ |
| 1611 | "$P_CLI force_version=tls1_2" \ |
| 1612 | 0 \ |
| 1613 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 1614 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1615 | # Tests for ssl_get_bytes_avail() |
| 1616 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1617 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1618 | "$P_SRV" \ |
| 1619 | "$P_CLI request_size=100" \ |
| 1620 | 0 \ |
| 1621 | -s "Read from client: 100 bytes read$" |
| 1622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1623 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1624 | "$P_SRV" \ |
| 1625 | "$P_CLI request_size=500" \ |
| 1626 | 0 \ |
| 1627 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1628 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1629 | # Tests for small packets |
| 1630 | |
| 1631 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 1632 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1633 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1634 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1635 | 0 \ |
| 1636 | -s "Read from client: 1 bytes read" |
| 1637 | |
| 1638 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1639 | "$P_SRV min_version=ssl3 arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1640 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1641 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1642 | 0 \ |
| 1643 | -s "Read from client: 1 bytes read" |
| 1644 | |
| 1645 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 1646 | "$P_SRV" \ |
| 1647 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1648 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1649 | 0 \ |
| 1650 | -s "Read from client: 1 bytes read" |
| 1651 | |
| 1652 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1653 | "$P_SRV" \ |
| 1654 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1655 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1656 | trunc_hmac=1" \ |
| 1657 | 0 \ |
| 1658 | -s "Read from client: 1 bytes read" |
| 1659 | |
| 1660 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1661 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1662 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1663 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1664 | trunc_hmac=1" \ |
| 1665 | 0 \ |
| 1666 | -s "Read from client: 1 bytes read" |
| 1667 | |
| 1668 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 1669 | "$P_SRV" \ |
| 1670 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1671 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1672 | 0 \ |
| 1673 | -s "Read from client: 1 bytes read" |
| 1674 | |
| 1675 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1676 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1677 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1678 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1679 | 0 \ |
| 1680 | -s "Read from client: 1 bytes read" |
| 1681 | |
| 1682 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1683 | "$P_SRV" \ |
| 1684 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1685 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1686 | trunc_hmac=1" \ |
| 1687 | 0 \ |
| 1688 | -s "Read from client: 1 bytes read" |
| 1689 | |
| 1690 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1691 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1692 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1693 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1694 | trunc_hmac=1" \ |
| 1695 | 0 \ |
| 1696 | -s "Read from client: 1 bytes read" |
| 1697 | |
| 1698 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 1699 | "$P_SRV" \ |
| 1700 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1701 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1702 | 0 \ |
| 1703 | -s "Read from client: 1 bytes read" |
| 1704 | |
| 1705 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 1706 | "$P_SRV" \ |
| 1707 | "$P_CLI request_size=1 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1708 | 0 \ |
| 1709 | -s "Read from client: 1 bytes read" |
| 1710 | |
| 1711 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1712 | "$P_SRV" \ |
| 1713 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1715 | trunc_hmac=1" \ |
| 1716 | 0 \ |
| 1717 | -s "Read from client: 1 bytes read" |
| 1718 | |
| 1719 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1720 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1721 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1722 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1723 | 0 \ |
| 1724 | -s "Read from client: 1 bytes read" |
| 1725 | |
| 1726 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1727 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1728 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1729 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1730 | trunc_hmac=1" \ |
| 1731 | 0 \ |
| 1732 | -s "Read from client: 1 bytes read" |
| 1733 | |
| 1734 | run_test "Small packet TLS 1.2 AEAD" \ |
| 1735 | "$P_SRV" \ |
| 1736 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1737 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1738 | 0 \ |
| 1739 | -s "Read from client: 1 bytes read" |
| 1740 | |
| 1741 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 1742 | "$P_SRV" \ |
| 1743 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1745 | 0 \ |
| 1746 | -s "Read from client: 1 bytes read" |
| 1747 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1748 | # Test for large packets |
| 1749 | |
| 1750 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 1751 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1752 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1753 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1754 | 0 \ |
| 1755 | -s "Read from client: 16384 bytes read" |
| 1756 | |
| 1757 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1758 | "$P_SRV min_version=ssl3 arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1759 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1760 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1761 | 0 \ |
| 1762 | -s "Read from client: 16384 bytes read" |
| 1763 | |
| 1764 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 1765 | "$P_SRV" \ |
| 1766 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1767 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1768 | 0 \ |
| 1769 | -s "Read from client: 16384 bytes read" |
| 1770 | |
| 1771 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1772 | "$P_SRV" \ |
| 1773 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1774 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1775 | trunc_hmac=1" \ |
| 1776 | 0 \ |
| 1777 | -s "Read from client: 16384 bytes read" |
| 1778 | |
| 1779 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1780 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1781 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1782 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1783 | trunc_hmac=1" \ |
| 1784 | 0 \ |
| 1785 | -s "Read from client: 16384 bytes read" |
| 1786 | |
| 1787 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 1788 | "$P_SRV" \ |
| 1789 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1790 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1791 | 0 \ |
| 1792 | -s "Read from client: 16384 bytes read" |
| 1793 | |
| 1794 | run_test "Large packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1795 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1796 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1798 | 0 \ |
| 1799 | -s "Read from client: 16384 bytes read" |
| 1800 | |
| 1801 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1802 | "$P_SRV" \ |
| 1803 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1804 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1805 | trunc_hmac=1" \ |
| 1806 | 0 \ |
| 1807 | -s "Read from client: 16384 bytes read" |
| 1808 | |
| 1809 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1810 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1811 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1812 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1813 | trunc_hmac=1" \ |
| 1814 | 0 \ |
| 1815 | -s "Read from client: 16384 bytes read" |
| 1816 | |
| 1817 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 1818 | "$P_SRV" \ |
| 1819 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1820 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1821 | 0 \ |
| 1822 | -s "Read from client: 16384 bytes read" |
| 1823 | |
| 1824 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 1825 | "$P_SRV" \ |
| 1826 | "$P_CLI request_size=16384 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1827 | 0 \ |
| 1828 | -s "Read from client: 16384 bytes read" |
| 1829 | |
| 1830 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1831 | "$P_SRV" \ |
| 1832 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1833 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1834 | trunc_hmac=1" \ |
| 1835 | 0 \ |
| 1836 | -s "Read from client: 16384 bytes read" |
| 1837 | |
| 1838 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1839 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1840 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1841 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1842 | 0 \ |
| 1843 | -s "Read from client: 16384 bytes read" |
| 1844 | |
| 1845 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame^] | 1846 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1847 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1848 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1849 | trunc_hmac=1" \ |
| 1850 | 0 \ |
| 1851 | -s "Read from client: 16384 bytes read" |
| 1852 | |
| 1853 | run_test "Large packet TLS 1.2 AEAD" \ |
| 1854 | "$P_SRV" \ |
| 1855 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1857 | 0 \ |
| 1858 | -s "Read from client: 16384 bytes read" |
| 1859 | |
| 1860 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 1861 | "$P_SRV" \ |
| 1862 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1864 | 0 \ |
| 1865 | -s "Read from client: 16384 bytes read" |
| 1866 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1867 | # Final report |
| 1868 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1869 | echo "------------------------------------------------------------------------" |
| 1870 | |
| 1871 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 1872 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1873 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 1874 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1875 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1876 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1877 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1878 | |
| 1879 | exit $FAILS |