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