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