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 | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 411 | # Tests for rc4 option |
| 412 | |
| 413 | run_test "RC4: server disabled, client enabled" \ |
| 414 | "$P_SRV" \ |
| 415 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 416 | 1 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 417 | -s "SSL - None of the common ciphersuites is usable" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 418 | |
| 419 | run_test "RC4: server enabled, client disabled" \ |
| 420 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 421 | "$P_CLI" \ |
| 422 | 1 \ |
| 423 | -s "SSL - The server has no ciphersuites in common" |
| 424 | |
| 425 | run_test "RC4: both enabled" \ |
| 426 | "$P_SRV arc4=1" \ |
| 427 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 428 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 429 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 430 | -S "SSL - The server has no ciphersuites in common" |
| 431 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 432 | # Test for SSLv2 ClientHello |
| 433 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 434 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 435 | run_test "SSLv2 ClientHello: reference" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 436 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 437 | "$O_CLI -no_ssl2" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 438 | 0 \ |
| 439 | -S "parse client hello v2" \ |
| 440 | -S "ssl_handshake returned" |
| 441 | |
| 442 | # 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] | 443 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 444 | run_test "SSLv2 ClientHello: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 445 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 446 | "$O_CLI -cipher 'DES-CBC-MD5:ALL'" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 447 | 0 \ |
| 448 | -s "parse client hello v2" \ |
| 449 | -S "ssl_handshake returned" |
| 450 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 451 | # Tests for Truncated HMAC extension |
| 452 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 453 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 454 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 455 | "$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] | 456 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 457 | -s "dumping 'computed mac' (20 bytes)" \ |
| 458 | -S "dumping 'computed mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 459 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 460 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 461 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 462 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 463 | trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 464 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 465 | -s "dumping 'computed mac' (20 bytes)" \ |
| 466 | -S "dumping 'computed mac' (10 bytes)" |
| 467 | |
| 468 | run_test "Truncated HMAC: client enabled, server default" \ |
| 469 | "$P_SRV debug_level=4" \ |
| 470 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 471 | trunc_hmac=1" \ |
| 472 | 0 \ |
| 473 | -S "dumping 'computed mac' (20 bytes)" \ |
| 474 | -s "dumping 'computed mac' (10 bytes)" |
| 475 | |
| 476 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 477 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
| 478 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 479 | trunc_hmac=1" \ |
| 480 | 0 \ |
| 481 | -s "dumping 'computed mac' (20 bytes)" \ |
| 482 | -S "dumping 'computed mac' (10 bytes)" |
| 483 | |
| 484 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 485 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
| 486 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 487 | trunc_hmac=1" \ |
| 488 | 0 \ |
| 489 | -S "dumping 'computed mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 490 | -s "dumping 'computed mac' (10 bytes)" |
| 491 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 492 | # Tests for Encrypt-then-MAC extension |
| 493 | |
| 494 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 495 | "$P_SRV debug_level=3 \ |
| 496 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 497 | "$P_CLI debug_level=3" \ |
| 498 | 0 \ |
| 499 | -c "client hello, adding encrypt_then_mac extension" \ |
| 500 | -s "found encrypt then mac extension" \ |
| 501 | -s "server hello, adding encrypt then mac extension" \ |
| 502 | -c "found encrypt_then_mac extension" \ |
| 503 | -c "using encrypt then mac" \ |
| 504 | -s "using encrypt then mac" |
| 505 | |
| 506 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 507 | "$P_SRV debug_level=3 etm=0 \ |
| 508 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 509 | "$P_CLI debug_level=3 etm=1" \ |
| 510 | 0 \ |
| 511 | -c "client hello, adding encrypt_then_mac extension" \ |
| 512 | -s "found encrypt then mac extension" \ |
| 513 | -S "server hello, adding encrypt then mac extension" \ |
| 514 | -C "found encrypt_then_mac extension" \ |
| 515 | -C "using encrypt then mac" \ |
| 516 | -S "using encrypt then mac" |
| 517 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 518 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 519 | "$P_SRV debug_level=3 etm=1 \ |
| 520 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 521 | "$P_CLI debug_level=3 etm=1" \ |
| 522 | 0 \ |
| 523 | -c "client hello, adding encrypt_then_mac extension" \ |
| 524 | -s "found encrypt then mac extension" \ |
| 525 | -S "server hello, adding encrypt then mac extension" \ |
| 526 | -C "found encrypt_then_mac extension" \ |
| 527 | -C "using encrypt then mac" \ |
| 528 | -S "using encrypt then mac" |
| 529 | |
| 530 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 531 | "$P_SRV debug_level=3 etm=1 \ |
| 532 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 533 | "$P_CLI debug_level=3 etm=1 arc4=1" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 534 | 0 \ |
| 535 | -c "client hello, adding encrypt_then_mac extension" \ |
| 536 | -s "found encrypt then mac extension" \ |
| 537 | -S "server hello, adding encrypt then mac extension" \ |
| 538 | -C "found encrypt_then_mac extension" \ |
| 539 | -C "using encrypt then mac" \ |
| 540 | -S "using encrypt then mac" |
| 541 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 542 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 543 | "$P_SRV debug_level=3 etm=1 \ |
| 544 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 545 | "$P_CLI debug_level=3 etm=0" \ |
| 546 | 0 \ |
| 547 | -C "client hello, adding encrypt_then_mac extension" \ |
| 548 | -S "found encrypt then mac extension" \ |
| 549 | -S "server hello, adding encrypt then mac extension" \ |
| 550 | -C "found encrypt_then_mac extension" \ |
| 551 | -C "using encrypt then mac" \ |
| 552 | -S "using encrypt then mac" |
| 553 | |
| 554 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 555 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 556 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 557 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 558 | 0 \ |
| 559 | -C "client hello, adding encrypt_then_mac extension" \ |
| 560 | -S "found encrypt then mac extension" \ |
| 561 | -S "server hello, adding encrypt then mac extension" \ |
| 562 | -C "found encrypt_then_mac extension" \ |
| 563 | -C "using encrypt then mac" \ |
| 564 | -S "using encrypt then mac" |
| 565 | |
| 566 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 567 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 568 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 569 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 570 | 0 \ |
| 571 | -c "client hello, adding encrypt_then_mac extension" \ |
| 572 | -s "found encrypt then mac extension" \ |
| 573 | -S "server hello, adding encrypt then mac extension" \ |
| 574 | -C "found encrypt_then_mac extension" \ |
| 575 | -C "using encrypt then mac" \ |
| 576 | -S "using encrypt then mac" |
| 577 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 578 | # Tests for Extended Master Secret extension |
| 579 | |
| 580 | run_test "Extended Master Secret: default" \ |
| 581 | "$P_SRV debug_level=3" \ |
| 582 | "$P_CLI debug_level=3" \ |
| 583 | 0 \ |
| 584 | -c "client hello, adding extended_master_secret extension" \ |
| 585 | -s "found extended master secret extension" \ |
| 586 | -s "server hello, adding extended master secret extension" \ |
| 587 | -c "found extended_master_secret extension" \ |
| 588 | -c "using extended master secret" \ |
| 589 | -s "using extended master secret" |
| 590 | |
| 591 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 592 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 593 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 594 | 0 \ |
| 595 | -c "client hello, adding extended_master_secret extension" \ |
| 596 | -s "found extended master secret extension" \ |
| 597 | -S "server hello, adding extended master secret extension" \ |
| 598 | -C "found extended_master_secret extension" \ |
| 599 | -C "using extended master secret" \ |
| 600 | -S "using extended master secret" |
| 601 | |
| 602 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 603 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 604 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 605 | 0 \ |
| 606 | -C "client hello, adding extended_master_secret extension" \ |
| 607 | -S "found extended master secret extension" \ |
| 608 | -S "server hello, adding extended master secret extension" \ |
| 609 | -C "found extended_master_secret extension" \ |
| 610 | -C "using extended master secret" \ |
| 611 | -S "using extended master secret" |
| 612 | |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 613 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 614 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 615 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 616 | 0 \ |
| 617 | -C "client hello, adding extended_master_secret extension" \ |
| 618 | -S "found extended master secret extension" \ |
| 619 | -S "server hello, adding extended master secret extension" \ |
| 620 | -C "found extended_master_secret extension" \ |
| 621 | -C "using extended master secret" \ |
| 622 | -S "using extended master secret" |
| 623 | |
| 624 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 625 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 626 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 627 | 0 \ |
| 628 | -c "client hello, adding extended_master_secret extension" \ |
| 629 | -s "found extended master secret extension" \ |
| 630 | -S "server hello, adding extended master secret extension" \ |
| 631 | -C "found extended_master_secret extension" \ |
| 632 | -C "using extended master secret" \ |
| 633 | -S "using extended master secret" |
| 634 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 635 | # Tests for FALLBACK_SCSV |
| 636 | |
| 637 | run_test "Fallback SCSV: default" \ |
| 638 | "$P_SRV" \ |
| 639 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 640 | 0 \ |
| 641 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 642 | -S "received FALLBACK_SCSV" \ |
| 643 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 644 | -C "is a fatal alert message (msg 86)" |
| 645 | |
| 646 | run_test "Fallback SCSV: explicitly disabled" \ |
| 647 | "$P_SRV" \ |
| 648 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 649 | 0 \ |
| 650 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 651 | -S "received FALLBACK_SCSV" \ |
| 652 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 653 | -C "is a fatal alert message (msg 86)" |
| 654 | |
| 655 | run_test "Fallback SCSV: enabled" \ |
| 656 | "$P_SRV" \ |
| 657 | "$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] | 658 | 1 \ |
| 659 | -c "adding FALLBACK_SCSV" \ |
| 660 | -s "received FALLBACK_SCSV" \ |
| 661 | -s "inapropriate fallback" \ |
| 662 | -c "is a fatal alert message (msg 86)" |
| 663 | |
| 664 | run_test "Fallback SCSV: enabled, max version" \ |
| 665 | "$P_SRV" \ |
| 666 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 667 | 0 \ |
| 668 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 669 | -s "received FALLBACK_SCSV" \ |
| 670 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 671 | -C "is a fatal alert message (msg 86)" |
| 672 | |
| 673 | requires_openssl_with_fallback_scsv |
| 674 | run_test "Fallback SCSV: default, openssl server" \ |
| 675 | "$O_SRV" \ |
| 676 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 677 | 0 \ |
| 678 | -C "adding FALLBACK_SCSV" \ |
| 679 | -C "is a fatal alert message (msg 86)" |
| 680 | |
| 681 | requires_openssl_with_fallback_scsv |
| 682 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 683 | "$O_SRV" \ |
| 684 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 685 | 1 \ |
| 686 | -c "adding FALLBACK_SCSV" \ |
| 687 | -c "is a fatal alert message (msg 86)" |
| 688 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 689 | requires_openssl_with_fallback_scsv |
| 690 | run_test "Fallback SCSV: disabled, openssl client" \ |
| 691 | "$P_SRV" \ |
| 692 | "$O_CLI -tls1_1" \ |
| 693 | 0 \ |
| 694 | -S "received FALLBACK_SCSV" \ |
| 695 | -S "inapropriate fallback" |
| 696 | |
| 697 | requires_openssl_with_fallback_scsv |
| 698 | run_test "Fallback SCSV: enabled, openssl client" \ |
| 699 | "$P_SRV" \ |
| 700 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 701 | 1 \ |
| 702 | -s "received FALLBACK_SCSV" \ |
| 703 | -s "inapropriate fallback" |
| 704 | |
| 705 | requires_openssl_with_fallback_scsv |
| 706 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
| 707 | "$P_SRV" \ |
| 708 | "$O_CLI -fallback_scsv" \ |
| 709 | 0 \ |
| 710 | -s "received FALLBACK_SCSV" \ |
| 711 | -S "inapropriate fallback" |
| 712 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 713 | # Tests for CBC 1/n-1 record splitting |
| 714 | |
| 715 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 716 | "$P_SRV" \ |
| 717 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 718 | request_size=123 force_version=tls1_2" \ |
| 719 | 0 \ |
| 720 | -s "Read from client: 123 bytes read" \ |
| 721 | -S "Read from client: 1 bytes read" \ |
| 722 | -S "122 bytes read" |
| 723 | |
| 724 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 725 | "$P_SRV" \ |
| 726 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 727 | request_size=123 force_version=tls1_1" \ |
| 728 | 0 \ |
| 729 | -s "Read from client: 123 bytes read" \ |
| 730 | -S "Read from client: 1 bytes read" \ |
| 731 | -S "122 bytes read" |
| 732 | |
| 733 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 734 | "$P_SRV" \ |
| 735 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 736 | request_size=123 force_version=tls1" \ |
| 737 | 0 \ |
| 738 | -S "Read from client: 123 bytes read" \ |
| 739 | -s "Read from client: 1 bytes read" \ |
| 740 | -s "122 bytes read" |
| 741 | |
| 742 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 743 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 744 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 745 | request_size=123 force_version=ssl3" \ |
| 746 | 0 \ |
| 747 | -S "Read from client: 123 bytes read" \ |
| 748 | -s "Read from client: 1 bytes read" \ |
| 749 | -s "122 bytes read" |
| 750 | |
| 751 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame^] | 752 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 753 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 754 | request_size=123 force_version=tls1" \ |
| 755 | 0 \ |
| 756 | -s "Read from client: 123 bytes read" \ |
| 757 | -S "Read from client: 1 bytes read" \ |
| 758 | -S "122 bytes read" |
| 759 | |
| 760 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 761 | "$P_SRV" \ |
| 762 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 763 | request_size=123 force_version=tls1 recsplit=0" \ |
| 764 | 0 \ |
| 765 | -s "Read from client: 123 bytes read" \ |
| 766 | -S "Read from client: 1 bytes read" \ |
| 767 | -S "122 bytes read" |
| 768 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 769 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 770 | "$P_SRV nbio=2" \ |
| 771 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 772 | request_size=123 force_version=tls1" \ |
| 773 | 0 \ |
| 774 | -S "Read from client: 123 bytes read" \ |
| 775 | -s "Read from client: 1 bytes read" \ |
| 776 | -s "122 bytes read" |
| 777 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 778 | # Tests for Session Tickets |
| 779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 780 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 781 | "$P_SRV debug_level=3 tickets=1" \ |
| 782 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 783 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 784 | -c "client hello, adding session ticket extension" \ |
| 785 | -s "found session ticket extension" \ |
| 786 | -s "server hello, adding session ticket extension" \ |
| 787 | -c "found session_ticket extension" \ |
| 788 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 789 | -S "session successfully restored from cache" \ |
| 790 | -s "session successfully restored from ticket" \ |
| 791 | -s "a session has been resumed" \ |
| 792 | -c "a session has been resumed" |
| 793 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 794 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 795 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 796 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 797 | 0 \ |
| 798 | -c "client hello, adding session ticket extension" \ |
| 799 | -s "found session ticket extension" \ |
| 800 | -s "server hello, adding session ticket extension" \ |
| 801 | -c "found session_ticket extension" \ |
| 802 | -c "parse new session ticket" \ |
| 803 | -S "session successfully restored from cache" \ |
| 804 | -s "session successfully restored from ticket" \ |
| 805 | -s "a session has been resumed" \ |
| 806 | -c "a session has been resumed" |
| 807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 808 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 809 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 810 | "$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] | 811 | 0 \ |
| 812 | -c "client hello, adding session ticket extension" \ |
| 813 | -s "found session ticket extension" \ |
| 814 | -s "server hello, adding session ticket extension" \ |
| 815 | -c "found session_ticket extension" \ |
| 816 | -c "parse new session ticket" \ |
| 817 | -S "session successfully restored from cache" \ |
| 818 | -S "session successfully restored from ticket" \ |
| 819 | -S "a session has been resumed" \ |
| 820 | -C "a session has been resumed" |
| 821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 822 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 823 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 824 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 825 | 0 \ |
| 826 | -c "client hello, adding session ticket extension" \ |
| 827 | -c "found session_ticket extension" \ |
| 828 | -c "parse new session ticket" \ |
| 829 | -c "a session has been resumed" |
| 830 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 831 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 832 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 833 | "( $O_CLI -sess_out $SESSION; \ |
| 834 | $O_CLI -sess_in $SESSION; \ |
| 835 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 836 | 0 \ |
| 837 | -s "found session ticket extension" \ |
| 838 | -s "server hello, adding session ticket extension" \ |
| 839 | -S "session successfully restored from cache" \ |
| 840 | -s "session successfully restored from ticket" \ |
| 841 | -s "a session has been resumed" |
| 842 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 843 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 845 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 846 | "$P_SRV debug_level=3 tickets=0" \ |
| 847 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 848 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 849 | -c "client hello, adding session ticket extension" \ |
| 850 | -s "found session ticket extension" \ |
| 851 | -S "server hello, adding session ticket extension" \ |
| 852 | -C "found session_ticket extension" \ |
| 853 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 854 | -s "session successfully restored from cache" \ |
| 855 | -S "session successfully restored from ticket" \ |
| 856 | -s "a session has been resumed" \ |
| 857 | -c "a session has been resumed" |
| 858 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 859 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 860 | "$P_SRV debug_level=3 tickets=1" \ |
| 861 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 862 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 863 | -C "client hello, adding session ticket extension" \ |
| 864 | -S "found session ticket extension" \ |
| 865 | -S "server hello, adding session ticket extension" \ |
| 866 | -C "found session_ticket extension" \ |
| 867 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 868 | -s "session successfully restored from cache" \ |
| 869 | -S "session successfully restored from ticket" \ |
| 870 | -s "a session has been resumed" \ |
| 871 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 873 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 874 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 875 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 876 | 0 \ |
| 877 | -S "session successfully restored from cache" \ |
| 878 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 879 | -S "a session has been resumed" \ |
| 880 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 881 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 882 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 883 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 884 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 885 | 0 \ |
| 886 | -s "session successfully restored from cache" \ |
| 887 | -S "session successfully restored from ticket" \ |
| 888 | -s "a session has been resumed" \ |
| 889 | -c "a session has been resumed" |
| 890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 891 | run_test "Session resume using cache: timemout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 892 | "$P_SRV debug_level=3 tickets=0" \ |
| 893 | "$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] | 894 | 0 \ |
| 895 | -s "session successfully restored from cache" \ |
| 896 | -S "session successfully restored from ticket" \ |
| 897 | -s "a session has been resumed" \ |
| 898 | -c "a session has been resumed" |
| 899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 900 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 901 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 902 | "$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] | 903 | 0 \ |
| 904 | -S "session successfully restored from cache" \ |
| 905 | -S "session successfully restored from ticket" \ |
| 906 | -S "a session has been resumed" \ |
| 907 | -C "a session has been resumed" |
| 908 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 909 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 910 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 911 | "$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] | 912 | 0 \ |
| 913 | -s "session successfully restored from cache" \ |
| 914 | -S "session successfully restored from ticket" \ |
| 915 | -s "a session has been resumed" \ |
| 916 | -c "a session has been resumed" |
| 917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 918 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 919 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 920 | "( $O_CLI -sess_out $SESSION; \ |
| 921 | $O_CLI -sess_in $SESSION; \ |
| 922 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 923 | 0 \ |
| 924 | -s "found session ticket extension" \ |
| 925 | -S "server hello, adding session ticket extension" \ |
| 926 | -s "session successfully restored from cache" \ |
| 927 | -S "session successfully restored from ticket" \ |
| 928 | -s "a session has been resumed" |
| 929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 930 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 931 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 932 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 933 | 0 \ |
| 934 | -C "found session_ticket extension" \ |
| 935 | -C "parse new session ticket" \ |
| 936 | -c "a session has been resumed" |
| 937 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 938 | # Tests for Max Fragment Length extension |
| 939 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 940 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 941 | "$P_SRV debug_level=3" \ |
| 942 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 943 | 0 \ |
| 944 | -C "client hello, adding max_fragment_length extension" \ |
| 945 | -S "found max fragment length extension" \ |
| 946 | -S "server hello, max_fragment_length extension" \ |
| 947 | -C "found max_fragment_length extension" |
| 948 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 949 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 950 | "$P_SRV debug_level=3" \ |
| 951 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 952 | 0 \ |
| 953 | -c "client hello, adding max_fragment_length extension" \ |
| 954 | -s "found max fragment length extension" \ |
| 955 | -s "server hello, max_fragment_length extension" \ |
| 956 | -c "found max_fragment_length extension" |
| 957 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 958 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 959 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 960 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 961 | 0 \ |
| 962 | -C "client hello, adding max_fragment_length extension" \ |
| 963 | -S "found max fragment length extension" \ |
| 964 | -S "server hello, max_fragment_length extension" \ |
| 965 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 967 | requires_gnutls |
| 968 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 969 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 970 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 971 | 0 \ |
| 972 | -c "client hello, adding max_fragment_length extension" \ |
| 973 | -c "found max_fragment_length extension" |
| 974 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 975 | # Tests for renegotiation |
| 976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 977 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 978 | "$P_SRV debug_level=3 exchanges=2" \ |
| 979 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 980 | 0 \ |
| 981 | -C "client hello, adding renegotiation extension" \ |
| 982 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 983 | -S "found renegotiation extension" \ |
| 984 | -s "server hello, secure renegotiation extension" \ |
| 985 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 986 | -C "=> renegotiate" \ |
| 987 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 988 | -S "write hello request" |
| 989 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 990 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 991 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1" \ |
| 992 | "$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] | 993 | 0 \ |
| 994 | -c "client hello, adding renegotiation extension" \ |
| 995 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 996 | -s "found renegotiation extension" \ |
| 997 | -s "server hello, secure renegotiation extension" \ |
| 998 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 999 | -c "=> renegotiate" \ |
| 1000 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1001 | -S "write hello request" |
| 1002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1003 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1004 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1005 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1006 | 0 \ |
| 1007 | -c "client hello, adding renegotiation extension" \ |
| 1008 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1009 | -s "found renegotiation extension" \ |
| 1010 | -s "server hello, secure renegotiation extension" \ |
| 1011 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1012 | -c "=> renegotiate" \ |
| 1013 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1014 | -s "write hello request" |
| 1015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1016 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1017 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1018 | "$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] | 1019 | 0 \ |
| 1020 | -c "client hello, adding renegotiation extension" \ |
| 1021 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1022 | -s "found renegotiation extension" \ |
| 1023 | -s "server hello, secure renegotiation extension" \ |
| 1024 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1025 | -c "=> renegotiate" \ |
| 1026 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1027 | -s "write hello request" |
| 1028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1029 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1030 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0" \ |
| 1031 | "$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] | 1032 | 1 \ |
| 1033 | -c "client hello, adding renegotiation extension" \ |
| 1034 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1035 | -S "found renegotiation extension" \ |
| 1036 | -s "server hello, secure renegotiation extension" \ |
| 1037 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1038 | -c "=> renegotiate" \ |
| 1039 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1040 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1041 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1042 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1044 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1045 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1046 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1047 | 0 \ |
| 1048 | -C "client hello, adding renegotiation extension" \ |
| 1049 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1050 | -S "found renegotiation extension" \ |
| 1051 | -s "server hello, secure renegotiation extension" \ |
| 1052 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1053 | -C "=> renegotiate" \ |
| 1054 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1055 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1056 | -S "SSL - An unexpected message was received from our peer" \ |
| 1057 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1059 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1060 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1061 | renego_delay=-1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1062 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1063 | 0 \ |
| 1064 | -C "client hello, adding renegotiation extension" \ |
| 1065 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1066 | -S "found renegotiation extension" \ |
| 1067 | -s "server hello, secure renegotiation extension" \ |
| 1068 | -c "found renegotiation extension" \ |
| 1069 | -C "=> renegotiate" \ |
| 1070 | -S "=> renegotiate" \ |
| 1071 | -s "write hello request" \ |
| 1072 | -S "SSL - An unexpected message was received from our peer" \ |
| 1073 | -S "failed" |
| 1074 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1075 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1076 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1077 | "$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] | 1078 | renego_delay=2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1079 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1080 | 0 \ |
| 1081 | -C "client hello, adding renegotiation extension" \ |
| 1082 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1083 | -S "found renegotiation extension" \ |
| 1084 | -s "server hello, secure renegotiation extension" \ |
| 1085 | -c "found renegotiation extension" \ |
| 1086 | -C "=> renegotiate" \ |
| 1087 | -S "=> renegotiate" \ |
| 1088 | -s "write hello request" \ |
| 1089 | -S "SSL - An unexpected message was received from our peer" \ |
| 1090 | -S "failed" |
| 1091 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1092 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1093 | "$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] | 1094 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1095 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1096 | 0 \ |
| 1097 | -C "client hello, adding renegotiation extension" \ |
| 1098 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1099 | -S "found renegotiation extension" \ |
| 1100 | -s "server hello, secure renegotiation extension" \ |
| 1101 | -c "found renegotiation extension" \ |
| 1102 | -C "=> renegotiate" \ |
| 1103 | -S "=> renegotiate" \ |
| 1104 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1105 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1106 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1107 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1108 | "$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] | 1109 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1110 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1111 | 0 \ |
| 1112 | -c "client hello, adding renegotiation extension" \ |
| 1113 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1114 | -s "found renegotiation extension" \ |
| 1115 | -s "server hello, secure renegotiation extension" \ |
| 1116 | -c "found renegotiation extension" \ |
| 1117 | -c "=> renegotiate" \ |
| 1118 | -s "=> renegotiate" \ |
| 1119 | -s "write hello request" \ |
| 1120 | -S "SSL - An unexpected message was received from our peer" \ |
| 1121 | -S "failed" |
| 1122 | |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1123 | run_test "Renegotiation: periodic, just below period" \ |
| 1124 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1125 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1126 | 0 \ |
| 1127 | -C "client hello, adding renegotiation extension" \ |
| 1128 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1129 | -S "found renegotiation extension" \ |
| 1130 | -s "server hello, secure renegotiation extension" \ |
| 1131 | -c "found renegotiation extension" \ |
| 1132 | -S "record counter limit reached: renegotiate" \ |
| 1133 | -C "=> renegotiate" \ |
| 1134 | -S "=> renegotiate" \ |
| 1135 | -S "write hello request" \ |
| 1136 | -S "SSL - An unexpected message was received from our peer" \ |
| 1137 | -S "failed" |
| 1138 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1139 | # one extra exchange to be able to complete renego |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1140 | run_test "Renegotiation: periodic, just above period" \ |
| 1141 | "$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] | 1142 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1143 | 0 \ |
| 1144 | -c "client hello, adding renegotiation extension" \ |
| 1145 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1146 | -s "found renegotiation extension" \ |
| 1147 | -s "server hello, secure renegotiation extension" \ |
| 1148 | -c "found renegotiation extension" \ |
| 1149 | -s "record counter limit reached: renegotiate" \ |
| 1150 | -c "=> renegotiate" \ |
| 1151 | -s "=> renegotiate" \ |
| 1152 | -s "write hello request" \ |
| 1153 | -S "SSL - An unexpected message was received from our peer" \ |
| 1154 | -S "failed" |
| 1155 | |
| 1156 | run_test "Renegotiation: periodic, two times period" \ |
| 1157 | "$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] | 1158 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1159 | 0 \ |
| 1160 | -c "client hello, adding renegotiation extension" \ |
| 1161 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1162 | -s "found renegotiation extension" \ |
| 1163 | -s "server hello, secure renegotiation extension" \ |
| 1164 | -c "found renegotiation extension" \ |
| 1165 | -s "record counter limit reached: renegotiate" \ |
| 1166 | -c "=> renegotiate" \ |
| 1167 | -s "=> renegotiate" \ |
| 1168 | -s "write hello request" \ |
| 1169 | -S "SSL - An unexpected message was received from our peer" \ |
| 1170 | -S "failed" |
| 1171 | |
| 1172 | run_test "Renegotiation: periodic, above period, disabled" \ |
| 1173 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3" \ |
| 1174 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1175 | 0 \ |
| 1176 | -C "client hello, adding renegotiation extension" \ |
| 1177 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1178 | -S "found renegotiation extension" \ |
| 1179 | -s "server hello, secure renegotiation extension" \ |
| 1180 | -c "found renegotiation extension" \ |
| 1181 | -S "record counter limit reached: renegotiate" \ |
| 1182 | -C "=> renegotiate" \ |
| 1183 | -S "=> renegotiate" \ |
| 1184 | -S "write hello request" \ |
| 1185 | -S "SSL - An unexpected message was received from our peer" \ |
| 1186 | -S "failed" |
| 1187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1188 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1189 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
| 1190 | "$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] | 1191 | 0 \ |
| 1192 | -c "client hello, adding renegotiation extension" \ |
| 1193 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1194 | -s "found renegotiation extension" \ |
| 1195 | -s "server hello, secure renegotiation extension" \ |
| 1196 | -c "found renegotiation extension" \ |
| 1197 | -c "=> renegotiate" \ |
| 1198 | -s "=> renegotiate" \ |
| 1199 | -S "write hello request" |
| 1200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1201 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1202 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1203 | "$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] | 1204 | 0 \ |
| 1205 | -c "client hello, adding renegotiation extension" \ |
| 1206 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1207 | -s "found renegotiation extension" \ |
| 1208 | -s "server hello, secure renegotiation extension" \ |
| 1209 | -c "found renegotiation extension" \ |
| 1210 | -c "=> renegotiate" \ |
| 1211 | -s "=> renegotiate" \ |
| 1212 | -s "write hello request" |
| 1213 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1214 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1215 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1216 | "$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] | 1217 | 0 \ |
| 1218 | -c "client hello, adding renegotiation extension" \ |
| 1219 | -c "found renegotiation extension" \ |
| 1220 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1221 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1222 | -C "error" \ |
| 1223 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1224 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1225 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1226 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1227 | "$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] | 1228 | 0 \ |
| 1229 | -c "client hello, adding renegotiation extension" \ |
| 1230 | -c "found renegotiation extension" \ |
| 1231 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1232 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1233 | -C "error" \ |
| 1234 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1235 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1236 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1237 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1238 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1239 | 1 \ |
| 1240 | -c "client hello, adding renegotiation extension" \ |
| 1241 | -C "found renegotiation extension" \ |
| 1242 | -c "=> renegotiate" \ |
| 1243 | -c "ssl_handshake() returned" \ |
| 1244 | -c "error" \ |
| 1245 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1246 | |
| 1247 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1248 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1249 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1250 | allow_legacy=0" \ |
| 1251 | 1 \ |
| 1252 | -c "client hello, adding renegotiation extension" \ |
| 1253 | -C "found renegotiation extension" \ |
| 1254 | -c "=> renegotiate" \ |
| 1255 | -c "ssl_handshake() returned" \ |
| 1256 | -c "error" \ |
| 1257 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1258 | |
| 1259 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1260 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1261 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1262 | allow_legacy=1" \ |
| 1263 | 0 \ |
| 1264 | -c "client hello, adding renegotiation extension" \ |
| 1265 | -C "found renegotiation extension" \ |
| 1266 | -c "=> renegotiate" \ |
| 1267 | -C "ssl_hanshake() returned" \ |
| 1268 | -C "error" \ |
| 1269 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1270 | |
| 1271 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 1272 | |
| 1273 | run_test "Renego ext: gnutls server strict, client default" \ |
| 1274 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1275 | "$P_CLI debug_level=3" \ |
| 1276 | 0 \ |
| 1277 | -c "found renegotiation extension" \ |
| 1278 | -C "error" \ |
| 1279 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1280 | |
| 1281 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 1282 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1283 | "$P_CLI debug_level=3" \ |
| 1284 | 0 \ |
| 1285 | -C "found renegotiation extension" \ |
| 1286 | -C "error" \ |
| 1287 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1288 | |
| 1289 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 1290 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1291 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 1292 | 1 \ |
| 1293 | -C "found renegotiation extension" \ |
| 1294 | -c "error" \ |
| 1295 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1296 | |
| 1297 | run_test "Renego ext: gnutls client strict, server default" \ |
| 1298 | "$P_SRV debug_level=3" \ |
| 1299 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1300 | 0 \ |
| 1301 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1302 | -s "server hello, secure renegotiation extension" |
| 1303 | |
| 1304 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 1305 | "$P_SRV debug_level=3" \ |
| 1306 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1307 | 0 \ |
| 1308 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1309 | -S "server hello, secure renegotiation extension" |
| 1310 | |
| 1311 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 1312 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 1313 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1314 | 1 \ |
| 1315 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1316 | -S "server hello, secure renegotiation extension" |
| 1317 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1318 | # Tests for auth_mode |
| 1319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1320 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1321 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1322 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1323 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1324 | 1 \ |
| 1325 | -c "x509_verify_cert() returned" \ |
| 1326 | -c "! self-signed or not signed by a trusted CA" \ |
| 1327 | -c "! ssl_handshake returned" \ |
| 1328 | -c "X509 - Certificate verification failed" |
| 1329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1330 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1331 | "$P_SRV 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" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1333 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1334 | 0 \ |
| 1335 | -c "x509_verify_cert() returned" \ |
| 1336 | -c "! self-signed or not signed by a trusted CA" \ |
| 1337 | -C "! ssl_handshake returned" \ |
| 1338 | -C "X509 - Certificate verification failed" |
| 1339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1340 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1341 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1342 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1343 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1344 | 0 \ |
| 1345 | -C "x509_verify_cert() returned" \ |
| 1346 | -C "! self-signed or not signed by a trusted CA" \ |
| 1347 | -C "! ssl_handshake returned" \ |
| 1348 | -C "X509 - Certificate verification failed" |
| 1349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1350 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1351 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 1352 | "$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] | 1353 | key_file=data_files/server5.key" \ |
| 1354 | 1 \ |
| 1355 | -S "skip write certificate request" \ |
| 1356 | -C "skip parse certificate request" \ |
| 1357 | -c "got a certificate request" \ |
| 1358 | -C "skip write certificate" \ |
| 1359 | -C "skip write certificate verify" \ |
| 1360 | -S "skip parse certificate verify" \ |
| 1361 | -s "x509_verify_cert() returned" \ |
| 1362 | -S "! self-signed or not signed by a trusted CA" \ |
| 1363 | -s "! ssl_handshake returned" \ |
| 1364 | -c "! ssl_handshake returned" \ |
| 1365 | -s "X509 - Certificate verification failed" |
| 1366 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1367 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1368 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1369 | "$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] | 1370 | key_file=data_files/server5.key" \ |
| 1371 | 0 \ |
| 1372 | -S "skip write certificate request" \ |
| 1373 | -C "skip parse certificate request" \ |
| 1374 | -c "got a certificate request" \ |
| 1375 | -C "skip write certificate" \ |
| 1376 | -C "skip write certificate verify" \ |
| 1377 | -S "skip parse certificate verify" \ |
| 1378 | -s "x509_verify_cert() returned" \ |
| 1379 | -s "! self-signed or not signed by a trusted CA" \ |
| 1380 | -S "! ssl_handshake returned" \ |
| 1381 | -C "! ssl_handshake returned" \ |
| 1382 | -S "X509 - Certificate verification failed" |
| 1383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1384 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1385 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1386 | "$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] | 1387 | key_file=data_files/server5.key" \ |
| 1388 | 0 \ |
| 1389 | -s "skip write certificate request" \ |
| 1390 | -C "skip parse certificate request" \ |
| 1391 | -c "got no certificate request" \ |
| 1392 | -c "skip write certificate" \ |
| 1393 | -c "skip write certificate verify" \ |
| 1394 | -s "skip parse certificate verify" \ |
| 1395 | -S "x509_verify_cert() returned" \ |
| 1396 | -S "! self-signed or not signed by a trusted CA" \ |
| 1397 | -S "! ssl_handshake returned" \ |
| 1398 | -C "! ssl_handshake returned" \ |
| 1399 | -S "X509 - Certificate verification failed" |
| 1400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1401 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1402 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1403 | "$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] | 1404 | 0 \ |
| 1405 | -S "skip write certificate request" \ |
| 1406 | -C "skip parse certificate request" \ |
| 1407 | -c "got a certificate request" \ |
| 1408 | -C "skip write certificate$" \ |
| 1409 | -C "got no certificate to send" \ |
| 1410 | -S "SSLv3 client has no certificate" \ |
| 1411 | -c "skip write certificate verify" \ |
| 1412 | -s "skip parse certificate verify" \ |
| 1413 | -s "! no client certificate sent" \ |
| 1414 | -S "! ssl_handshake returned" \ |
| 1415 | -C "! ssl_handshake returned" \ |
| 1416 | -S "X509 - Certificate verification failed" |
| 1417 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1418 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1419 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1420 | "$O_CLI" \ |
| 1421 | 0 \ |
| 1422 | -S "skip write certificate request" \ |
| 1423 | -s "skip parse certificate verify" \ |
| 1424 | -s "! no client certificate sent" \ |
| 1425 | -S "! ssl_handshake returned" \ |
| 1426 | -S "X509 - Certificate verification failed" |
| 1427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1428 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1429 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1430 | "$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] | 1431 | 0 \ |
| 1432 | -C "skip parse certificate request" \ |
| 1433 | -c "got a certificate request" \ |
| 1434 | -C "skip write certificate$" \ |
| 1435 | -c "skip write certificate verify" \ |
| 1436 | -C "! ssl_handshake returned" |
| 1437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1438 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1439 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 1440 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1441 | 0 \ |
| 1442 | -S "skip write certificate request" \ |
| 1443 | -C "skip parse certificate request" \ |
| 1444 | -c "got a certificate request" \ |
| 1445 | -C "skip write certificate$" \ |
| 1446 | -c "skip write certificate verify" \ |
| 1447 | -c "got no certificate to send" \ |
| 1448 | -s "SSLv3 client has no certificate" \ |
| 1449 | -s "skip parse certificate verify" \ |
| 1450 | -s "! no client certificate sent" \ |
| 1451 | -S "! ssl_handshake returned" \ |
| 1452 | -C "! ssl_handshake returned" \ |
| 1453 | -S "X509 - Certificate verification failed" |
| 1454 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 1455 | # Tests for certificate selection based on SHA verson |
| 1456 | |
| 1457 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 1458 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1459 | key_file=data_files/server5.key \ |
| 1460 | crt_file2=data_files/server5-sha1.crt \ |
| 1461 | key_file2=data_files/server5.key" \ |
| 1462 | "$P_CLI force_version=tls1_2" \ |
| 1463 | 0 \ |
| 1464 | -c "signed using.*ECDSA with SHA256" \ |
| 1465 | -C "signed using.*ECDSA with SHA1" |
| 1466 | |
| 1467 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 1468 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1469 | key_file=data_files/server5.key \ |
| 1470 | crt_file2=data_files/server5-sha1.crt \ |
| 1471 | key_file2=data_files/server5.key" \ |
| 1472 | "$P_CLI force_version=tls1_1" \ |
| 1473 | 0 \ |
| 1474 | -C "signed using.*ECDSA with SHA256" \ |
| 1475 | -c "signed using.*ECDSA with SHA1" |
| 1476 | |
| 1477 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 1478 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1479 | key_file=data_files/server5.key \ |
| 1480 | crt_file2=data_files/server5-sha1.crt \ |
| 1481 | key_file2=data_files/server5.key" \ |
| 1482 | "$P_CLI force_version=tls1" \ |
| 1483 | 0 \ |
| 1484 | -C "signed using.*ECDSA with SHA256" \ |
| 1485 | -c "signed using.*ECDSA with SHA1" |
| 1486 | |
| 1487 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 1488 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1489 | key_file=data_files/server5.key \ |
| 1490 | crt_file2=data_files/server6.crt \ |
| 1491 | key_file2=data_files/server6.key" \ |
| 1492 | "$P_CLI force_version=tls1_1" \ |
| 1493 | 0 \ |
| 1494 | -c "serial number.*09" \ |
| 1495 | -c "signed using.*ECDSA with SHA256" \ |
| 1496 | -C "signed using.*ECDSA with SHA1" |
| 1497 | |
| 1498 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 1499 | "$P_SRV crt_file=data_files/server6.crt \ |
| 1500 | key_file=data_files/server6.key \ |
| 1501 | crt_file2=data_files/server5.crt \ |
| 1502 | key_file2=data_files/server5.key" \ |
| 1503 | "$P_CLI force_version=tls1_1" \ |
| 1504 | 0 \ |
| 1505 | -c "serial number.*0A" \ |
| 1506 | -c "signed using.*ECDSA with SHA256" \ |
| 1507 | -C "signed using.*ECDSA with SHA1" |
| 1508 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1509 | # tests for SNI |
| 1510 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1511 | run_test "SNI: no SNI callback" \ |
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 | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1514 | "$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] | 1515 | server_name=localhost" \ |
| 1516 | 0 \ |
| 1517 | -S "parse ServerName extension" \ |
| 1518 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1519 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1521 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1522 | "$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] | 1523 | 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] | 1524 | 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] | 1525 | "$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] | 1526 | server_name=localhost" \ |
| 1527 | 0 \ |
| 1528 | -s "parse ServerName extension" \ |
| 1529 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1530 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1531 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1532 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1533 | "$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] | 1534 | 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] | 1535 | 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] | 1536 | "$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] | 1537 | server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1538 | 0 \ |
| 1539 | -s "parse ServerName extension" \ |
| 1540 | -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] | 1541 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1543 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1544 | "$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] | 1545 | 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] | 1546 | 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] | 1547 | "$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] | 1548 | server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1549 | 1 \ |
| 1550 | -s "parse ServerName extension" \ |
| 1551 | -s "ssl_sni_wrapper() returned" \ |
| 1552 | -s "ssl_handshake returned" \ |
| 1553 | -c "ssl_handshake returned" \ |
| 1554 | -c "SSL - A fatal alert message was received from our peer" |
| 1555 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1556 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1557 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1558 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1559 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1560 | "$P_CLI nbio=2 tickets=0" \ |
| 1561 | 0 \ |
| 1562 | -S "ssl_handshake returned" \ |
| 1563 | -C "ssl_handshake returned" \ |
| 1564 | -c "Read from server: .* bytes read" |
| 1565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1566 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1567 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1568 | "$P_CLI nbio=2 tickets=0" \ |
| 1569 | 0 \ |
| 1570 | -S "ssl_handshake returned" \ |
| 1571 | -C "ssl_handshake returned" \ |
| 1572 | -c "Read from server: .* bytes read" |
| 1573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1574 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1575 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1576 | "$P_CLI nbio=2 tickets=1" \ |
| 1577 | 0 \ |
| 1578 | -S "ssl_handshake returned" \ |
| 1579 | -C "ssl_handshake returned" \ |
| 1580 | -c "Read from server: .* bytes read" |
| 1581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1582 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1583 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1584 | "$P_CLI nbio=2 tickets=1" \ |
| 1585 | 0 \ |
| 1586 | -S "ssl_handshake returned" \ |
| 1587 | -C "ssl_handshake returned" \ |
| 1588 | -c "Read from server: .* bytes read" |
| 1589 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1590 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1591 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1592 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1593 | 0 \ |
| 1594 | -S "ssl_handshake returned" \ |
| 1595 | -C "ssl_handshake returned" \ |
| 1596 | -c "Read from server: .* bytes read" |
| 1597 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1598 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1599 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1600 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1601 | 0 \ |
| 1602 | -S "ssl_handshake returned" \ |
| 1603 | -C "ssl_handshake returned" \ |
| 1604 | -c "Read from server: .* bytes read" |
| 1605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1606 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1607 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1608 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1609 | 0 \ |
| 1610 | -S "ssl_handshake returned" \ |
| 1611 | -C "ssl_handshake returned" \ |
| 1612 | -c "Read from server: .* bytes read" |
| 1613 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1614 | # Tests for version negotiation |
| 1615 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1616 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1617 | "$P_SRV" \ |
| 1618 | "$P_CLI" \ |
| 1619 | 0 \ |
| 1620 | -S "ssl_handshake returned" \ |
| 1621 | -C "ssl_handshake returned" \ |
| 1622 | -s "Protocol is TLSv1.2" \ |
| 1623 | -c "Protocol is TLSv1.2" |
| 1624 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1625 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1626 | "$P_SRV" \ |
| 1627 | "$P_CLI max_version=tls1_1" \ |
| 1628 | 0 \ |
| 1629 | -S "ssl_handshake returned" \ |
| 1630 | -C "ssl_handshake returned" \ |
| 1631 | -s "Protocol is TLSv1.1" \ |
| 1632 | -c "Protocol is TLSv1.1" |
| 1633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1634 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1635 | "$P_SRV max_version=tls1_1" \ |
| 1636 | "$P_CLI" \ |
| 1637 | 0 \ |
| 1638 | -S "ssl_handshake returned" \ |
| 1639 | -C "ssl_handshake returned" \ |
| 1640 | -s "Protocol is TLSv1.1" \ |
| 1641 | -c "Protocol is TLSv1.1" |
| 1642 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1643 | 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] | 1644 | "$P_SRV max_version=tls1_1" \ |
| 1645 | "$P_CLI max_version=tls1_1" \ |
| 1646 | 0 \ |
| 1647 | -S "ssl_handshake returned" \ |
| 1648 | -C "ssl_handshake returned" \ |
| 1649 | -s "Protocol is TLSv1.1" \ |
| 1650 | -c "Protocol is TLSv1.1" |
| 1651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1652 | 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] | 1653 | "$P_SRV min_version=tls1_1" \ |
| 1654 | "$P_CLI max_version=tls1_1" \ |
| 1655 | 0 \ |
| 1656 | -S "ssl_handshake returned" \ |
| 1657 | -C "ssl_handshake returned" \ |
| 1658 | -s "Protocol is TLSv1.1" \ |
| 1659 | -c "Protocol is TLSv1.1" |
| 1660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1661 | 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] | 1662 | "$P_SRV max_version=tls1_1" \ |
| 1663 | "$P_CLI min_version=tls1_1" \ |
| 1664 | 0 \ |
| 1665 | -S "ssl_handshake returned" \ |
| 1666 | -C "ssl_handshake returned" \ |
| 1667 | -s "Protocol is TLSv1.1" \ |
| 1668 | -c "Protocol is TLSv1.1" |
| 1669 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1670 | 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] | 1671 | "$P_SRV max_version=tls1_1" \ |
| 1672 | "$P_CLI min_version=tls1_2" \ |
| 1673 | 1 \ |
| 1674 | -s "ssl_handshake returned" \ |
| 1675 | -c "ssl_handshake returned" \ |
| 1676 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1678 | 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] | 1679 | "$P_SRV min_version=tls1_2" \ |
| 1680 | "$P_CLI max_version=tls1_1" \ |
| 1681 | 1 \ |
| 1682 | -s "ssl_handshake returned" \ |
| 1683 | -c "ssl_handshake returned" \ |
| 1684 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1685 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1686 | # Tests for ALPN extension |
| 1687 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1688 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1690 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1691 | "$P_SRV debug_level=3" \ |
| 1692 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1693 | 0 \ |
| 1694 | -C "client hello, adding alpn extension" \ |
| 1695 | -S "found alpn extension" \ |
| 1696 | -C "got an alert message, type: \\[2:120]" \ |
| 1697 | -S "server hello, adding alpn extension" \ |
| 1698 | -C "found alpn extension " \ |
| 1699 | -C "Application Layer Protocol is" \ |
| 1700 | -S "Application Layer Protocol is" |
| 1701 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1702 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1703 | "$P_SRV debug_level=3" \ |
| 1704 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1705 | 0 \ |
| 1706 | -c "client hello, adding alpn extension" \ |
| 1707 | -s "found alpn extension" \ |
| 1708 | -C "got an alert message, type: \\[2:120]" \ |
| 1709 | -S "server hello, adding alpn extension" \ |
| 1710 | -C "found alpn extension " \ |
| 1711 | -c "Application Layer Protocol is (none)" \ |
| 1712 | -S "Application Layer Protocol is" |
| 1713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1714 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1715 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1716 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1717 | 0 \ |
| 1718 | -C "client hello, adding alpn extension" \ |
| 1719 | -S "found alpn extension" \ |
| 1720 | -C "got an alert message, type: \\[2:120]" \ |
| 1721 | -S "server hello, adding alpn extension" \ |
| 1722 | -C "found alpn extension " \ |
| 1723 | -C "Application Layer Protocol is" \ |
| 1724 | -s "Application Layer Protocol is (none)" |
| 1725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1726 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1727 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1728 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1729 | 0 \ |
| 1730 | -c "client hello, adding alpn extension" \ |
| 1731 | -s "found alpn extension" \ |
| 1732 | -C "got an alert message, type: \\[2:120]" \ |
| 1733 | -s "server hello, adding alpn extension" \ |
| 1734 | -c "found alpn extension" \ |
| 1735 | -c "Application Layer Protocol is abc" \ |
| 1736 | -s "Application Layer Protocol is abc" |
| 1737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1738 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1739 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1740 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1741 | 0 \ |
| 1742 | -c "client hello, adding alpn extension" \ |
| 1743 | -s "found alpn extension" \ |
| 1744 | -C "got an alert message, type: \\[2:120]" \ |
| 1745 | -s "server hello, adding alpn extension" \ |
| 1746 | -c "found alpn extension" \ |
| 1747 | -c "Application Layer Protocol is abc" \ |
| 1748 | -s "Application Layer Protocol is abc" |
| 1749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1750 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1751 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1752 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1753 | 0 \ |
| 1754 | -c "client hello, adding alpn extension" \ |
| 1755 | -s "found alpn extension" \ |
| 1756 | -C "got an alert message, type: \\[2:120]" \ |
| 1757 | -s "server hello, adding alpn extension" \ |
| 1758 | -c "found alpn extension" \ |
| 1759 | -c "Application Layer Protocol is 1234" \ |
| 1760 | -s "Application Layer Protocol is 1234" |
| 1761 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1762 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1763 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1764 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1765 | 1 \ |
| 1766 | -c "client hello, adding alpn extension" \ |
| 1767 | -s "found alpn extension" \ |
| 1768 | -c "got an alert message, type: \\[2:120]" \ |
| 1769 | -S "server hello, adding alpn extension" \ |
| 1770 | -C "found alpn extension" \ |
| 1771 | -C "Application Layer Protocol is 1234" \ |
| 1772 | -S "Application Layer Protocol is 1234" |
| 1773 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1774 | fi |
| 1775 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1776 | # Tests for keyUsage in leaf certificates, part 1: |
| 1777 | # server-side certificate/suite selection |
| 1778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1779 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1780 | "$P_SRV key_file=data_files/server2.key \ |
| 1781 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1782 | "$P_CLI" \ |
| 1783 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1784 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1785 | |
| 1786 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1787 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1788 | "$P_SRV key_file=data_files/server2.key \ |
| 1789 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1790 | "$P_CLI" \ |
| 1791 | 0 \ |
| 1792 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1793 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1794 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1795 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1796 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1797 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1798 | 1 \ |
| 1799 | -C "Ciphersuite is " |
| 1800 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1801 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1802 | "$P_SRV key_file=data_files/server5.key \ |
| 1803 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1804 | "$P_CLI" \ |
| 1805 | 0 \ |
| 1806 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1807 | |
| 1808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1809 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1810 | "$P_SRV key_file=data_files/server5.key \ |
| 1811 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1812 | "$P_CLI" \ |
| 1813 | 0 \ |
| 1814 | -c "Ciphersuite is TLS-ECDH-" |
| 1815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1816 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1817 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1818 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1819 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1820 | 1 \ |
| 1821 | -C "Ciphersuite is " |
| 1822 | |
| 1823 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1824 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1826 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1827 | "$O_SRV -key data_files/server2.key \ |
| 1828 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1829 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1830 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1831 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1832 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1833 | -C "Processing of the Certificate handshake message failed" \ |
| 1834 | -c "Ciphersuite is TLS-" |
| 1835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1836 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1837 | "$O_SRV -key data_files/server2.key \ |
| 1838 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1839 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1840 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1841 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1842 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1843 | -C "Processing of the Certificate handshake message failed" \ |
| 1844 | -c "Ciphersuite is TLS-" |
| 1845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1846 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1847 | "$O_SRV -key data_files/server2.key \ |
| 1848 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1849 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1850 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1851 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1852 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1853 | -C "Processing of the Certificate handshake message failed" \ |
| 1854 | -c "Ciphersuite is TLS-" |
| 1855 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1856 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1857 | "$O_SRV -key data_files/server2.key \ |
| 1858 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1859 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1860 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1861 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1862 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1863 | -c "Processing of the Certificate handshake message failed" \ |
| 1864 | -C "Ciphersuite is TLS-" |
| 1865 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1866 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1867 | "$O_SRV -key data_files/server2.key \ |
| 1868 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1869 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1870 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1871 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1872 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1873 | -C "Processing of the Certificate handshake message failed" \ |
| 1874 | -c "Ciphersuite is TLS-" |
| 1875 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1876 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1877 | "$O_SRV -key data_files/server2.key \ |
| 1878 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1879 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1880 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1881 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1882 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1883 | -c "Processing of the Certificate handshake message failed" \ |
| 1884 | -C "Ciphersuite is TLS-" |
| 1885 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1886 | # Tests for keyUsage in leaf certificates, part 3: |
| 1887 | # server-side checking of client cert |
| 1888 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1889 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1890 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1891 | "$O_CLI -key data_files/server2.key \ |
| 1892 | -cert data_files/server2.ku-ds.crt" \ |
| 1893 | 0 \ |
| 1894 | -S "bad certificate (usage extensions)" \ |
| 1895 | -S "Processing of the Certificate handshake message failed" |
| 1896 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1897 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1898 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1899 | "$O_CLI -key data_files/server2.key \ |
| 1900 | -cert data_files/server2.ku-ke.crt" \ |
| 1901 | 0 \ |
| 1902 | -s "bad certificate (usage extensions)" \ |
| 1903 | -S "Processing of the Certificate handshake message failed" |
| 1904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1905 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1906 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1907 | "$O_CLI -key data_files/server2.key \ |
| 1908 | -cert data_files/server2.ku-ke.crt" \ |
| 1909 | 1 \ |
| 1910 | -s "bad certificate (usage extensions)" \ |
| 1911 | -s "Processing of the Certificate handshake message failed" |
| 1912 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1913 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1914 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1915 | "$O_CLI -key data_files/server5.key \ |
| 1916 | -cert data_files/server5.ku-ds.crt" \ |
| 1917 | 0 \ |
| 1918 | -S "bad certificate (usage extensions)" \ |
| 1919 | -S "Processing of the Certificate handshake message failed" |
| 1920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1921 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1922 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1923 | "$O_CLI -key data_files/server5.key \ |
| 1924 | -cert data_files/server5.ku-ka.crt" \ |
| 1925 | 0 \ |
| 1926 | -s "bad certificate (usage extensions)" \ |
| 1927 | -S "Processing of the Certificate handshake message failed" |
| 1928 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1929 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1930 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1931 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1932 | "$P_SRV key_file=data_files/server5.key \ |
| 1933 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1934 | "$P_CLI" \ |
| 1935 | 0 |
| 1936 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1937 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1938 | "$P_SRV key_file=data_files/server5.key \ |
| 1939 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1940 | "$P_CLI" \ |
| 1941 | 0 |
| 1942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1943 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1944 | "$P_SRV key_file=data_files/server5.key \ |
| 1945 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1946 | "$P_CLI" \ |
| 1947 | 0 |
| 1948 | |
| 1949 | # 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] | 1950 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1951 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1952 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1953 | "$P_CLI psk=badbad" \ |
| 1954 | 1 |
| 1955 | |
| 1956 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1957 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1958 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1959 | "$O_SRV -key data_files/server5.key \ |
| 1960 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1961 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1962 | 0 \ |
| 1963 | -C "bad certificate (usage extensions)" \ |
| 1964 | -C "Processing of the Certificate handshake message failed" \ |
| 1965 | -c "Ciphersuite is TLS-" |
| 1966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1967 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1968 | "$O_SRV -key data_files/server5.key \ |
| 1969 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1970 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1971 | 0 \ |
| 1972 | -C "bad certificate (usage extensions)" \ |
| 1973 | -C "Processing of the Certificate handshake message failed" \ |
| 1974 | -c "Ciphersuite is TLS-" |
| 1975 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1976 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1977 | "$O_SRV -key data_files/server5.key \ |
| 1978 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1979 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1980 | 0 \ |
| 1981 | -C "bad certificate (usage extensions)" \ |
| 1982 | -C "Processing of the Certificate handshake message failed" \ |
| 1983 | -c "Ciphersuite is TLS-" |
| 1984 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1985 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1986 | "$O_SRV -key data_files/server5.key \ |
| 1987 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1988 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1989 | 1 \ |
| 1990 | -c "bad certificate (usage extensions)" \ |
| 1991 | -c "Processing of the Certificate handshake message failed" \ |
| 1992 | -C "Ciphersuite is TLS-" |
| 1993 | |
| 1994 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 1995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1996 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1997 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1998 | "$O_CLI -key data_files/server5.key \ |
| 1999 | -cert data_files/server5.eku-cli.crt" \ |
| 2000 | 0 \ |
| 2001 | -S "bad certificate (usage extensions)" \ |
| 2002 | -S "Processing of the Certificate handshake message failed" |
| 2003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2004 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2005 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2006 | "$O_CLI -key data_files/server5.key \ |
| 2007 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 2008 | 0 \ |
| 2009 | -S "bad certificate (usage extensions)" \ |
| 2010 | -S "Processing of the Certificate handshake message failed" |
| 2011 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2012 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2013 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2014 | "$O_CLI -key data_files/server5.key \ |
| 2015 | -cert data_files/server5.eku-cs_any.crt" \ |
| 2016 | 0 \ |
| 2017 | -S "bad certificate (usage extensions)" \ |
| 2018 | -S "Processing of the Certificate handshake message failed" |
| 2019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2020 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2021 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2022 | "$O_CLI -key data_files/server5.key \ |
| 2023 | -cert data_files/server5.eku-cs.crt" \ |
| 2024 | 0 \ |
| 2025 | -s "bad certificate (usage extensions)" \ |
| 2026 | -S "Processing of the Certificate handshake message failed" |
| 2027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2028 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2029 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2030 | "$O_CLI -key data_files/server5.key \ |
| 2031 | -cert data_files/server5.eku-cs.crt" \ |
| 2032 | 1 \ |
| 2033 | -s "bad certificate (usage extensions)" \ |
| 2034 | -s "Processing of the Certificate handshake message failed" |
| 2035 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2036 | # Tests for DHM parameters loading |
| 2037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2038 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2039 | "$P_SRV" \ |
| 2040 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2041 | debug_level=3" \ |
| 2042 | 0 \ |
| 2043 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 2044 | -c "value of 'DHM: G ' (2048 bits)" |
| 2045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2046 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2047 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2048 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2049 | debug_level=3" \ |
| 2050 | 0 \ |
| 2051 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 2052 | -c "value of 'DHM: G ' (2 bits)" |
| 2053 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2054 | # Tests for PSK callback |
| 2055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2056 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2057 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 2058 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2059 | psk_identity=foo psk=abc123" \ |
| 2060 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2061 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2062 | -S "SSL - Unknown identity received" \ |
| 2063 | -S "SSL - Verification of the message MAC failed" |
| 2064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2065 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2066 | "$P_SRV" \ |
| 2067 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2068 | psk_identity=foo psk=abc123" \ |
| 2069 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2070 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2071 | -S "SSL - Unknown identity received" \ |
| 2072 | -S "SSL - Verification of the message MAC failed" |
| 2073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2074 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2075 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 2076 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2077 | psk_identity=foo psk=abc123" \ |
| 2078 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2079 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2080 | -s "SSL - Unknown identity received" \ |
| 2081 | -S "SSL - Verification of the message MAC failed" |
| 2082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2083 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2084 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2085 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2086 | psk_identity=abc psk=dead" \ |
| 2087 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2088 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2089 | -S "SSL - Unknown identity received" \ |
| 2090 | -S "SSL - Verification of the message MAC failed" |
| 2091 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2092 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2093 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2094 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2095 | psk_identity=def psk=beef" \ |
| 2096 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2097 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2098 | -S "SSL - Unknown identity received" \ |
| 2099 | -S "SSL - Verification of the message MAC failed" |
| 2100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2101 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2102 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2103 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2104 | psk_identity=ghi psk=beef" \ |
| 2105 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2106 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2107 | -s "SSL - Unknown identity received" \ |
| 2108 | -S "SSL - Verification of the message MAC failed" |
| 2109 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2110 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2111 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2112 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2113 | psk_identity=abc psk=beef" \ |
| 2114 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2115 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2116 | -S "SSL - Unknown identity received" \ |
| 2117 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2118 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2119 | # Tests for ciphersuites per version |
| 2120 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2121 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2122 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-RC4-128-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2123 | "$P_CLI force_version=ssl3" \ |
| 2124 | 0 \ |
| 2125 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2126 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2127 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2128 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-RC4-128-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2129 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2130 | 0 \ |
| 2131 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 2132 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2133 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2134 | "$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" \ |
| 2135 | "$P_CLI force_version=tls1_1" \ |
| 2136 | 0 \ |
| 2137 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2138 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2139 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2140 | "$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" \ |
| 2141 | "$P_CLI force_version=tls1_2" \ |
| 2142 | 0 \ |
| 2143 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2144 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2145 | # Tests for ssl_get_bytes_avail() |
| 2146 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2147 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2148 | "$P_SRV" \ |
| 2149 | "$P_CLI request_size=100" \ |
| 2150 | 0 \ |
| 2151 | -s "Read from client: 100 bytes read$" |
| 2152 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2153 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2154 | "$P_SRV" \ |
| 2155 | "$P_CLI request_size=500" \ |
| 2156 | 0 \ |
| 2157 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2158 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2159 | # Tests for small packets |
| 2160 | |
| 2161 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2162 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2163 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2164 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2165 | 0 \ |
| 2166 | -s "Read from client: 1 bytes read" |
| 2167 | |
| 2168 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2169 | "$P_SRV min_version=ssl3 arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2170 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2171 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2172 | 0 \ |
| 2173 | -s "Read from client: 1 bytes read" |
| 2174 | |
| 2175 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2176 | "$P_SRV" \ |
| 2177 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2179 | 0 \ |
| 2180 | -s "Read from client: 1 bytes read" |
| 2181 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2182 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2183 | "$P_SRV" \ |
| 2184 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2186 | 0 \ |
| 2187 | -s "Read from client: 1 bytes read" |
| 2188 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2189 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2190 | "$P_SRV" \ |
| 2191 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2192 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2193 | trunc_hmac=1" \ |
| 2194 | 0 \ |
| 2195 | -s "Read from client: 1 bytes read" |
| 2196 | |
| 2197 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2198 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2199 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2200 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2201 | trunc_hmac=1" \ |
| 2202 | 0 \ |
| 2203 | -s "Read from client: 1 bytes read" |
| 2204 | |
| 2205 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2206 | "$P_SRV" \ |
| 2207 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2208 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2209 | 0 \ |
| 2210 | -s "Read from client: 1 bytes read" |
| 2211 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2212 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2213 | "$P_SRV" \ |
| 2214 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2216 | 0 \ |
| 2217 | -s "Read from client: 1 bytes read" |
| 2218 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2219 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2220 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2221 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2222 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2223 | 0 \ |
| 2224 | -s "Read from client: 1 bytes read" |
| 2225 | |
| 2226 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2227 | "$P_SRV" \ |
| 2228 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2229 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2230 | trunc_hmac=1" \ |
| 2231 | 0 \ |
| 2232 | -s "Read from client: 1 bytes read" |
| 2233 | |
| 2234 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2235 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2236 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2237 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2238 | trunc_hmac=1" \ |
| 2239 | 0 \ |
| 2240 | -s "Read from client: 1 bytes read" |
| 2241 | |
| 2242 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2243 | "$P_SRV" \ |
| 2244 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2246 | 0 \ |
| 2247 | -s "Read from client: 1 bytes read" |
| 2248 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2249 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2250 | "$P_SRV" \ |
| 2251 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2252 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2253 | 0 \ |
| 2254 | -s "Read from client: 1 bytes read" |
| 2255 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2256 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2257 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2258 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2259 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2260 | 0 \ |
| 2261 | -s "Read from client: 1 bytes read" |
| 2262 | |
| 2263 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2264 | "$P_SRV" \ |
| 2265 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2266 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2267 | trunc_hmac=1" \ |
| 2268 | 0 \ |
| 2269 | -s "Read from client: 1 bytes read" |
| 2270 | |
| 2271 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2272 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2273 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2274 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2275 | 0 \ |
| 2276 | -s "Read from client: 1 bytes read" |
| 2277 | |
| 2278 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2279 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2280 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2281 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2282 | trunc_hmac=1" \ |
| 2283 | 0 \ |
| 2284 | -s "Read from client: 1 bytes read" |
| 2285 | |
| 2286 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2287 | "$P_SRV" \ |
| 2288 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2289 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2290 | 0 \ |
| 2291 | -s "Read from client: 1 bytes read" |
| 2292 | |
| 2293 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2294 | "$P_SRV" \ |
| 2295 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2296 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2297 | 0 \ |
| 2298 | -s "Read from client: 1 bytes read" |
| 2299 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2300 | # Test for large packets |
| 2301 | |
| 2302 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2303 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2304 | "$P_CLI request_size=16384 force_version=ssl3 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 | 0 \ |
| 2307 | -s "Read from client: 16384 bytes read" |
| 2308 | |
| 2309 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2310 | "$P_SRV min_version=ssl3 arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2311 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2312 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2313 | 0 \ |
| 2314 | -s "Read from client: 16384 bytes read" |
| 2315 | |
| 2316 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2317 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2318 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2319 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2320 | 0 \ |
| 2321 | -s "Read from client: 16384 bytes read" |
| 2322 | |
| 2323 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2324 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2325 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2326 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2327 | trunc_hmac=1" \ |
| 2328 | 0 \ |
| 2329 | -s "Read from client: 16384 bytes read" |
| 2330 | |
| 2331 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2332 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2333 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2334 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2335 | trunc_hmac=1" \ |
| 2336 | 0 \ |
| 2337 | -s "Read from client: 16384 bytes read" |
| 2338 | |
| 2339 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2340 | "$P_SRV" \ |
| 2341 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2342 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2343 | 0 \ |
| 2344 | -s "Read from client: 16384 bytes read" |
| 2345 | |
| 2346 | run_test "Large packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2347 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2348 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2349 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2350 | 0 \ |
| 2351 | -s "Read from client: 16384 bytes read" |
| 2352 | |
| 2353 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2354 | "$P_SRV" \ |
| 2355 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2356 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2357 | trunc_hmac=1" \ |
| 2358 | 0 \ |
| 2359 | -s "Read from client: 16384 bytes read" |
| 2360 | |
| 2361 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2362 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2363 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2364 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2365 | trunc_hmac=1" \ |
| 2366 | 0 \ |
| 2367 | -s "Read from client: 16384 bytes read" |
| 2368 | |
| 2369 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2370 | "$P_SRV" \ |
| 2371 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2372 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2373 | 0 \ |
| 2374 | -s "Read from client: 16384 bytes read" |
| 2375 | |
| 2376 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2377 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2378 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2379 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2380 | 0 \ |
| 2381 | -s "Read from client: 16384 bytes read" |
| 2382 | |
| 2383 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2384 | "$P_SRV" \ |
| 2385 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2386 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2387 | trunc_hmac=1" \ |
| 2388 | 0 \ |
| 2389 | -s "Read from client: 16384 bytes read" |
| 2390 | |
| 2391 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2392 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2393 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2394 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2395 | 0 \ |
| 2396 | -s "Read from client: 16384 bytes read" |
| 2397 | |
| 2398 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2399 | "$P_SRV arc4=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2400 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2401 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2402 | trunc_hmac=1" \ |
| 2403 | 0 \ |
| 2404 | -s "Read from client: 16384 bytes read" |
| 2405 | |
| 2406 | run_test "Large packet TLS 1.2 AEAD" \ |
| 2407 | "$P_SRV" \ |
| 2408 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2409 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2410 | 0 \ |
| 2411 | -s "Read from client: 16384 bytes read" |
| 2412 | |
| 2413 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 2414 | "$P_SRV" \ |
| 2415 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2416 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2417 | 0 \ |
| 2418 | -s "Read from client: 16384 bytes read" |
| 2419 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2420 | # Final report |
| 2421 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2422 | echo "------------------------------------------------------------------------" |
| 2423 | |
| 2424 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2425 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2426 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2427 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2428 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 2429 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2430 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2431 | |
| 2432 | exit $FAILS |