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