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