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