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 | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 721 | # Tests for Session Tickets |
| 722 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 723 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 724 | "$P_SRV debug_level=3 tickets=1" \ |
| 725 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 726 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 727 | -c "client hello, adding session ticket extension" \ |
| 728 | -s "found session ticket extension" \ |
| 729 | -s "server hello, adding session ticket extension" \ |
| 730 | -c "found session_ticket extension" \ |
| 731 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 732 | -S "session successfully restored from cache" \ |
| 733 | -s "session successfully restored from ticket" \ |
| 734 | -s "a session has been resumed" \ |
| 735 | -c "a session has been resumed" |
| 736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 737 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 738 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 739 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 740 | 0 \ |
| 741 | -c "client hello, adding session ticket extension" \ |
| 742 | -s "found session ticket extension" \ |
| 743 | -s "server hello, adding session ticket extension" \ |
| 744 | -c "found session_ticket extension" \ |
| 745 | -c "parse new session ticket" \ |
| 746 | -S "session successfully restored from cache" \ |
| 747 | -s "session successfully restored from ticket" \ |
| 748 | -s "a session has been resumed" \ |
| 749 | -c "a session has been resumed" |
| 750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 751 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 752 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 753 | "$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] | 754 | 0 \ |
| 755 | -c "client hello, adding session ticket extension" \ |
| 756 | -s "found session ticket extension" \ |
| 757 | -s "server hello, adding session ticket extension" \ |
| 758 | -c "found session_ticket extension" \ |
| 759 | -c "parse new session ticket" \ |
| 760 | -S "session successfully restored from cache" \ |
| 761 | -S "session successfully restored from ticket" \ |
| 762 | -S "a session has been resumed" \ |
| 763 | -C "a session has been resumed" |
| 764 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 765 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 766 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 767 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 768 | 0 \ |
| 769 | -c "client hello, adding session ticket extension" \ |
| 770 | -c "found session_ticket extension" \ |
| 771 | -c "parse new session ticket" \ |
| 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 client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 775 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 776 | "( $O_CLI -sess_out $SESSION; \ |
| 777 | $O_CLI -sess_in $SESSION; \ |
| 778 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 779 | 0 \ |
| 780 | -s "found session ticket extension" \ |
| 781 | -s "server hello, adding session ticket extension" \ |
| 782 | -S "session successfully restored from cache" \ |
| 783 | -s "session successfully restored from ticket" \ |
| 784 | -s "a session has been resumed" |
| 785 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 786 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 788 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 789 | "$P_SRV debug_level=3 tickets=0" \ |
| 790 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 791 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 792 | -c "client hello, adding session ticket extension" \ |
| 793 | -s "found session ticket extension" \ |
| 794 | -S "server hello, adding session ticket extension" \ |
| 795 | -C "found session_ticket extension" \ |
| 796 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 797 | -s "session successfully restored from cache" \ |
| 798 | -S "session successfully restored from ticket" \ |
| 799 | -s "a session has been resumed" \ |
| 800 | -c "a session has been resumed" |
| 801 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 802 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 803 | "$P_SRV debug_level=3 tickets=1" \ |
| 804 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 805 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 806 | -C "client hello, adding session ticket extension" \ |
| 807 | -S "found session ticket extension" \ |
| 808 | -S "server hello, adding session ticket extension" \ |
| 809 | -C "found session_ticket extension" \ |
| 810 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 811 | -s "session successfully restored from cache" \ |
| 812 | -S "session successfully restored from ticket" \ |
| 813 | -s "a session has been resumed" \ |
| 814 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 816 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 817 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 818 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 819 | 0 \ |
| 820 | -S "session successfully restored from cache" \ |
| 821 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 822 | -S "a session has been resumed" \ |
| 823 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +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=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 826 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 827 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 828 | 0 \ |
| 829 | -s "session successfully restored from cache" \ |
| 830 | -S "session successfully restored from ticket" \ |
| 831 | -s "a session has been resumed" \ |
| 832 | -c "a session has been resumed" |
| 833 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 834 | run_test "Session resume using cache: timemout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 835 | "$P_SRV debug_level=3 tickets=0" \ |
| 836 | "$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] | 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: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 844 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 845 | "$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] | 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: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 853 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 854 | "$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] | 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: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 862 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 863 | "( $O_CLI -sess_out $SESSION; \ |
| 864 | $O_CLI -sess_in $SESSION; \ |
| 865 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 866 | 0 \ |
| 867 | -s "found session ticket extension" \ |
| 868 | -S "server hello, adding session ticket extension" \ |
| 869 | -s "session successfully restored from cache" \ |
| 870 | -S "session successfully restored from ticket" \ |
| 871 | -s "a session has been resumed" |
| 872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 873 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 874 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 875 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 876 | 0 \ |
| 877 | -C "found session_ticket extension" \ |
| 878 | -C "parse new session ticket" \ |
| 879 | -c "a session has been resumed" |
| 880 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 881 | # Tests for Max Fragment Length extension |
| 882 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 883 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 884 | "$P_SRV debug_level=3" \ |
| 885 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 886 | 0 \ |
| 887 | -C "client hello, adding max_fragment_length extension" \ |
| 888 | -S "found max fragment length extension" \ |
| 889 | -S "server hello, max_fragment_length extension" \ |
| 890 | -C "found 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: used by client" \ |
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 max_frag_len=4096" \ |
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 server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 902 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 903 | "$P_CLI debug_level=3" \ |
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" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 909 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 910 | requires_gnutls |
| 911 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 912 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 913 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 914 | 0 \ |
| 915 | -c "client hello, adding max_fragment_length extension" \ |
| 916 | -c "found max_fragment_length extension" |
| 917 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 918 | # Tests for renegotiation |
| 919 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 920 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 921 | "$P_SRV debug_level=3 exchanges=2" \ |
| 922 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 923 | 0 \ |
| 924 | -C "client hello, adding renegotiation extension" \ |
| 925 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 926 | -S "found renegotiation extension" \ |
| 927 | -s "server hello, secure renegotiation extension" \ |
| 928 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 929 | -C "=> renegotiate" \ |
| 930 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 931 | -S "write hello request" |
| 932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 933 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 934 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1" \ |
| 935 | "$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] | 936 | 0 \ |
| 937 | -c "client hello, adding renegotiation extension" \ |
| 938 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 939 | -s "found renegotiation extension" \ |
| 940 | -s "server hello, secure renegotiation extension" \ |
| 941 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 942 | -c "=> renegotiate" \ |
| 943 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 944 | -S "write hello request" |
| 945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 946 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 947 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 948 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 949 | 0 \ |
| 950 | -c "client hello, adding renegotiation extension" \ |
| 951 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 952 | -s "found renegotiation extension" \ |
| 953 | -s "server hello, secure renegotiation extension" \ |
| 954 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 955 | -c "=> renegotiate" \ |
| 956 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 957 | -s "write hello request" |
| 958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 959 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 960 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 961 | "$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] | 962 | 0 \ |
| 963 | -c "client hello, adding renegotiation extension" \ |
| 964 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 965 | -s "found renegotiation extension" \ |
| 966 | -s "server hello, secure renegotiation extension" \ |
| 967 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 968 | -c "=> renegotiate" \ |
| 969 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 970 | -s "write hello request" |
| 971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 972 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 973 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0" \ |
| 974 | "$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] | 975 | 1 \ |
| 976 | -c "client hello, adding renegotiation extension" \ |
| 977 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 978 | -S "found renegotiation extension" \ |
| 979 | -s "server hello, secure renegotiation extension" \ |
| 980 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 981 | -c "=> renegotiate" \ |
| 982 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 983 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 984 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 985 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 987 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 988 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 989 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 990 | 0 \ |
| 991 | -C "client hello, adding renegotiation extension" \ |
| 992 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 993 | -S "found renegotiation extension" \ |
| 994 | -s "server hello, secure renegotiation extension" \ |
| 995 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 996 | -C "=> renegotiate" \ |
| 997 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 998 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 999 | -S "SSL - An unexpected message was received from our peer" \ |
| 1000 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1001 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1002 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1003 | "$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] | 1004 | renego_delay=-1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1005 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1006 | 0 \ |
| 1007 | -C "client hello, adding renegotiation extension" \ |
| 1008 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1009 | -S "found renegotiation extension" \ |
| 1010 | -s "server hello, secure renegotiation extension" \ |
| 1011 | -c "found renegotiation extension" \ |
| 1012 | -C "=> renegotiate" \ |
| 1013 | -S "=> renegotiate" \ |
| 1014 | -s "write hello request" \ |
| 1015 | -S "SSL - An unexpected message was received from our peer" \ |
| 1016 | -S "failed" |
| 1017 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1018 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1019 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1020 | "$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] | 1021 | renego_delay=2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1022 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1023 | 0 \ |
| 1024 | -C "client hello, adding renegotiation extension" \ |
| 1025 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1026 | -S "found renegotiation extension" \ |
| 1027 | -s "server hello, secure renegotiation extension" \ |
| 1028 | -c "found renegotiation extension" \ |
| 1029 | -C "=> renegotiate" \ |
| 1030 | -S "=> renegotiate" \ |
| 1031 | -s "write hello request" \ |
| 1032 | -S "SSL - An unexpected message was received from our peer" \ |
| 1033 | -S "failed" |
| 1034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1035 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1036 | "$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] | 1037 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1038 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1039 | 0 \ |
| 1040 | -C "client hello, adding renegotiation extension" \ |
| 1041 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1042 | -S "found renegotiation extension" \ |
| 1043 | -s "server hello, secure renegotiation extension" \ |
| 1044 | -c "found renegotiation extension" \ |
| 1045 | -C "=> renegotiate" \ |
| 1046 | -S "=> renegotiate" \ |
| 1047 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1048 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1050 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1051 | "$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] | 1052 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1053 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1054 | 0 \ |
| 1055 | -c "client hello, adding renegotiation extension" \ |
| 1056 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1057 | -s "found renegotiation extension" \ |
| 1058 | -s "server hello, secure renegotiation extension" \ |
| 1059 | -c "found renegotiation extension" \ |
| 1060 | -c "=> renegotiate" \ |
| 1061 | -s "=> renegotiate" \ |
| 1062 | -s "write hello request" \ |
| 1063 | -S "SSL - An unexpected message was received from our peer" \ |
| 1064 | -S "failed" |
| 1065 | |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1066 | run_test "Renegotiation: periodic, just below period" \ |
| 1067 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1068 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1069 | 0 \ |
| 1070 | -C "client hello, adding renegotiation extension" \ |
| 1071 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1072 | -S "found renegotiation extension" \ |
| 1073 | -s "server hello, secure renegotiation extension" \ |
| 1074 | -c "found renegotiation extension" \ |
| 1075 | -S "record counter limit reached: renegotiate" \ |
| 1076 | -C "=> renegotiate" \ |
| 1077 | -S "=> renegotiate" \ |
| 1078 | -S "write hello request" \ |
| 1079 | -S "SSL - An unexpected message was received from our peer" \ |
| 1080 | -S "failed" |
| 1081 | |
| 1082 | run_test "Renegotiation: periodic, just above period" \ |
| 1083 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1084 | "$P_CLI debug_level=3 exchanges=3 renegotiation=1" \ |
| 1085 | 0 \ |
| 1086 | -c "client hello, adding renegotiation extension" \ |
| 1087 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1088 | -s "found renegotiation extension" \ |
| 1089 | -s "server hello, secure renegotiation extension" \ |
| 1090 | -c "found renegotiation extension" \ |
| 1091 | -s "record counter limit reached: renegotiate" \ |
| 1092 | -c "=> renegotiate" \ |
| 1093 | -s "=> renegotiate" \ |
| 1094 | -s "write hello request" \ |
| 1095 | -S "SSL - An unexpected message was received from our peer" \ |
| 1096 | -S "failed" |
| 1097 | |
| 1098 | run_test "Renegotiation: periodic, two times period" \ |
| 1099 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1100 | "$P_CLI debug_level=3 exchanges=6 renegotiation=1" \ |
| 1101 | 0 \ |
| 1102 | -c "client hello, adding renegotiation extension" \ |
| 1103 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1104 | -s "found renegotiation extension" \ |
| 1105 | -s "server hello, secure renegotiation extension" \ |
| 1106 | -c "found renegotiation extension" \ |
| 1107 | -s "record counter limit reached: renegotiate" \ |
| 1108 | -c "=> renegotiate" \ |
| 1109 | -s "=> renegotiate" \ |
| 1110 | -s "write hello request" \ |
| 1111 | -S "SSL - An unexpected message was received from our peer" \ |
| 1112 | -S "failed" |
| 1113 | |
| 1114 | run_test "Renegotiation: periodic, above period, disabled" \ |
| 1115 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3" \ |
| 1116 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1117 | 0 \ |
| 1118 | -C "client hello, adding renegotiation extension" \ |
| 1119 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1120 | -S "found renegotiation extension" \ |
| 1121 | -s "server hello, secure renegotiation extension" \ |
| 1122 | -c "found renegotiation extension" \ |
| 1123 | -S "record counter limit reached: renegotiate" \ |
| 1124 | -C "=> renegotiate" \ |
| 1125 | -S "=> renegotiate" \ |
| 1126 | -S "write hello request" \ |
| 1127 | -S "SSL - An unexpected message was received from our peer" \ |
| 1128 | -S "failed" |
| 1129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1130 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1131 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
| 1132 | "$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] | 1133 | 0 \ |
| 1134 | -c "client hello, adding renegotiation extension" \ |
| 1135 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1136 | -s "found renegotiation extension" \ |
| 1137 | -s "server hello, secure renegotiation extension" \ |
| 1138 | -c "found renegotiation extension" \ |
| 1139 | -c "=> renegotiate" \ |
| 1140 | -s "=> renegotiate" \ |
| 1141 | -S "write hello request" |
| 1142 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1143 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1144 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1145 | "$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] | 1146 | 0 \ |
| 1147 | -c "client hello, adding renegotiation extension" \ |
| 1148 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1149 | -s "found renegotiation extension" \ |
| 1150 | -s "server hello, secure renegotiation extension" \ |
| 1151 | -c "found renegotiation extension" \ |
| 1152 | -c "=> renegotiate" \ |
| 1153 | -s "=> renegotiate" \ |
| 1154 | -s "write hello request" |
| 1155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1156 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1157 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1158 | "$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] | 1159 | 0 \ |
| 1160 | -c "client hello, adding renegotiation extension" \ |
| 1161 | -c "found renegotiation extension" \ |
| 1162 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1163 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1164 | -C "error" \ |
| 1165 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1166 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1167 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1168 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1169 | "$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] | 1170 | 0 \ |
| 1171 | -c "client hello, adding renegotiation extension" \ |
| 1172 | -c "found renegotiation extension" \ |
| 1173 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1174 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1175 | -C "error" \ |
| 1176 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1177 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1178 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1179 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1180 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1181 | 1 \ |
| 1182 | -c "client hello, adding renegotiation extension" \ |
| 1183 | -C "found renegotiation extension" \ |
| 1184 | -c "=> renegotiate" \ |
| 1185 | -c "ssl_handshake() returned" \ |
| 1186 | -c "error" \ |
| 1187 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1188 | |
| 1189 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1190 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1191 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1192 | allow_legacy=0" \ |
| 1193 | 1 \ |
| 1194 | -c "client hello, adding renegotiation extension" \ |
| 1195 | -C "found renegotiation extension" \ |
| 1196 | -c "=> renegotiate" \ |
| 1197 | -c "ssl_handshake() returned" \ |
| 1198 | -c "error" \ |
| 1199 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1200 | |
| 1201 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1202 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1203 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1204 | allow_legacy=1" \ |
| 1205 | 0 \ |
| 1206 | -c "client hello, adding renegotiation extension" \ |
| 1207 | -C "found renegotiation extension" \ |
| 1208 | -c "=> renegotiate" \ |
| 1209 | -C "ssl_hanshake() returned" \ |
| 1210 | -C "error" \ |
| 1211 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1212 | |
| 1213 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 1214 | |
| 1215 | run_test "Renego ext: gnutls server strict, client default" \ |
| 1216 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1217 | "$P_CLI debug_level=3" \ |
| 1218 | 0 \ |
| 1219 | -c "found renegotiation extension" \ |
| 1220 | -C "error" \ |
| 1221 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1222 | |
| 1223 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 1224 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1225 | "$P_CLI debug_level=3" \ |
| 1226 | 0 \ |
| 1227 | -C "found renegotiation extension" \ |
| 1228 | -C "error" \ |
| 1229 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1230 | |
| 1231 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 1232 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1233 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 1234 | 1 \ |
| 1235 | -C "found renegotiation extension" \ |
| 1236 | -c "error" \ |
| 1237 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1238 | |
| 1239 | run_test "Renego ext: gnutls client strict, server default" \ |
| 1240 | "$P_SRV debug_level=3" \ |
| 1241 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1242 | 0 \ |
| 1243 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1244 | -s "server hello, secure renegotiation extension" |
| 1245 | |
| 1246 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 1247 | "$P_SRV debug_level=3" \ |
| 1248 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1249 | 0 \ |
| 1250 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1251 | -S "server hello, secure renegotiation extension" |
| 1252 | |
| 1253 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 1254 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 1255 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1256 | 1 \ |
| 1257 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1258 | -S "server hello, secure renegotiation extension" |
| 1259 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1260 | # Tests for auth_mode |
| 1261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1262 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1263 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1264 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1265 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1266 | 1 \ |
| 1267 | -c "x509_verify_cert() returned" \ |
| 1268 | -c "! self-signed or not signed by a trusted CA" \ |
| 1269 | -c "! ssl_handshake returned" \ |
| 1270 | -c "X509 - Certificate verification failed" |
| 1271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1272 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1273 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1274 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1275 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1276 | 0 \ |
| 1277 | -c "x509_verify_cert() returned" \ |
| 1278 | -c "! self-signed or not signed by a trusted CA" \ |
| 1279 | -C "! ssl_handshake returned" \ |
| 1280 | -C "X509 - Certificate verification failed" |
| 1281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1282 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1283 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1284 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1285 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1286 | 0 \ |
| 1287 | -C "x509_verify_cert() returned" \ |
| 1288 | -C "! self-signed or not signed by a trusted CA" \ |
| 1289 | -C "! ssl_handshake returned" \ |
| 1290 | -C "X509 - Certificate verification failed" |
| 1291 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1292 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1293 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 1294 | "$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] | 1295 | key_file=data_files/server5.key" \ |
| 1296 | 1 \ |
| 1297 | -S "skip write certificate request" \ |
| 1298 | -C "skip parse certificate request" \ |
| 1299 | -c "got a certificate request" \ |
| 1300 | -C "skip write certificate" \ |
| 1301 | -C "skip write certificate verify" \ |
| 1302 | -S "skip parse certificate verify" \ |
| 1303 | -s "x509_verify_cert() returned" \ |
| 1304 | -S "! self-signed or not signed by a trusted CA" \ |
| 1305 | -s "! ssl_handshake returned" \ |
| 1306 | -c "! ssl_handshake returned" \ |
| 1307 | -s "X509 - Certificate verification failed" |
| 1308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1309 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1310 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1311 | "$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] | 1312 | key_file=data_files/server5.key" \ |
| 1313 | 0 \ |
| 1314 | -S "skip write certificate request" \ |
| 1315 | -C "skip parse certificate request" \ |
| 1316 | -c "got a certificate request" \ |
| 1317 | -C "skip write certificate" \ |
| 1318 | -C "skip write certificate verify" \ |
| 1319 | -S "skip parse certificate verify" \ |
| 1320 | -s "x509_verify_cert() returned" \ |
| 1321 | -s "! self-signed or not signed by a trusted CA" \ |
| 1322 | -S "! ssl_handshake returned" \ |
| 1323 | -C "! ssl_handshake returned" \ |
| 1324 | -S "X509 - Certificate verification failed" |
| 1325 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1326 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1327 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1328 | "$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] | 1329 | key_file=data_files/server5.key" \ |
| 1330 | 0 \ |
| 1331 | -s "skip write certificate request" \ |
| 1332 | -C "skip parse certificate request" \ |
| 1333 | -c "got no certificate request" \ |
| 1334 | -c "skip write certificate" \ |
| 1335 | -c "skip write certificate verify" \ |
| 1336 | -s "skip parse certificate verify" \ |
| 1337 | -S "x509_verify_cert() returned" \ |
| 1338 | -S "! self-signed or not signed by a trusted CA" \ |
| 1339 | -S "! ssl_handshake returned" \ |
| 1340 | -C "! ssl_handshake returned" \ |
| 1341 | -S "X509 - Certificate verification failed" |
| 1342 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1343 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1344 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1345 | "$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] | 1346 | 0 \ |
| 1347 | -S "skip write certificate request" \ |
| 1348 | -C "skip parse certificate request" \ |
| 1349 | -c "got a certificate request" \ |
| 1350 | -C "skip write certificate$" \ |
| 1351 | -C "got no certificate to send" \ |
| 1352 | -S "SSLv3 client has no certificate" \ |
| 1353 | -c "skip write certificate verify" \ |
| 1354 | -s "skip parse certificate verify" \ |
| 1355 | -s "! no client certificate sent" \ |
| 1356 | -S "! ssl_handshake returned" \ |
| 1357 | -C "! ssl_handshake returned" \ |
| 1358 | -S "X509 - Certificate verification failed" |
| 1359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1360 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1361 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1362 | "$O_CLI" \ |
| 1363 | 0 \ |
| 1364 | -S "skip write certificate request" \ |
| 1365 | -s "skip parse certificate verify" \ |
| 1366 | -s "! no client certificate sent" \ |
| 1367 | -S "! ssl_handshake returned" \ |
| 1368 | -S "X509 - Certificate verification failed" |
| 1369 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1370 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1371 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1372 | "$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] | 1373 | 0 \ |
| 1374 | -C "skip parse certificate request" \ |
| 1375 | -c "got a certificate request" \ |
| 1376 | -C "skip write certificate$" \ |
| 1377 | -c "skip write certificate verify" \ |
| 1378 | -C "! ssl_handshake returned" |
| 1379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1380 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1381 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
| 1382 | "$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] | 1383 | 0 \ |
| 1384 | -S "skip write certificate request" \ |
| 1385 | -C "skip parse certificate request" \ |
| 1386 | -c "got a certificate request" \ |
| 1387 | -C "skip write certificate$" \ |
| 1388 | -c "skip write certificate verify" \ |
| 1389 | -c "got no certificate to send" \ |
| 1390 | -s "SSLv3 client has no certificate" \ |
| 1391 | -s "skip parse certificate verify" \ |
| 1392 | -s "! no client certificate sent" \ |
| 1393 | -S "! ssl_handshake returned" \ |
| 1394 | -C "! ssl_handshake returned" \ |
| 1395 | -S "X509 - Certificate verification failed" |
| 1396 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1397 | # tests for SNI |
| 1398 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1399 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1400 | "$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] | 1401 | 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] | 1402 | "$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] | 1403 | server_name=localhost" \ |
| 1404 | 0 \ |
| 1405 | -S "parse ServerName extension" \ |
| 1406 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1407 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1408 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1409 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1410 | "$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] | 1411 | 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] | 1412 | 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] | 1413 | "$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] | 1414 | server_name=localhost" \ |
| 1415 | 0 \ |
| 1416 | -s "parse ServerName extension" \ |
| 1417 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1418 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1419 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1420 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1421 | "$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] | 1422 | 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] | 1423 | 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] | 1424 | "$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] | 1425 | server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1426 | 0 \ |
| 1427 | -s "parse ServerName extension" \ |
| 1428 | -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] | 1429 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1431 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1432 | "$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] | 1433 | 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] | 1434 | 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] | 1435 | "$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] | 1436 | server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1437 | 1 \ |
| 1438 | -s "parse ServerName extension" \ |
| 1439 | -s "ssl_sni_wrapper() returned" \ |
| 1440 | -s "ssl_handshake returned" \ |
| 1441 | -c "ssl_handshake returned" \ |
| 1442 | -c "SSL - A fatal alert message was received from our peer" |
| 1443 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1444 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1446 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1447 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1448 | "$P_CLI nbio=2 tickets=0" \ |
| 1449 | 0 \ |
| 1450 | -S "ssl_handshake returned" \ |
| 1451 | -C "ssl_handshake returned" \ |
| 1452 | -c "Read from server: .* bytes read" |
| 1453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1454 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1455 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1456 | "$P_CLI nbio=2 tickets=0" \ |
| 1457 | 0 \ |
| 1458 | -S "ssl_handshake returned" \ |
| 1459 | -C "ssl_handshake returned" \ |
| 1460 | -c "Read from server: .* bytes read" |
| 1461 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1462 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1463 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1464 | "$P_CLI nbio=2 tickets=1" \ |
| 1465 | 0 \ |
| 1466 | -S "ssl_handshake returned" \ |
| 1467 | -C "ssl_handshake returned" \ |
| 1468 | -c "Read from server: .* bytes read" |
| 1469 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1470 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1471 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1472 | "$P_CLI nbio=2 tickets=1" \ |
| 1473 | 0 \ |
| 1474 | -S "ssl_handshake returned" \ |
| 1475 | -C "ssl_handshake returned" \ |
| 1476 | -c "Read from server: .* bytes read" |
| 1477 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1478 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1479 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1480 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1481 | 0 \ |
| 1482 | -S "ssl_handshake returned" \ |
| 1483 | -C "ssl_handshake returned" \ |
| 1484 | -c "Read from server: .* bytes read" |
| 1485 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1486 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1487 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1488 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1489 | 0 \ |
| 1490 | -S "ssl_handshake returned" \ |
| 1491 | -C "ssl_handshake returned" \ |
| 1492 | -c "Read from server: .* bytes read" |
| 1493 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1494 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1495 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1496 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1497 | 0 \ |
| 1498 | -S "ssl_handshake returned" \ |
| 1499 | -C "ssl_handshake returned" \ |
| 1500 | -c "Read from server: .* bytes read" |
| 1501 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1502 | # Tests for version negotiation |
| 1503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1504 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1505 | "$P_SRV" \ |
| 1506 | "$P_CLI" \ |
| 1507 | 0 \ |
| 1508 | -S "ssl_handshake returned" \ |
| 1509 | -C "ssl_handshake returned" \ |
| 1510 | -s "Protocol is TLSv1.2" \ |
| 1511 | -c "Protocol is TLSv1.2" |
| 1512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1513 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1514 | "$P_SRV" \ |
| 1515 | "$P_CLI max_version=tls1_1" \ |
| 1516 | 0 \ |
| 1517 | -S "ssl_handshake returned" \ |
| 1518 | -C "ssl_handshake returned" \ |
| 1519 | -s "Protocol is TLSv1.1" \ |
| 1520 | -c "Protocol is TLSv1.1" |
| 1521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1522 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1523 | "$P_SRV max_version=tls1_1" \ |
| 1524 | "$P_CLI" \ |
| 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: cli+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 max_version=tls1_1" \ |
| 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 max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1541 | "$P_SRV min_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 min 1.1, srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1550 | "$P_SRV max_version=tls1_1" \ |
| 1551 | "$P_CLI min_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.2, srv max 1.1 -> fail" \ |
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_2" \ |
| 1561 | 1 \ |
| 1562 | -s "ssl_handshake returned" \ |
| 1563 | -c "ssl_handshake returned" \ |
| 1564 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1566 | 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] | 1567 | "$P_SRV min_version=tls1_2" \ |
| 1568 | "$P_CLI max_version=tls1_1" \ |
| 1569 | 1 \ |
| 1570 | -s "ssl_handshake returned" \ |
| 1571 | -c "ssl_handshake returned" \ |
| 1572 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1573 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1574 | # Tests for ALPN extension |
| 1575 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1576 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1577 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1578 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1579 | "$P_SRV debug_level=3" \ |
| 1580 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1581 | 0 \ |
| 1582 | -C "client hello, adding alpn extension" \ |
| 1583 | -S "found alpn extension" \ |
| 1584 | -C "got an alert message, type: \\[2:120]" \ |
| 1585 | -S "server hello, adding alpn extension" \ |
| 1586 | -C "found alpn extension " \ |
| 1587 | -C "Application Layer Protocol is" \ |
| 1588 | -S "Application Layer Protocol is" |
| 1589 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1590 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1591 | "$P_SRV debug_level=3" \ |
| 1592 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1593 | 0 \ |
| 1594 | -c "client hello, adding alpn extension" \ |
| 1595 | -s "found alpn extension" \ |
| 1596 | -C "got an alert message, type: \\[2:120]" \ |
| 1597 | -S "server hello, adding alpn extension" \ |
| 1598 | -C "found alpn extension " \ |
| 1599 | -c "Application Layer Protocol is (none)" \ |
| 1600 | -S "Application Layer Protocol is" |
| 1601 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1602 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1603 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1604 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1605 | 0 \ |
| 1606 | -C "client hello, adding alpn extension" \ |
| 1607 | -S "found alpn extension" \ |
| 1608 | -C "got an alert message, type: \\[2:120]" \ |
| 1609 | -S "server hello, adding alpn extension" \ |
| 1610 | -C "found alpn extension " \ |
| 1611 | -C "Application Layer Protocol is" \ |
| 1612 | -s "Application Layer Protocol is (none)" |
| 1613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1614 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1615 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1616 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1617 | 0 \ |
| 1618 | -c "client hello, adding alpn extension" \ |
| 1619 | -s "found alpn extension" \ |
| 1620 | -C "got an alert message, type: \\[2:120]" \ |
| 1621 | -s "server hello, adding alpn extension" \ |
| 1622 | -c "found alpn extension" \ |
| 1623 | -c "Application Layer Protocol is abc" \ |
| 1624 | -s "Application Layer Protocol is abc" |
| 1625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1626 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1627 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1628 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1629 | 0 \ |
| 1630 | -c "client hello, adding alpn extension" \ |
| 1631 | -s "found alpn extension" \ |
| 1632 | -C "got an alert message, type: \\[2:120]" \ |
| 1633 | -s "server hello, adding alpn extension" \ |
| 1634 | -c "found alpn extension" \ |
| 1635 | -c "Application Layer Protocol is abc" \ |
| 1636 | -s "Application Layer Protocol is abc" |
| 1637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1638 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1639 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1640 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1641 | 0 \ |
| 1642 | -c "client hello, adding alpn extension" \ |
| 1643 | -s "found alpn extension" \ |
| 1644 | -C "got an alert message, type: \\[2:120]" \ |
| 1645 | -s "server hello, adding alpn extension" \ |
| 1646 | -c "found alpn extension" \ |
| 1647 | -c "Application Layer Protocol is 1234" \ |
| 1648 | -s "Application Layer Protocol is 1234" |
| 1649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1650 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1651 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1652 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1653 | 1 \ |
| 1654 | -c "client hello, adding alpn extension" \ |
| 1655 | -s "found alpn extension" \ |
| 1656 | -c "got an alert message, type: \\[2:120]" \ |
| 1657 | -S "server hello, adding alpn extension" \ |
| 1658 | -C "found alpn extension" \ |
| 1659 | -C "Application Layer Protocol is 1234" \ |
| 1660 | -S "Application Layer Protocol is 1234" |
| 1661 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1662 | fi |
| 1663 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1664 | # Tests for keyUsage in leaf certificates, part 1: |
| 1665 | # server-side certificate/suite selection |
| 1666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1667 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1668 | "$P_SRV key_file=data_files/server2.key \ |
| 1669 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1670 | "$P_CLI" \ |
| 1671 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1672 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1673 | |
| 1674 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1675 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1676 | "$P_SRV key_file=data_files/server2.key \ |
| 1677 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1678 | "$P_CLI" \ |
| 1679 | 0 \ |
| 1680 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1682 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1683 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1684 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1685 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1686 | 1 \ |
| 1687 | -C "Ciphersuite is " |
| 1688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1689 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1690 | "$P_SRV key_file=data_files/server5.key \ |
| 1691 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1692 | "$P_CLI" \ |
| 1693 | 0 \ |
| 1694 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1695 | |
| 1696 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1697 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1698 | "$P_SRV key_file=data_files/server5.key \ |
| 1699 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1700 | "$P_CLI" \ |
| 1701 | 0 \ |
| 1702 | -c "Ciphersuite is TLS-ECDH-" |
| 1703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1704 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1705 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1706 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1707 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1708 | 1 \ |
| 1709 | -C "Ciphersuite is " |
| 1710 | |
| 1711 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1712 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1714 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1715 | "$O_SRV -key data_files/server2.key \ |
| 1716 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1717 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1718 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1719 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1720 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1721 | -C "Processing of the Certificate handshake message failed" \ |
| 1722 | -c "Ciphersuite is TLS-" |
| 1723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1724 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1725 | "$O_SRV -key data_files/server2.key \ |
| 1726 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1727 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1728 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1729 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1730 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1731 | -C "Processing of the Certificate handshake message failed" \ |
| 1732 | -c "Ciphersuite is TLS-" |
| 1733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1734 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1735 | "$O_SRV -key data_files/server2.key \ |
| 1736 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1737 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1738 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1739 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1740 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1741 | -C "Processing of the Certificate handshake message failed" \ |
| 1742 | -c "Ciphersuite is TLS-" |
| 1743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1744 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1745 | "$O_SRV -key data_files/server2.key \ |
| 1746 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1747 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1748 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1749 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1750 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1751 | -c "Processing of the Certificate handshake message failed" \ |
| 1752 | -C "Ciphersuite is TLS-" |
| 1753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1754 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1755 | "$O_SRV -key data_files/server2.key \ |
| 1756 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1757 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1758 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1759 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1760 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1761 | -C "Processing of the Certificate handshake message failed" \ |
| 1762 | -c "Ciphersuite is TLS-" |
| 1763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1764 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1765 | "$O_SRV -key data_files/server2.key \ |
| 1766 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1767 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1768 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1769 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1770 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1771 | -c "Processing of the Certificate handshake message failed" \ |
| 1772 | -C "Ciphersuite is TLS-" |
| 1773 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1774 | # Tests for keyUsage in leaf certificates, part 3: |
| 1775 | # server-side checking of client cert |
| 1776 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1777 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1778 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1779 | "$O_CLI -key data_files/server2.key \ |
| 1780 | -cert data_files/server2.ku-ds.crt" \ |
| 1781 | 0 \ |
| 1782 | -S "bad certificate (usage extensions)" \ |
| 1783 | -S "Processing of the Certificate handshake message failed" |
| 1784 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1785 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1786 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1787 | "$O_CLI -key data_files/server2.key \ |
| 1788 | -cert data_files/server2.ku-ke.crt" \ |
| 1789 | 0 \ |
| 1790 | -s "bad certificate (usage extensions)" \ |
| 1791 | -S "Processing of the Certificate handshake message failed" |
| 1792 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1793 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1794 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1795 | "$O_CLI -key data_files/server2.key \ |
| 1796 | -cert data_files/server2.ku-ke.crt" \ |
| 1797 | 1 \ |
| 1798 | -s "bad certificate (usage extensions)" \ |
| 1799 | -s "Processing of the Certificate handshake message failed" |
| 1800 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1801 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1802 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1803 | "$O_CLI -key data_files/server5.key \ |
| 1804 | -cert data_files/server5.ku-ds.crt" \ |
| 1805 | 0 \ |
| 1806 | -S "bad certificate (usage extensions)" \ |
| 1807 | -S "Processing of the Certificate handshake message failed" |
| 1808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1809 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1810 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1811 | "$O_CLI -key data_files/server5.key \ |
| 1812 | -cert data_files/server5.ku-ka.crt" \ |
| 1813 | 0 \ |
| 1814 | -s "bad certificate (usage extensions)" \ |
| 1815 | -S "Processing of the Certificate handshake message failed" |
| 1816 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1817 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1819 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1820 | "$P_SRV key_file=data_files/server5.key \ |
| 1821 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1822 | "$P_CLI" \ |
| 1823 | 0 |
| 1824 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1825 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1826 | "$P_SRV key_file=data_files/server5.key \ |
| 1827 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1828 | "$P_CLI" \ |
| 1829 | 0 |
| 1830 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1831 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1832 | "$P_SRV key_file=data_files/server5.key \ |
| 1833 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1834 | "$P_CLI" \ |
| 1835 | 0 |
| 1836 | |
| 1837 | # 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] | 1838 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1839 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1840 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1841 | "$P_CLI psk=badbad" \ |
| 1842 | 1 |
| 1843 | |
| 1844 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1846 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1847 | "$O_SRV -key data_files/server5.key \ |
| 1848 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1849 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1850 | 0 \ |
| 1851 | -C "bad certificate (usage extensions)" \ |
| 1852 | -C "Processing of the Certificate handshake message failed" \ |
| 1853 | -c "Ciphersuite is TLS-" |
| 1854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1855 | run_test "extKeyUsage cli: serverAuth,clientAuth -> 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_cli.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: codeSign,anyEKU -> 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-cs_any.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 -> fail" \ |
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.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 | 1 \ |
| 1878 | -c "bad certificate (usage extensions)" \ |
| 1879 | -c "Processing of the Certificate handshake message failed" \ |
| 1880 | -C "Ciphersuite is TLS-" |
| 1881 | |
| 1882 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 1883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1884 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1885 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1886 | "$O_CLI -key data_files/server5.key \ |
| 1887 | -cert data_files/server5.eku-cli.crt" \ |
| 1888 | 0 \ |
| 1889 | -S "bad certificate (usage extensions)" \ |
| 1890 | -S "Processing of the Certificate handshake message failed" |
| 1891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1892 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1893 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1894 | "$O_CLI -key data_files/server5.key \ |
| 1895 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 1896 | 0 \ |
| 1897 | -S "bad certificate (usage extensions)" \ |
| 1898 | -S "Processing of the Certificate handshake message failed" |
| 1899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1900 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1901 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1902 | "$O_CLI -key data_files/server5.key \ |
| 1903 | -cert data_files/server5.eku-cs_any.crt" \ |
| 1904 | 0 \ |
| 1905 | -S "bad certificate (usage extensions)" \ |
| 1906 | -S "Processing of the Certificate handshake message failed" |
| 1907 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1908 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1909 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1910 | "$O_CLI -key data_files/server5.key \ |
| 1911 | -cert data_files/server5.eku-cs.crt" \ |
| 1912 | 0 \ |
| 1913 | -s "bad certificate (usage extensions)" \ |
| 1914 | -S "Processing of the Certificate handshake message failed" |
| 1915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1916 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1917 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1918 | "$O_CLI -key data_files/server5.key \ |
| 1919 | -cert data_files/server5.eku-cs.crt" \ |
| 1920 | 1 \ |
| 1921 | -s "bad certificate (usage extensions)" \ |
| 1922 | -s "Processing of the Certificate handshake message failed" |
| 1923 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1924 | # Tests for DHM parameters loading |
| 1925 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1926 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1927 | "$P_SRV" \ |
| 1928 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1929 | debug_level=3" \ |
| 1930 | 0 \ |
| 1931 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 1932 | -c "value of 'DHM: G ' (2048 bits)" |
| 1933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1934 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1935 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 1936 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1937 | debug_level=3" \ |
| 1938 | 0 \ |
| 1939 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 1940 | -c "value of 'DHM: G ' (2 bits)" |
| 1941 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1942 | # Tests for PSK callback |
| 1943 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1944 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1945 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 1946 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1947 | psk_identity=foo psk=abc123" \ |
| 1948 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1949 | -S "SSL - The server has no ciphersuites in common" \ |
| 1950 | -S "SSL - Unknown identity received" \ |
| 1951 | -S "SSL - Verification of the message MAC failed" |
| 1952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1953 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1954 | "$P_SRV" \ |
| 1955 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1956 | psk_identity=foo psk=abc123" \ |
| 1957 | 1 \ |
| 1958 | -s "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 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: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1963 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 1964 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1965 | psk_identity=foo psk=abc123" \ |
| 1966 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 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: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1972 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1973 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1974 | psk_identity=abc psk=dead" \ |
| 1975 | 0 \ |
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: second 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=def psk=beef" \ |
| 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: no match" \ |
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=ghi psk=beef" \ |
| 1993 | 1 \ |
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: wrong key" \ |
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=abc 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" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2006 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2007 | # Tests for ciphersuites per version |
| 2008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2009 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2010 | "$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" \ |
| 2011 | "$P_CLI force_version=ssl3" \ |
| 2012 | 0 \ |
| 2013 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2015 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2016 | "$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" \ |
| 2017 | "$P_CLI force_version=tls1" \ |
| 2018 | 0 \ |
| 2019 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 2020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2021 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2022 | "$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" \ |
| 2023 | "$P_CLI force_version=tls1_1" \ |
| 2024 | 0 \ |
| 2025 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2027 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2028 | "$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" \ |
| 2029 | "$P_CLI force_version=tls1_2" \ |
| 2030 | 0 \ |
| 2031 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2032 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2033 | # Tests for ssl_get_bytes_avail() |
| 2034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2035 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2036 | "$P_SRV" \ |
| 2037 | "$P_CLI request_size=100" \ |
| 2038 | 0 \ |
| 2039 | -s "Read from client: 100 bytes read$" |
| 2040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2041 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2042 | "$P_SRV" \ |
| 2043 | "$P_CLI request_size=500" \ |
| 2044 | 0 \ |
| 2045 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2046 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2047 | # Tests for small packets |
| 2048 | |
| 2049 | run_test "Small packet SSLv3 BlockCipher" \ |
| 2050 | "$P_SRV" \ |
| 2051 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2052 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2053 | 0 \ |
| 2054 | -s "Read from client: 1 bytes read" |
| 2055 | |
| 2056 | run_test "Small packet SSLv3 StreamCipher" \ |
| 2057 | "$P_SRV" \ |
| 2058 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2059 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2060 | 0 \ |
| 2061 | -s "Read from client: 1 bytes read" |
| 2062 | |
| 2063 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2064 | "$P_SRV" \ |
| 2065 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2066 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2067 | 0 \ |
| 2068 | -s "Read from client: 1 bytes read" |
| 2069 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2070 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2071 | "$P_SRV" \ |
| 2072 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2073 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2074 | 0 \ |
| 2075 | -s "Read from client: 1 bytes read" |
| 2076 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2077 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2078 | "$P_SRV" \ |
| 2079 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2080 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2081 | trunc_hmac=1" \ |
| 2082 | 0 \ |
| 2083 | -s "Read from client: 1 bytes read" |
| 2084 | |
| 2085 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
| 2086 | "$P_SRV" \ |
| 2087 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2088 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2089 | trunc_hmac=1" \ |
| 2090 | 0 \ |
| 2091 | -s "Read from client: 1 bytes read" |
| 2092 | |
| 2093 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2094 | "$P_SRV" \ |
| 2095 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2096 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2097 | 0 \ |
| 2098 | -s "Read from client: 1 bytes read" |
| 2099 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2100 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2101 | "$P_SRV" \ |
| 2102 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2103 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2104 | 0 \ |
| 2105 | -s "Read from client: 1 bytes read" |
| 2106 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2107 | run_test "Small packet TLS 1.1 StreamCipher" \ |
| 2108 | "$P_SRV" \ |
| 2109 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2110 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2111 | 0 \ |
| 2112 | -s "Read from client: 1 bytes read" |
| 2113 | |
| 2114 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2115 | "$P_SRV" \ |
| 2116 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2117 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2118 | trunc_hmac=1" \ |
| 2119 | 0 \ |
| 2120 | -s "Read from client: 1 bytes read" |
| 2121 | |
| 2122 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
| 2123 | "$P_SRV" \ |
| 2124 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2125 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2126 | trunc_hmac=1" \ |
| 2127 | 0 \ |
| 2128 | -s "Read from client: 1 bytes read" |
| 2129 | |
| 2130 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2131 | "$P_SRV" \ |
| 2132 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2133 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2134 | 0 \ |
| 2135 | -s "Read from client: 1 bytes read" |
| 2136 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2137 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2138 | "$P_SRV" \ |
| 2139 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2140 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2141 | 0 \ |
| 2142 | -s "Read from client: 1 bytes read" |
| 2143 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2144 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2145 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2146 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2147 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2148 | 0 \ |
| 2149 | -s "Read from client: 1 bytes read" |
| 2150 | |
| 2151 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2152 | "$P_SRV" \ |
| 2153 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2154 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2155 | trunc_hmac=1" \ |
| 2156 | 0 \ |
| 2157 | -s "Read from client: 1 bytes read" |
| 2158 | |
| 2159 | run_test "Small packet TLS 1.2 StreamCipher" \ |
| 2160 | "$P_SRV" \ |
| 2161 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2162 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2163 | 0 \ |
| 2164 | -s "Read from client: 1 bytes read" |
| 2165 | |
| 2166 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
| 2167 | "$P_SRV" \ |
| 2168 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2169 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2170 | trunc_hmac=1" \ |
| 2171 | 0 \ |
| 2172 | -s "Read from client: 1 bytes read" |
| 2173 | |
| 2174 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2175 | "$P_SRV" \ |
| 2176 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2177 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2178 | 0 \ |
| 2179 | -s "Read from client: 1 bytes read" |
| 2180 | |
| 2181 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2182 | "$P_SRV" \ |
| 2183 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2184 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2185 | 0 \ |
| 2186 | -s "Read from client: 1 bytes read" |
| 2187 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2188 | # Test for large packets |
| 2189 | |
| 2190 | run_test "Large packet SSLv3 BlockCipher" \ |
| 2191 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2192 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2193 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2194 | 0 \ |
| 2195 | -s "Read from client: 16384 bytes read" |
| 2196 | |
| 2197 | run_test "Large packet SSLv3 StreamCipher" \ |
| 2198 | "$P_SRV" \ |
| 2199 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2200 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2201 | 0 \ |
| 2202 | -s "Read from client: 16384 bytes read" |
| 2203 | |
| 2204 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2205 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2206 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2207 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2208 | 0 \ |
| 2209 | -s "Read from client: 16384 bytes read" |
| 2210 | |
| 2211 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2212 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2213 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2214 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2215 | trunc_hmac=1" \ |
| 2216 | 0 \ |
| 2217 | -s "Read from client: 16384 bytes read" |
| 2218 | |
| 2219 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
| 2220 | "$P_SRV" \ |
| 2221 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2222 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2223 | trunc_hmac=1" \ |
| 2224 | 0 \ |
| 2225 | -s "Read from client: 16384 bytes read" |
| 2226 | |
| 2227 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2228 | "$P_SRV" \ |
| 2229 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2230 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2231 | 0 \ |
| 2232 | -s "Read from client: 16384 bytes read" |
| 2233 | |
| 2234 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 2235 | "$P_SRV" \ |
| 2236 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2237 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2238 | 0 \ |
| 2239 | -s "Read from client: 16384 bytes read" |
| 2240 | |
| 2241 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2242 | "$P_SRV" \ |
| 2243 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2244 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2245 | trunc_hmac=1" \ |
| 2246 | 0 \ |
| 2247 | -s "Read from client: 16384 bytes read" |
| 2248 | |
| 2249 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
| 2250 | "$P_SRV" \ |
| 2251 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2252 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2253 | trunc_hmac=1" \ |
| 2254 | 0 \ |
| 2255 | -s "Read from client: 16384 bytes read" |
| 2256 | |
| 2257 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2258 | "$P_SRV" \ |
| 2259 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2260 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2261 | 0 \ |
| 2262 | -s "Read from client: 16384 bytes read" |
| 2263 | |
| 2264 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2265 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2266 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2267 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2268 | 0 \ |
| 2269 | -s "Read from client: 16384 bytes read" |
| 2270 | |
| 2271 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2272 | "$P_SRV" \ |
| 2273 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2274 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2275 | trunc_hmac=1" \ |
| 2276 | 0 \ |
| 2277 | -s "Read from client: 16384 bytes read" |
| 2278 | |
| 2279 | run_test "Large packet TLS 1.2 StreamCipher" \ |
| 2280 | "$P_SRV" \ |
| 2281 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2282 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2283 | 0 \ |
| 2284 | -s "Read from client: 16384 bytes read" |
| 2285 | |
| 2286 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
| 2287 | "$P_SRV" \ |
| 2288 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2289 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2290 | trunc_hmac=1" \ |
| 2291 | 0 \ |
| 2292 | -s "Read from client: 16384 bytes read" |
| 2293 | |
| 2294 | run_test "Large packet TLS 1.2 AEAD" \ |
| 2295 | "$P_SRV" \ |
| 2296 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2297 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2298 | 0 \ |
| 2299 | -s "Read from client: 16384 bytes read" |
| 2300 | |
| 2301 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 2302 | "$P_SRV" \ |
| 2303 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2304 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2305 | 0 \ |
| 2306 | -s "Read from client: 16384 bytes read" |
| 2307 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2308 | # Final report |
| 2309 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2310 | echo "------------------------------------------------------------------------" |
| 2311 | |
| 2312 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2313 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2314 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2315 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2316 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 2317 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2318 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2319 | |
| 2320 | exit $FAILS |