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