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