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