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