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 | # |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9 | # Assumes a build with default options. |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 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 | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 16 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 17 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 18 | : ${GNUTLS_CLI:=gnutls-cli} |
| 19 | : ${GNUTLS_SERV:=gnutls-serv} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 21 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 22 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 23 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 24 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 25 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 26 | TESTS=0 |
| 27 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 28 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 29 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 30 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 31 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 32 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 33 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 34 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 35 | |
| 36 | print_usage() { |
| 37 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 38 | printf " -h|--help\tPrint this help.\n" |
| 39 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
| 40 | printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n" |
| 41 | printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | get_options() { |
| 45 | while [ $# -gt 0 ]; do |
| 46 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 47 | -f|--filter) |
| 48 | shift; FILTER=$1 |
| 49 | ;; |
| 50 | -e|--exclude) |
| 51 | shift; EXCLUDE=$1 |
| 52 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 53 | -m|--memcheck) |
| 54 | MEMCHECK=1 |
| 55 | ;; |
| 56 | -h|--help) |
| 57 | print_usage |
| 58 | exit 0 |
| 59 | ;; |
| 60 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 61 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 62 | print_usage |
| 63 | exit 1 |
| 64 | ;; |
| 65 | esac |
| 66 | shift |
| 67 | done |
| 68 | } |
| 69 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 70 | # skip next test if the flag is not enabled in config.h |
| 71 | requires_config_enabled() { |
| 72 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 73 | SKIP_NEXT="YES" |
| 74 | fi |
| 75 | } |
| 76 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 77 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 78 | requires_openssl_with_fallback_scsv() { |
| 79 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 80 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 81 | then |
| 82 | OPENSSL_HAS_FBSCSV="YES" |
| 83 | else |
| 84 | OPENSSL_HAS_FBSCSV="NO" |
| 85 | fi |
| 86 | fi |
| 87 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 88 | SKIP_NEXT="YES" |
| 89 | fi |
| 90 | } |
| 91 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 92 | # skip next test if GnuTLS isn't available |
| 93 | requires_gnutls() { |
| 94 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 95 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 96 | GNUTLS_AVAILABLE="YES" |
| 97 | else |
| 98 | GNUTLS_AVAILABLE="NO" |
| 99 | fi |
| 100 | fi |
| 101 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 102 | SKIP_NEXT="YES" |
| 103 | fi |
| 104 | } |
| 105 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 106 | # skip next test if IPv6 isn't available on this host |
| 107 | requires_ipv6() { |
| 108 | if [ -z "${HAS_IPV6:-}" ]; then |
| 109 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 110 | SRV_PID=$! |
| 111 | sleep 1 |
| 112 | kill $SRV_PID >/dev/null 2>&1 |
| 113 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 114 | HAS_IPV6="NO" |
| 115 | else |
| 116 | HAS_IPV6="YES" |
| 117 | fi |
| 118 | rm -r $SRV_OUT |
| 119 | fi |
| 120 | |
| 121 | if [ "$HAS_IPV6" = "NO" ]; then |
| 122 | SKIP_NEXT="YES" |
| 123 | fi |
| 124 | } |
| 125 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 126 | # skip the next test if valgrind is in use |
| 127 | not_with_valgrind() { |
| 128 | if [ "$MEMCHECK" -gt 0 ]; then |
| 129 | SKIP_NEXT="YES" |
| 130 | fi |
| 131 | } |
| 132 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 133 | # multiply the client timeout delay by the given factor for the next test |
| 134 | needs_more_time() { |
| 135 | CLI_DELAY_FACTOR=$1 |
| 136 | } |
| 137 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 138 | # print_name <name> |
| 139 | print_name() { |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 140 | printf "$1 " |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 141 | LEN=$(( 72 - `echo "$1" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 142 | for i in `seq 1 $LEN`; do printf '.'; done |
| 143 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 144 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 145 | TESTS=$(( $TESTS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | # fail <message> |
| 149 | fail() { |
| 150 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 151 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 152 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 153 | mv $SRV_OUT o-srv-${TESTS}.log |
| 154 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 155 | if [ -n "$PXY_CMD" ]; then |
| 156 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 157 | fi |
| 158 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 159 | |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 160 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot ]; then |
| 161 | echo " ! server output:" |
| 162 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 163 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 164 | echo " ! client output:" |
| 165 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 166 | if [ -n "$PXY_CMD" ]; then |
| 167 | echo " ! ========================================================" |
| 168 | echo " ! proxy output:" |
| 169 | cat o-pxy-${TESTS}.log |
| 170 | fi |
| 171 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 172 | fi |
| 173 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 174 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 175 | } |
| 176 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 177 | # is_polar <cmd_line> |
| 178 | is_polar() { |
| 179 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 180 | } |
| 181 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 182 | # openssl s_server doesn't have -www with DTLS |
| 183 | check_osrv_dtls() { |
| 184 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 185 | NEEDS_INPUT=1 |
| 186 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 187 | else |
| 188 | NEEDS_INPUT=0 |
| 189 | fi |
| 190 | } |
| 191 | |
| 192 | # provide input to commands that need it |
| 193 | provide_input() { |
| 194 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 195 | return |
| 196 | fi |
| 197 | |
| 198 | while true; do |
| 199 | echo "HTTP/1.0 200 OK" |
| 200 | sleep 1 |
| 201 | done |
| 202 | } |
| 203 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 204 | # has_mem_err <log_file_name> |
| 205 | has_mem_err() { |
| 206 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 207 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 208 | then |
| 209 | return 1 # false: does not have errors |
| 210 | else |
| 211 | return 0 # true: has errors |
| 212 | fi |
| 213 | } |
| 214 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 215 | # wait for server to start: two versions depending on lsof availability |
| 216 | wait_server_start() { |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 217 | if which lsof >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 218 | START_TIME=$( date +%s ) |
| 219 | DONE=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 220 | |
| 221 | # make a tight loop, server usually takes less than 1 sec to start |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 222 | if [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 223 | while [ $DONE -eq 0 ]; do |
| 224 | if lsof -nbi UDP:"$SRV_PORT" 2>/dev/null | grep UDP >/dev/null |
| 225 | then |
| 226 | DONE=1 |
| 227 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 228 | echo "SERVERSTART TIMEOUT" |
| 229 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 230 | DONE=1 |
| 231 | fi |
| 232 | done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 233 | else |
Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 234 | while [ $DONE -eq 0 ]; do |
| 235 | if lsof -nbi TCP:"$SRV_PORT" 2>/dev/null | grep LISTEN >/dev/null |
| 236 | then |
| 237 | DONE=1 |
| 238 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 239 | echo "SERVERSTART TIMEOUT" |
| 240 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 241 | DONE=1 |
| 242 | fi |
| 243 | done |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 244 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 245 | else |
| 246 | sleep "$START_DELAY" |
| 247 | fi |
| 248 | } |
| 249 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 250 | # wait for client to terminate and set CLI_EXIT |
| 251 | # must be called right after starting the client |
| 252 | wait_client_done() { |
| 253 | CLI_PID=$! |
| 254 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 255 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 256 | CLI_DELAY_FACTOR=1 |
| 257 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 258 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 259 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 260 | |
| 261 | wait $CLI_PID |
| 262 | CLI_EXIT=$? |
| 263 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 264 | kill $DOG_PID >/dev/null 2>&1 |
| 265 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 266 | |
| 267 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
| 268 | } |
| 269 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 270 | # check if the given command uses dtls and sets global variable DTLS |
| 271 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 272 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 273 | DTLS=1 |
| 274 | else |
| 275 | DTLS=0 |
| 276 | fi |
| 277 | } |
| 278 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 279 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 280 | # Options: -s pattern pattern that must be present in server output |
| 281 | # -c pattern pattern that must be present in client output |
| 282 | # -S pattern pattern that must be absent in server output |
| 283 | # -C pattern pattern that must be absent in client output |
| 284 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 285 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 286 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 287 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 288 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 289 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 290 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 291 | return |
| 292 | fi |
| 293 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 294 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 295 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 296 | # should we skip? |
| 297 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 298 | SKIP_NEXT="NO" |
| 299 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 300 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 301 | return |
| 302 | fi |
| 303 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 304 | # does this test use a proxy? |
| 305 | if [ "X$1" = "X-p" ]; then |
| 306 | PXY_CMD="$2" |
| 307 | shift 2 |
| 308 | else |
| 309 | PXY_CMD="" |
| 310 | fi |
| 311 | |
| 312 | # get commands and client output |
| 313 | SRV_CMD="$1" |
| 314 | CLI_CMD="$2" |
| 315 | CLI_EXPECT="$3" |
| 316 | shift 3 |
| 317 | |
| 318 | # fix client port |
| 319 | if [ -n "$PXY_CMD" ]; then |
| 320 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 321 | else |
| 322 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 323 | fi |
| 324 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 325 | # update DTLS variable |
| 326 | detect_dtls "$SRV_CMD" |
| 327 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 328 | # prepend valgrind to our commands if active |
| 329 | if [ "$MEMCHECK" -gt 0 ]; then |
| 330 | if is_polar "$SRV_CMD"; then |
| 331 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 332 | fi |
| 333 | if is_polar "$CLI_CMD"; then |
| 334 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 335 | fi |
| 336 | fi |
| 337 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 338 | TIMES_LEFT=2 |
| 339 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 340 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 341 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 342 | # run the commands |
| 343 | if [ -n "$PXY_CMD" ]; then |
| 344 | echo "$PXY_CMD" > $PXY_OUT |
| 345 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 346 | PXY_PID=$! |
| 347 | # assume proxy starts faster than server |
| 348 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 349 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 350 | check_osrv_dtls |
| 351 | echo "$SRV_CMD" > $SRV_OUT |
| 352 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 353 | SRV_PID=$! |
| 354 | wait_server_start |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 355 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 356 | echo "$CLI_CMD" > $CLI_OUT |
| 357 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 358 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 359 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 360 | # terminate the server (and the proxy) |
| 361 | kill $SRV_PID |
| 362 | wait $SRV_PID |
| 363 | if [ -n "$PXY_CMD" ]; then |
| 364 | kill $PXY_PID >/dev/null 2>&1 |
| 365 | wait $PXY_PID |
| 366 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 367 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 368 | # retry only on timeouts |
| 369 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 370 | printf "RETRY " |
| 371 | else |
| 372 | TIMES_LEFT=0 |
| 373 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 374 | done |
| 375 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 376 | # 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] | 377 | # (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] | 378 | # expected client exit to incorrectly succeed in case of catastrophic |
| 379 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 380 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 381 | 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] | 382 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 383 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 384 | return |
| 385 | fi |
| 386 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 387 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 388 | 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] | 389 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 390 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 391 | return |
| 392 | fi |
| 393 | fi |
| 394 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 395 | # check server exit code |
| 396 | if [ $? != 0 ]; then |
| 397 | fail "server fail" |
| 398 | return |
| 399 | fi |
| 400 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 401 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 402 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 403 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 404 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 405 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 406 | return |
| 407 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 408 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 409 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 410 | # lines beginning with == are added by valgrind, ignore them |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 411 | while [ $# -gt 0 ] |
| 412 | do |
| 413 | case $1 in |
| 414 | "-s") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 415 | 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] | 416 | fail "-s $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 417 | return |
| 418 | fi |
| 419 | ;; |
| 420 | |
| 421 | "-c") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 422 | 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] | 423 | fail "-c $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 424 | return |
| 425 | fi |
| 426 | ;; |
| 427 | |
| 428 | "-S") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 429 | if grep -v '^==' $SRV_OUT | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 430 | fail "-S $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 431 | return |
| 432 | fi |
| 433 | ;; |
| 434 | |
| 435 | "-C") |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 436 | if grep -v '^==' $CLI_OUT | grep "$2" >/dev/null; then |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 437 | fail "-C $2" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 438 | return |
| 439 | fi |
| 440 | ;; |
| 441 | |
| 442 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 443 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 444 | exit 1 |
| 445 | esac |
| 446 | shift 2 |
| 447 | done |
| 448 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 449 | # check valgrind's results |
| 450 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 451 | 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] | 452 | fail "Server has memory errors" |
| 453 | return |
| 454 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 455 | 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] | 456 | fail "Client has memory errors" |
| 457 | return |
| 458 | fi |
| 459 | fi |
| 460 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 461 | # if we're here, everything is ok |
| 462 | echo "PASS" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 463 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 464 | } |
| 465 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 466 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 467 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 468 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 469 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 470 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 471 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 472 | exit 1 |
| 473 | } |
| 474 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 475 | # |
| 476 | # MAIN |
| 477 | # |
| 478 | |
Manuel Pégourié-Gonnard | 19db8ea | 2015-03-10 13:41:04 +0000 | [diff] [blame] | 479 | if cd $( dirname $0 ); then :; else |
| 480 | echo "cd $( dirname $0 ) failed" >&2 |
| 481 | exit 1 |
| 482 | fi |
| 483 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 484 | get_options "$@" |
| 485 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 486 | # sanity checks, avoid an avalanche of errors |
| 487 | if [ ! -x "$P_SRV" ]; then |
| 488 | echo "Command '$P_SRV' is not an executable file" |
| 489 | exit 1 |
| 490 | fi |
| 491 | if [ ! -x "$P_CLI" ]; then |
| 492 | echo "Command '$P_CLI' is not an executable file" |
| 493 | exit 1 |
| 494 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 495 | if [ ! -x "$P_PXY" ]; then |
| 496 | echo "Command '$P_PXY' is not an executable file" |
| 497 | exit 1 |
| 498 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 499 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 500 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 501 | exit 1 |
| 502 | fi |
| 503 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 504 | # used by watchdog |
| 505 | MAIN_PID="$$" |
| 506 | |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 507 | # be more patient with valgrind |
| 508 | if [ "$MEMCHECK" -gt 0 ]; then |
| 509 | START_DELAY=3 |
| 510 | DOG_DELAY=30 |
| 511 | else |
| 512 | START_DELAY=1 |
| 513 | DOG_DELAY=10 |
| 514 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 515 | CLI_DELAY_FACTOR=1 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 516 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 517 | # Pick a "unique" server port in the range 10000-19999, and a proxy port |
| 518 | PORT_BASE="0000$$" |
Manuel Pégourié-Gonnard | 3a173f4 | 2015-01-22 13:30:33 +0000 | [diff] [blame] | 519 | PORT_BASE="$( printf $PORT_BASE | tail -c 4 )" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 520 | SRV_PORT="1$PORT_BASE" |
| 521 | PXY_PORT="2$PORT_BASE" |
| 522 | unset PORT_BASE |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 523 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 524 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 525 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 526 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 527 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 528 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 529 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 530 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 531 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 532 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 533 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 534 | # Also pick a unique name for intermediate files |
| 535 | SRV_OUT="srv_out.$$" |
| 536 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 537 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 538 | SESSION="session.$$" |
| 539 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 540 | SKIP_NEXT="NO" |
| 541 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 542 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 544 | # Basic test |
| 545 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 546 | # Checks that: |
| 547 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 548 | # - the expected (highest security) parameters are selected |
| 549 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 550 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 551 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 552 | "$P_CLI" \ |
| 553 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 554 | -s "Protocol is TLSv1.2" \ |
| 555 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 556 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 557 | -s "ECDHE curve: secp521r1" \ |
| 558 | -S "error" \ |
| 559 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 560 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 561 | run_test "Default, DTLS" \ |
| 562 | "$P_SRV dtls=1" \ |
| 563 | "$P_CLI dtls=1" \ |
| 564 | 0 \ |
| 565 | -s "Protocol is DTLSv1.2" \ |
| 566 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" |
| 567 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 568 | # Tests for rc4 option |
| 569 | |
| 570 | run_test "RC4: server disabled, client enabled" \ |
| 571 | "$P_SRV" \ |
| 572 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 573 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 574 | -s "SSL - The server has no ciphersuites in common" |
| 575 | |
| 576 | run_test "RC4: server half, client enabled" \ |
| 577 | "$P_SRV arc4=1" \ |
| 578 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 579 | 1 \ |
| 580 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 581 | |
| 582 | run_test "RC4: server enabled, client disabled" \ |
| 583 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 584 | "$P_CLI" \ |
| 585 | 1 \ |
| 586 | -s "SSL - The server has no ciphersuites in common" |
| 587 | |
| 588 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 589 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 590 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 591 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 592 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 593 | -S "SSL - The server has no ciphersuites in common" |
| 594 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 595 | # Tests for Truncated HMAC extension |
| 596 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 597 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 598 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 599 | "$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] | 600 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 601 | -s "dumping 'computed mac' (20 bytes)" \ |
| 602 | -S "dumping 'computed mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 603 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 604 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 605 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 606 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 607 | trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 608 | 0 \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 609 | -s "dumping 'computed mac' (20 bytes)" \ |
| 610 | -S "dumping 'computed mac' (10 bytes)" |
| 611 | |
| 612 | run_test "Truncated HMAC: client enabled, server default" \ |
| 613 | "$P_SRV debug_level=4" \ |
| 614 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 615 | trunc_hmac=1" \ |
| 616 | 0 \ |
Manuel Pégourié-Gonnard | 662c6e8 | 2015-05-06 17:39:23 +0100 | [diff] [blame] | 617 | -s "dumping 'computed mac' (20 bytes)" \ |
| 618 | -S "dumping 'computed mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 619 | |
| 620 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 621 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
| 622 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 623 | trunc_hmac=1" \ |
| 624 | 0 \ |
| 625 | -s "dumping 'computed mac' (20 bytes)" \ |
| 626 | -S "dumping 'computed mac' (10 bytes)" |
| 627 | |
| 628 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 629 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
| 630 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 631 | trunc_hmac=1" \ |
| 632 | 0 \ |
| 633 | -S "dumping 'computed mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 634 | -s "dumping 'computed mac' (10 bytes)" |
| 635 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 636 | # Tests for Encrypt-then-MAC extension |
| 637 | |
| 638 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 639 | "$P_SRV debug_level=3 \ |
| 640 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 641 | "$P_CLI debug_level=3" \ |
| 642 | 0 \ |
| 643 | -c "client hello, adding encrypt_then_mac extension" \ |
| 644 | -s "found encrypt then mac extension" \ |
| 645 | -s "server hello, adding encrypt then mac extension" \ |
| 646 | -c "found encrypt_then_mac extension" \ |
| 647 | -c "using encrypt then mac" \ |
| 648 | -s "using encrypt then mac" |
| 649 | |
| 650 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 651 | "$P_SRV debug_level=3 etm=0 \ |
| 652 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 653 | "$P_CLI debug_level=3 etm=1" \ |
| 654 | 0 \ |
| 655 | -c "client hello, adding encrypt_then_mac extension" \ |
| 656 | -s "found encrypt then mac extension" \ |
| 657 | -S "server hello, adding encrypt then mac extension" \ |
| 658 | -C "found encrypt_then_mac extension" \ |
| 659 | -C "using encrypt then mac" \ |
| 660 | -S "using encrypt then mac" |
| 661 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 662 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 663 | "$P_SRV debug_level=3 etm=1 \ |
| 664 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 665 | "$P_CLI debug_level=3 etm=1" \ |
| 666 | 0 \ |
| 667 | -c "client hello, adding encrypt_then_mac extension" \ |
| 668 | -s "found encrypt then mac extension" \ |
| 669 | -S "server hello, adding encrypt then mac extension" \ |
| 670 | -C "found encrypt_then_mac extension" \ |
| 671 | -C "using encrypt then mac" \ |
| 672 | -S "using encrypt then mac" |
| 673 | |
| 674 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 675 | "$P_SRV debug_level=3 etm=1 \ |
| 676 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 677 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 678 | 0 \ |
| 679 | -c "client hello, adding encrypt_then_mac extension" \ |
| 680 | -s "found encrypt then mac extension" \ |
| 681 | -S "server hello, adding encrypt then mac extension" \ |
| 682 | -C "found encrypt_then_mac extension" \ |
| 683 | -C "using encrypt then mac" \ |
| 684 | -S "using encrypt then mac" |
| 685 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 686 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 687 | "$P_SRV debug_level=3 etm=1 \ |
| 688 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 689 | "$P_CLI debug_level=3 etm=0" \ |
| 690 | 0 \ |
| 691 | -C "client hello, adding encrypt_then_mac extension" \ |
| 692 | -S "found encrypt then mac extension" \ |
| 693 | -S "server hello, adding encrypt then mac extension" \ |
| 694 | -C "found encrypt_then_mac extension" \ |
| 695 | -C "using encrypt then mac" \ |
| 696 | -S "using encrypt then mac" |
| 697 | |
| 698 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 699 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 700 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 701 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 702 | 0 \ |
| 703 | -C "client hello, adding encrypt_then_mac extension" \ |
| 704 | -S "found encrypt then mac extension" \ |
| 705 | -S "server hello, adding encrypt then mac extension" \ |
| 706 | -C "found encrypt_then_mac extension" \ |
| 707 | -C "using encrypt then mac" \ |
| 708 | -S "using encrypt then mac" |
| 709 | |
| 710 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 711 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 712 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 713 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 714 | 0 \ |
| 715 | -c "client hello, adding encrypt_then_mac extension" \ |
| 716 | -s "found encrypt then mac extension" \ |
| 717 | -S "server hello, adding encrypt then mac extension" \ |
| 718 | -C "found encrypt_then_mac extension" \ |
| 719 | -C "using encrypt then mac" \ |
| 720 | -S "using encrypt then mac" |
| 721 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 722 | # Tests for Extended Master Secret extension |
| 723 | |
| 724 | run_test "Extended Master Secret: default" \ |
| 725 | "$P_SRV debug_level=3" \ |
| 726 | "$P_CLI debug_level=3" \ |
| 727 | 0 \ |
| 728 | -c "client hello, adding extended_master_secret extension" \ |
| 729 | -s "found extended master secret extension" \ |
| 730 | -s "server hello, adding extended master secret extension" \ |
| 731 | -c "found extended_master_secret extension" \ |
| 732 | -c "using extended master secret" \ |
| 733 | -s "using extended master secret" |
| 734 | |
| 735 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 736 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 737 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 738 | 0 \ |
| 739 | -c "client hello, adding extended_master_secret extension" \ |
| 740 | -s "found extended master secret extension" \ |
| 741 | -S "server hello, adding extended master secret extension" \ |
| 742 | -C "found extended_master_secret extension" \ |
| 743 | -C "using extended master secret" \ |
| 744 | -S "using extended master secret" |
| 745 | |
| 746 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 747 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 748 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 749 | 0 \ |
| 750 | -C "client hello, adding extended_master_secret extension" \ |
| 751 | -S "found extended master secret extension" \ |
| 752 | -S "server hello, adding extended master secret extension" \ |
| 753 | -C "found extended_master_secret extension" \ |
| 754 | -C "using extended master secret" \ |
| 755 | -S "using extended master secret" |
| 756 | |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 757 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 758 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 759 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 760 | 0 \ |
| 761 | -C "client hello, adding extended_master_secret extension" \ |
| 762 | -S "found extended master secret extension" \ |
| 763 | -S "server hello, adding extended master secret extension" \ |
| 764 | -C "found extended_master_secret extension" \ |
| 765 | -C "using extended master secret" \ |
| 766 | -S "using extended master secret" |
| 767 | |
| 768 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 769 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 770 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 771 | 0 \ |
| 772 | -c "client hello, adding extended_master_secret extension" \ |
| 773 | -s "found extended master secret extension" \ |
| 774 | -S "server hello, adding extended master secret extension" \ |
| 775 | -C "found extended_master_secret extension" \ |
| 776 | -C "using extended master secret" \ |
| 777 | -S "using extended master secret" |
| 778 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 779 | # Tests for FALLBACK_SCSV |
| 780 | |
| 781 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 782 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 783 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 784 | 0 \ |
| 785 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 786 | -S "received FALLBACK_SCSV" \ |
| 787 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 788 | -C "is a fatal alert message (msg 86)" |
| 789 | |
| 790 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 791 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 792 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 793 | 0 \ |
| 794 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 795 | -S "received FALLBACK_SCSV" \ |
| 796 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 797 | -C "is a fatal alert message (msg 86)" |
| 798 | |
| 799 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 800 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 801 | "$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] | 802 | 1 \ |
| 803 | -c "adding FALLBACK_SCSV" \ |
| 804 | -s "received FALLBACK_SCSV" \ |
| 805 | -s "inapropriate fallback" \ |
| 806 | -c "is a fatal alert message (msg 86)" |
| 807 | |
| 808 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 809 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 810 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 811 | 0 \ |
| 812 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 813 | -s "received FALLBACK_SCSV" \ |
| 814 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 815 | -C "is a fatal alert message (msg 86)" |
| 816 | |
| 817 | requires_openssl_with_fallback_scsv |
| 818 | run_test "Fallback SCSV: default, openssl server" \ |
| 819 | "$O_SRV" \ |
| 820 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 821 | 0 \ |
| 822 | -C "adding FALLBACK_SCSV" \ |
| 823 | -C "is a fatal alert message (msg 86)" |
| 824 | |
| 825 | requires_openssl_with_fallback_scsv |
| 826 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 827 | "$O_SRV" \ |
| 828 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 829 | 1 \ |
| 830 | -c "adding FALLBACK_SCSV" \ |
| 831 | -c "is a fatal alert message (msg 86)" |
| 832 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 833 | requires_openssl_with_fallback_scsv |
| 834 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 835 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 836 | "$O_CLI -tls1_1" \ |
| 837 | 0 \ |
| 838 | -S "received FALLBACK_SCSV" \ |
| 839 | -S "inapropriate fallback" |
| 840 | |
| 841 | requires_openssl_with_fallback_scsv |
| 842 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 843 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 844 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 845 | 1 \ |
| 846 | -s "received FALLBACK_SCSV" \ |
| 847 | -s "inapropriate fallback" |
| 848 | |
| 849 | requires_openssl_with_fallback_scsv |
| 850 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 851 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 852 | "$O_CLI -fallback_scsv" \ |
| 853 | 0 \ |
| 854 | -s "received FALLBACK_SCSV" \ |
| 855 | -S "inapropriate fallback" |
| 856 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 857 | # Tests for CBC 1/n-1 record splitting |
| 858 | |
| 859 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 860 | "$P_SRV" \ |
| 861 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 862 | request_size=123 force_version=tls1_2" \ |
| 863 | 0 \ |
| 864 | -s "Read from client: 123 bytes read" \ |
| 865 | -S "Read from client: 1 bytes read" \ |
| 866 | -S "122 bytes read" |
| 867 | |
| 868 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 869 | "$P_SRV" \ |
| 870 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 871 | request_size=123 force_version=tls1_1" \ |
| 872 | 0 \ |
| 873 | -s "Read from client: 123 bytes read" \ |
| 874 | -S "Read from client: 1 bytes read" \ |
| 875 | -S "122 bytes read" |
| 876 | |
| 877 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 878 | "$P_SRV" \ |
| 879 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 880 | request_size=123 force_version=tls1" \ |
| 881 | 0 \ |
| 882 | -S "Read from client: 123 bytes read" \ |
| 883 | -s "Read from client: 1 bytes read" \ |
| 884 | -s "122 bytes read" |
| 885 | |
| 886 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 887 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 888 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 889 | request_size=123 force_version=ssl3" \ |
| 890 | 0 \ |
| 891 | -S "Read from client: 123 bytes read" \ |
| 892 | -s "Read from client: 1 bytes read" \ |
| 893 | -s "122 bytes read" |
| 894 | |
| 895 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 896 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 897 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 898 | request_size=123 force_version=tls1" \ |
| 899 | 0 \ |
| 900 | -s "Read from client: 123 bytes read" \ |
| 901 | -S "Read from client: 1 bytes read" \ |
| 902 | -S "122 bytes read" |
| 903 | |
| 904 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 905 | "$P_SRV" \ |
| 906 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 907 | request_size=123 force_version=tls1 recsplit=0" \ |
| 908 | 0 \ |
| 909 | -s "Read from client: 123 bytes read" \ |
| 910 | -S "Read from client: 1 bytes read" \ |
| 911 | -S "122 bytes read" |
| 912 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 913 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 914 | "$P_SRV nbio=2" \ |
| 915 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 916 | request_size=123 force_version=tls1" \ |
| 917 | 0 \ |
| 918 | -S "Read from client: 123 bytes read" \ |
| 919 | -s "Read from client: 1 bytes read" \ |
| 920 | -s "122 bytes read" |
| 921 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 922 | # Tests for Session Tickets |
| 923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 924 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 925 | "$P_SRV debug_level=3 tickets=1" \ |
| 926 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 927 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 928 | -c "client hello, adding session ticket extension" \ |
| 929 | -s "found session ticket extension" \ |
| 930 | -s "server hello, adding session ticket extension" \ |
| 931 | -c "found session_ticket extension" \ |
| 932 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 933 | -S "session successfully restored from cache" \ |
| 934 | -s "session successfully restored from ticket" \ |
| 935 | -s "a session has been resumed" \ |
| 936 | -c "a session has been resumed" |
| 937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 938 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 939 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 940 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 941 | 0 \ |
| 942 | -c "client hello, adding session ticket extension" \ |
| 943 | -s "found session ticket extension" \ |
| 944 | -s "server hello, adding session ticket extension" \ |
| 945 | -c "found session_ticket extension" \ |
| 946 | -c "parse new session ticket" \ |
| 947 | -S "session successfully restored from cache" \ |
| 948 | -s "session successfully restored from ticket" \ |
| 949 | -s "a session has been resumed" \ |
| 950 | -c "a session has been resumed" |
| 951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 952 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 953 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 954 | "$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] | 955 | 0 \ |
| 956 | -c "client hello, adding session ticket extension" \ |
| 957 | -s "found session ticket extension" \ |
| 958 | -s "server hello, adding session ticket extension" \ |
| 959 | -c "found session_ticket extension" \ |
| 960 | -c "parse new session ticket" \ |
| 961 | -S "session successfully restored from cache" \ |
| 962 | -S "session successfully restored from ticket" \ |
| 963 | -S "a session has been resumed" \ |
| 964 | -C "a session has been resumed" |
| 965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 966 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 967 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 968 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 969 | 0 \ |
| 970 | -c "client hello, adding session ticket extension" \ |
| 971 | -c "found session_ticket extension" \ |
| 972 | -c "parse new session ticket" \ |
| 973 | -c "a session has been resumed" |
| 974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 975 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 976 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 977 | "( $O_CLI -sess_out $SESSION; \ |
| 978 | $O_CLI -sess_in $SESSION; \ |
| 979 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 980 | 0 \ |
| 981 | -s "found session ticket extension" \ |
| 982 | -s "server hello, adding session ticket extension" \ |
| 983 | -S "session successfully restored from cache" \ |
| 984 | -s "session successfully restored from ticket" \ |
| 985 | -s "a session has been resumed" |
| 986 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 987 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 988 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 989 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 990 | "$P_SRV debug_level=3 tickets=0" \ |
| 991 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 992 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 993 | -c "client hello, adding session ticket extension" \ |
| 994 | -s "found session ticket extension" \ |
| 995 | -S "server hello, adding session ticket extension" \ |
| 996 | -C "found session_ticket extension" \ |
| 997 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 998 | -s "session successfully restored from cache" \ |
| 999 | -S "session successfully restored from ticket" \ |
| 1000 | -s "a session has been resumed" \ |
| 1001 | -c "a session has been resumed" |
| 1002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1003 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1004 | "$P_SRV debug_level=3 tickets=1" \ |
| 1005 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1006 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1007 | -C "client hello, adding session ticket extension" \ |
| 1008 | -S "found session ticket extension" \ |
| 1009 | -S "server hello, adding session ticket extension" \ |
| 1010 | -C "found session_ticket extension" \ |
| 1011 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1012 | -s "session successfully restored from cache" \ |
| 1013 | -S "session successfully restored from ticket" \ |
| 1014 | -s "a session has been resumed" \ |
| 1015 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1017 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1018 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1019 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1020 | 0 \ |
| 1021 | -S "session successfully restored from cache" \ |
| 1022 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1023 | -S "a session has been resumed" \ |
| 1024 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1026 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1027 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1028 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1029 | 0 \ |
| 1030 | -s "session successfully restored from cache" \ |
| 1031 | -S "session successfully restored from ticket" \ |
| 1032 | -s "a session has been resumed" \ |
| 1033 | -c "a session has been resumed" |
| 1034 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1035 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1036 | "$P_SRV debug_level=3 tickets=0" \ |
| 1037 | "$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] | 1038 | 0 \ |
| 1039 | -s "session successfully restored from cache" \ |
| 1040 | -S "session successfully restored from ticket" \ |
| 1041 | -s "a session has been resumed" \ |
| 1042 | -c "a session has been resumed" |
| 1043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1044 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1045 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1046 | "$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] | 1047 | 0 \ |
| 1048 | -S "session successfully restored from cache" \ |
| 1049 | -S "session successfully restored from ticket" \ |
| 1050 | -S "a session has been resumed" \ |
| 1051 | -C "a session has been resumed" |
| 1052 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1053 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1054 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1055 | "$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] | 1056 | 0 \ |
| 1057 | -s "session successfully restored from cache" \ |
| 1058 | -S "session successfully restored from ticket" \ |
| 1059 | -s "a session has been resumed" \ |
| 1060 | -c "a session has been resumed" |
| 1061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1062 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1063 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1064 | "( $O_CLI -sess_out $SESSION; \ |
| 1065 | $O_CLI -sess_in $SESSION; \ |
| 1066 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1067 | 0 \ |
| 1068 | -s "found session ticket extension" \ |
| 1069 | -S "server hello, adding session ticket extension" \ |
| 1070 | -s "session successfully restored from cache" \ |
| 1071 | -S "session successfully restored from ticket" \ |
| 1072 | -s "a session has been resumed" |
| 1073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1074 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1075 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1076 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1077 | 0 \ |
| 1078 | -C "found session_ticket extension" \ |
| 1079 | -C "parse new session ticket" \ |
| 1080 | -c "a session has been resumed" |
| 1081 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1082 | # Tests for Max Fragment Length extension |
| 1083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1084 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1085 | "$P_SRV debug_level=3" \ |
| 1086 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1087 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1088 | -c "Maximum fragment length is 16384" \ |
| 1089 | -s "Maximum fragment length is 16384" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1090 | -C "client hello, adding max_fragment_length extension" \ |
| 1091 | -S "found max fragment length extension" \ |
| 1092 | -S "server hello, max_fragment_length extension" \ |
| 1093 | -C "found max_fragment_length extension" |
| 1094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1095 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1096 | "$P_SRV debug_level=3" \ |
| 1097 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1098 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1099 | -c "Maximum fragment length is 4096" \ |
| 1100 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1101 | -c "client hello, adding max_fragment_length extension" \ |
| 1102 | -s "found max fragment length extension" \ |
| 1103 | -s "server hello, max_fragment_length extension" \ |
| 1104 | -c "found max_fragment_length extension" |
| 1105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1106 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1107 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1108 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1109 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1110 | -c "Maximum fragment length is 16384" \ |
| 1111 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1112 | -C "client hello, adding max_fragment_length extension" \ |
| 1113 | -S "found max fragment length extension" \ |
| 1114 | -S "server hello, max_fragment_length extension" \ |
| 1115 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1117 | requires_gnutls |
| 1118 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1119 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1120 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1121 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1122 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1123 | -c "client hello, adding max_fragment_length extension" \ |
| 1124 | -c "found max_fragment_length extension" |
| 1125 | |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1126 | run_test "Max fragment length: client, message just fits" \ |
| 1127 | "$P_SRV debug_level=3" \ |
| 1128 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1129 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1130 | -c "Maximum fragment length is 2048" \ |
| 1131 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1132 | -c "client hello, adding max_fragment_length extension" \ |
| 1133 | -s "found max fragment length extension" \ |
| 1134 | -s "server hello, max_fragment_length extension" \ |
| 1135 | -c "found max_fragment_length extension" \ |
| 1136 | -c "2048 bytes written in 1 fragments" \ |
| 1137 | -s "2048 bytes read" |
| 1138 | |
| 1139 | run_test "Max fragment length: client, larger message" \ |
| 1140 | "$P_SRV debug_level=3" \ |
| 1141 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1142 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1143 | -c "Maximum fragment length is 2048" \ |
| 1144 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1145 | -c "client hello, adding max_fragment_length extension" \ |
| 1146 | -s "found max fragment length extension" \ |
| 1147 | -s "server hello, max_fragment_length extension" \ |
| 1148 | -c "found max_fragment_length extension" \ |
| 1149 | -c "2345 bytes written in 2 fragments" \ |
| 1150 | -s "2048 bytes read" \ |
| 1151 | -s "297 bytes read" |
| 1152 | |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1153 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1154 | "$P_SRV debug_level=3 dtls=1" \ |
| 1155 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1156 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1157 | -c "Maximum fragment length is 2048" \ |
| 1158 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1159 | -c "client hello, adding max_fragment_length extension" \ |
| 1160 | -s "found max fragment length extension" \ |
| 1161 | -s "server hello, max_fragment_length extension" \ |
| 1162 | -c "found max_fragment_length extension" \ |
| 1163 | -c "fragment larger than.*maximum" |
| 1164 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1165 | # Tests for renegotiation |
| 1166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1167 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1168 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1169 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1170 | 0 \ |
| 1171 | -C "client hello, adding renegotiation extension" \ |
| 1172 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1173 | -S "found renegotiation extension" \ |
| 1174 | -s "server hello, secure renegotiation extension" \ |
| 1175 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1176 | -C "=> renegotiate" \ |
| 1177 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1178 | -S "write hello request" |
| 1179 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1180 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1181 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1182 | "$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] | 1183 | 0 \ |
| 1184 | -c "client hello, adding renegotiation extension" \ |
| 1185 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1186 | -s "found renegotiation extension" \ |
| 1187 | -s "server hello, secure renegotiation extension" \ |
| 1188 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1189 | -c "=> renegotiate" \ |
| 1190 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1191 | -S "write hello request" |
| 1192 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1193 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1194 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1195 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1202 | -c "=> renegotiate" \ |
| 1203 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1204 | -s "write hello request" |
| 1205 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1206 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1207 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1208 | "$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] | 1209 | 0 \ |
| 1210 | -c "client hello, adding renegotiation extension" \ |
| 1211 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1212 | -s "found renegotiation extension" \ |
| 1213 | -s "server hello, secure renegotiation extension" \ |
| 1214 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1215 | -c "=> renegotiate" \ |
| 1216 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1217 | -s "write hello request" |
| 1218 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1219 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1220 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1221 | "$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] | 1222 | 1 \ |
| 1223 | -c "client hello, adding renegotiation extension" \ |
| 1224 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1225 | -S "found renegotiation extension" \ |
| 1226 | -s "server hello, secure renegotiation extension" \ |
| 1227 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1228 | -c "=> renegotiate" \ |
| 1229 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1230 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1231 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1232 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1234 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1235 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1236 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1237 | 0 \ |
| 1238 | -C "client hello, adding renegotiation extension" \ |
| 1239 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1240 | -S "found renegotiation extension" \ |
| 1241 | -s "server hello, secure renegotiation extension" \ |
| 1242 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1243 | -C "=> renegotiate" \ |
| 1244 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1245 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1246 | -S "SSL - An unexpected message was received from our peer" \ |
| 1247 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1249 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1250 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1251 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1252 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1253 | 0 \ |
| 1254 | -C "client hello, adding renegotiation extension" \ |
| 1255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1256 | -S "found renegotiation extension" \ |
| 1257 | -s "server hello, secure renegotiation extension" \ |
| 1258 | -c "found renegotiation extension" \ |
| 1259 | -C "=> renegotiate" \ |
| 1260 | -S "=> renegotiate" \ |
| 1261 | -s "write hello request" \ |
| 1262 | -S "SSL - An unexpected message was received from our peer" \ |
| 1263 | -S "failed" |
| 1264 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1265 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1266 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1267 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1268 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1269 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1270 | 0 \ |
| 1271 | -C "client hello, adding renegotiation extension" \ |
| 1272 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1273 | -S "found renegotiation extension" \ |
| 1274 | -s "server hello, secure renegotiation extension" \ |
| 1275 | -c "found renegotiation extension" \ |
| 1276 | -C "=> renegotiate" \ |
| 1277 | -S "=> renegotiate" \ |
| 1278 | -s "write hello request" \ |
| 1279 | -S "SSL - An unexpected message was received from our peer" \ |
| 1280 | -S "failed" |
| 1281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1282 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1283 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1284 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1285 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1286 | 0 \ |
| 1287 | -C "client hello, adding renegotiation extension" \ |
| 1288 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1289 | -S "found renegotiation extension" \ |
| 1290 | -s "server hello, secure renegotiation extension" \ |
| 1291 | -c "found renegotiation extension" \ |
| 1292 | -C "=> renegotiate" \ |
| 1293 | -S "=> renegotiate" \ |
| 1294 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1295 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1297 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1298 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1299 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1300 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1301 | 0 \ |
| 1302 | -c "client hello, adding renegotiation extension" \ |
| 1303 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1304 | -s "found renegotiation extension" \ |
| 1305 | -s "server hello, secure renegotiation extension" \ |
| 1306 | -c "found renegotiation extension" \ |
| 1307 | -c "=> renegotiate" \ |
| 1308 | -s "=> renegotiate" \ |
| 1309 | -s "write hello request" \ |
| 1310 | -S "SSL - An unexpected message was received from our peer" \ |
| 1311 | -S "failed" |
| 1312 | |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1313 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1314 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1315 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1316 | 0 \ |
| 1317 | -C "client hello, adding renegotiation extension" \ |
| 1318 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1319 | -S "found renegotiation extension" \ |
| 1320 | -s "server hello, secure renegotiation extension" \ |
| 1321 | -c "found renegotiation extension" \ |
| 1322 | -S "record counter limit reached: renegotiate" \ |
| 1323 | -C "=> renegotiate" \ |
| 1324 | -S "=> renegotiate" \ |
| 1325 | -S "write hello request" \ |
| 1326 | -S "SSL - An unexpected message was received from our peer" \ |
| 1327 | -S "failed" |
| 1328 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1329 | # one extra exchange to be able to complete renego |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1330 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1331 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1332 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1333 | 0 \ |
| 1334 | -c "client hello, adding renegotiation extension" \ |
| 1335 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1336 | -s "found renegotiation extension" \ |
| 1337 | -s "server hello, secure renegotiation extension" \ |
| 1338 | -c "found renegotiation extension" \ |
| 1339 | -s "record counter limit reached: renegotiate" \ |
| 1340 | -c "=> renegotiate" \ |
| 1341 | -s "=> renegotiate" \ |
| 1342 | -s "write hello request" \ |
| 1343 | -S "SSL - An unexpected message was received from our peer" \ |
| 1344 | -S "failed" |
| 1345 | |
| 1346 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1347 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1348 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1349 | 0 \ |
| 1350 | -c "client hello, adding renegotiation extension" \ |
| 1351 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1352 | -s "found renegotiation extension" \ |
| 1353 | -s "server hello, secure renegotiation extension" \ |
| 1354 | -c "found renegotiation extension" \ |
| 1355 | -s "record counter limit reached: renegotiate" \ |
| 1356 | -c "=> renegotiate" \ |
| 1357 | -s "=> renegotiate" \ |
| 1358 | -s "write hello request" \ |
| 1359 | -S "SSL - An unexpected message was received from our peer" \ |
| 1360 | -S "failed" |
| 1361 | |
| 1362 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1363 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1364 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1365 | 0 \ |
| 1366 | -C "client hello, adding renegotiation extension" \ |
| 1367 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1368 | -S "found renegotiation extension" \ |
| 1369 | -s "server hello, secure renegotiation extension" \ |
| 1370 | -c "found renegotiation extension" \ |
| 1371 | -S "record counter limit reached: renegotiate" \ |
| 1372 | -C "=> renegotiate" \ |
| 1373 | -S "=> renegotiate" \ |
| 1374 | -S "write hello request" \ |
| 1375 | -S "SSL - An unexpected message was received from our peer" \ |
| 1376 | -S "failed" |
| 1377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1378 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1379 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1380 | "$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] | 1381 | 0 \ |
| 1382 | -c "client hello, adding renegotiation extension" \ |
| 1383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1384 | -s "found renegotiation extension" \ |
| 1385 | -s "server hello, secure renegotiation extension" \ |
| 1386 | -c "found renegotiation extension" \ |
| 1387 | -c "=> renegotiate" \ |
| 1388 | -s "=> renegotiate" \ |
| 1389 | -S "write hello request" |
| 1390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1391 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1392 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1393 | "$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] | 1394 | 0 \ |
| 1395 | -c "client hello, adding renegotiation extension" \ |
| 1396 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1397 | -s "found renegotiation extension" \ |
| 1398 | -s "server hello, secure renegotiation extension" \ |
| 1399 | -c "found renegotiation extension" \ |
| 1400 | -c "=> renegotiate" \ |
| 1401 | -s "=> renegotiate" \ |
| 1402 | -s "write hello request" |
| 1403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1404 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1405 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1406 | "$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] | 1407 | 0 \ |
| 1408 | -c "client hello, adding renegotiation extension" \ |
| 1409 | -c "found renegotiation extension" \ |
| 1410 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1411 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1412 | -C "error" \ |
| 1413 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1414 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1415 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1416 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1417 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1418 | "$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] | 1419 | 0 \ |
| 1420 | -c "client hello, adding renegotiation extension" \ |
| 1421 | -c "found renegotiation extension" \ |
| 1422 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1423 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1424 | -C "error" \ |
| 1425 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1426 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1427 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1428 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1429 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1430 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1431 | 1 \ |
| 1432 | -c "client hello, adding renegotiation extension" \ |
| 1433 | -C "found renegotiation extension" \ |
| 1434 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1435 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1436 | -c "error" \ |
| 1437 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1438 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1439 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1440 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1441 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1442 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1443 | allow_legacy=0" \ |
| 1444 | 1 \ |
| 1445 | -c "client hello, adding renegotiation extension" \ |
| 1446 | -C "found renegotiation extension" \ |
| 1447 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1448 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1449 | -c "error" \ |
| 1450 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1451 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1452 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1453 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1454 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1455 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1456 | allow_legacy=1" \ |
| 1457 | 0 \ |
| 1458 | -c "client hello, adding renegotiation extension" \ |
| 1459 | -C "found renegotiation extension" \ |
| 1460 | -c "=> renegotiate" \ |
| 1461 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1462 | -C "error" \ |
| 1463 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1464 | |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1465 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1466 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1467 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1468 | 0 \ |
| 1469 | -c "client hello, adding renegotiation extension" \ |
| 1470 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1471 | -s "found renegotiation extension" \ |
| 1472 | -s "server hello, secure renegotiation extension" \ |
| 1473 | -c "found renegotiation extension" \ |
| 1474 | -c "=> renegotiate" \ |
| 1475 | -s "=> renegotiate" \ |
| 1476 | -S "write hello request" |
| 1477 | |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1478 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1479 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | df9a0a8 | 2014-10-02 14:17:18 +0200 | [diff] [blame] | 1480 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1481 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1482 | 0 \ |
| 1483 | -c "client hello, adding renegotiation extension" \ |
| 1484 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1485 | -s "found renegotiation extension" \ |
| 1486 | -s "server hello, secure renegotiation extension" \ |
| 1487 | -c "found renegotiation extension" \ |
| 1488 | -c "=> renegotiate" \ |
| 1489 | -s "=> renegotiate" \ |
| 1490 | -s "write hello request" |
| 1491 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 1492 | requires_gnutls |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1493 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 1494 | "$G_SRV -u --mtu 4096" \ |
| 1495 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1496 | 0 \ |
| 1497 | -c "client hello, adding renegotiation extension" \ |
| 1498 | -c "found renegotiation extension" \ |
| 1499 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1500 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1501 | -C "error" \ |
| 1502 | -s "Extra-header:" |
| 1503 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1504 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 1505 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1506 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1507 | run_test "Renego ext: gnutls server strict, client default" \ |
| 1508 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1509 | "$P_CLI debug_level=3" \ |
| 1510 | 0 \ |
| 1511 | -c "found renegotiation extension" \ |
| 1512 | -C "error" \ |
| 1513 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1514 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1515 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1516 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 1517 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1518 | "$P_CLI debug_level=3" \ |
| 1519 | 0 \ |
| 1520 | -C "found renegotiation extension" \ |
| 1521 | -C "error" \ |
| 1522 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1523 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1524 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1525 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 1526 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1527 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 1528 | 1 \ |
| 1529 | -C "found renegotiation extension" \ |
| 1530 | -c "error" \ |
| 1531 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1532 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1533 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1534 | run_test "Renego ext: gnutls client strict, server default" \ |
| 1535 | "$P_SRV debug_level=3" \ |
| 1536 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1537 | 0 \ |
| 1538 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1539 | -s "server hello, secure renegotiation extension" |
| 1540 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1541 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1542 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 1543 | "$P_SRV debug_level=3" \ |
| 1544 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1545 | 0 \ |
| 1546 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1547 | -S "server hello, secure renegotiation extension" |
| 1548 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1549 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1550 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 1551 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 1552 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1553 | 1 \ |
| 1554 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1555 | -S "server hello, secure renegotiation extension" |
| 1556 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1557 | # Tests for auth_mode |
| 1558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1559 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1560 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1561 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1562 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1563 | 1 \ |
| 1564 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1565 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1566 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1567 | -c "X509 - Certificate verification failed" |
| 1568 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1569 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1570 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1571 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1572 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1573 | 0 \ |
| 1574 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1575 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1576 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1577 | -C "X509 - Certificate verification failed" |
| 1578 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1579 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1580 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1581 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1582 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1583 | 0 \ |
| 1584 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1585 | -C "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1586 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1587 | -C "X509 - Certificate verification failed" |
| 1588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1589 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1590 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 1591 | "$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] | 1592 | key_file=data_files/server5.key" \ |
| 1593 | 1 \ |
| 1594 | -S "skip write certificate request" \ |
| 1595 | -C "skip parse certificate request" \ |
| 1596 | -c "got a certificate request" \ |
| 1597 | -C "skip write certificate" \ |
| 1598 | -C "skip write certificate verify" \ |
| 1599 | -S "skip parse certificate verify" \ |
| 1600 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1601 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1602 | -s "! mbedtls_ssl_handshake returned" \ |
| 1603 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1604 | -s "X509 - Certificate verification failed" |
| 1605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1606 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1607 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1608 | "$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] | 1609 | key_file=data_files/server5.key" \ |
| 1610 | 0 \ |
| 1611 | -S "skip write certificate request" \ |
| 1612 | -C "skip parse certificate request" \ |
| 1613 | -c "got a certificate request" \ |
| 1614 | -C "skip write certificate" \ |
| 1615 | -C "skip write certificate verify" \ |
| 1616 | -S "skip parse certificate verify" \ |
| 1617 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1618 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1619 | -S "! mbedtls_ssl_handshake returned" \ |
| 1620 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1621 | -S "X509 - Certificate verification failed" |
| 1622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1623 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1624 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1625 | "$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] | 1626 | key_file=data_files/server5.key" \ |
| 1627 | 0 \ |
| 1628 | -s "skip write certificate request" \ |
| 1629 | -C "skip parse certificate request" \ |
| 1630 | -c "got no certificate request" \ |
| 1631 | -c "skip write certificate" \ |
| 1632 | -c "skip write certificate verify" \ |
| 1633 | -s "skip parse certificate verify" \ |
| 1634 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1635 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1636 | -S "! mbedtls_ssl_handshake returned" \ |
| 1637 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1638 | -S "X509 - Certificate verification failed" |
| 1639 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1640 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1641 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1642 | "$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] | 1643 | 0 \ |
| 1644 | -S "skip write certificate request" \ |
| 1645 | -C "skip parse certificate request" \ |
| 1646 | -c "got a certificate request" \ |
| 1647 | -C "skip write certificate$" \ |
| 1648 | -C "got no certificate to send" \ |
| 1649 | -S "SSLv3 client has no certificate" \ |
| 1650 | -c "skip write certificate verify" \ |
| 1651 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1652 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1653 | -S "! mbedtls_ssl_handshake returned" \ |
| 1654 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1655 | -S "X509 - Certificate verification failed" |
| 1656 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1657 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1658 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1659 | "$O_CLI" \ |
| 1660 | 0 \ |
| 1661 | -S "skip write certificate request" \ |
| 1662 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1663 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1664 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1665 | -S "X509 - Certificate verification failed" |
| 1666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1667 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1668 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1669 | "$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] | 1670 | 0 \ |
| 1671 | -C "skip parse certificate request" \ |
| 1672 | -c "got a certificate request" \ |
| 1673 | -C "skip write certificate$" \ |
| 1674 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1675 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1677 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1678 | "$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] | 1679 | "$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] | 1680 | 0 \ |
| 1681 | -S "skip write certificate request" \ |
| 1682 | -C "skip parse certificate request" \ |
| 1683 | -c "got a certificate request" \ |
| 1684 | -C "skip write certificate$" \ |
| 1685 | -c "skip write certificate verify" \ |
| 1686 | -c "got no certificate to send" \ |
| 1687 | -s "SSLv3 client has no certificate" \ |
| 1688 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1689 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1690 | -S "! mbedtls_ssl_handshake returned" \ |
| 1691 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1692 | -S "X509 - Certificate verification failed" |
| 1693 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 1694 | # Tests for certificate selection based on SHA verson |
| 1695 | |
| 1696 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 1697 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1698 | key_file=data_files/server5.key \ |
| 1699 | crt_file2=data_files/server5-sha1.crt \ |
| 1700 | key_file2=data_files/server5.key" \ |
| 1701 | "$P_CLI force_version=tls1_2" \ |
| 1702 | 0 \ |
| 1703 | -c "signed using.*ECDSA with SHA256" \ |
| 1704 | -C "signed using.*ECDSA with SHA1" |
| 1705 | |
| 1706 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 1707 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1708 | key_file=data_files/server5.key \ |
| 1709 | crt_file2=data_files/server5-sha1.crt \ |
| 1710 | key_file2=data_files/server5.key" \ |
| 1711 | "$P_CLI force_version=tls1_1" \ |
| 1712 | 0 \ |
| 1713 | -C "signed using.*ECDSA with SHA256" \ |
| 1714 | -c "signed using.*ECDSA with SHA1" |
| 1715 | |
| 1716 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 1717 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1718 | key_file=data_files/server5.key \ |
| 1719 | crt_file2=data_files/server5-sha1.crt \ |
| 1720 | key_file2=data_files/server5.key" \ |
| 1721 | "$P_CLI force_version=tls1" \ |
| 1722 | 0 \ |
| 1723 | -C "signed using.*ECDSA with SHA256" \ |
| 1724 | -c "signed using.*ECDSA with SHA1" |
| 1725 | |
| 1726 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 1727 | "$P_SRV crt_file=data_files/server5.crt \ |
| 1728 | key_file=data_files/server5.key \ |
| 1729 | crt_file2=data_files/server6.crt \ |
| 1730 | key_file2=data_files/server6.key" \ |
| 1731 | "$P_CLI force_version=tls1_1" \ |
| 1732 | 0 \ |
| 1733 | -c "serial number.*09" \ |
| 1734 | -c "signed using.*ECDSA with SHA256" \ |
| 1735 | -C "signed using.*ECDSA with SHA1" |
| 1736 | |
| 1737 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 1738 | "$P_SRV crt_file=data_files/server6.crt \ |
| 1739 | key_file=data_files/server6.key \ |
| 1740 | crt_file2=data_files/server5.crt \ |
| 1741 | key_file2=data_files/server5.key" \ |
| 1742 | "$P_CLI force_version=tls1_1" \ |
| 1743 | 0 \ |
| 1744 | -c "serial number.*0A" \ |
| 1745 | -c "signed using.*ECDSA with SHA256" \ |
| 1746 | -C "signed using.*ECDSA with SHA1" |
| 1747 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1748 | # tests for SNI |
| 1749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1750 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1751 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1752 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1753 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1754 | 0 \ |
| 1755 | -S "parse ServerName extension" \ |
| 1756 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1757 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1758 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1759 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1760 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1761 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1762 | 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 | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1763 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1764 | 0 \ |
| 1765 | -s "parse ServerName extension" \ |
| 1766 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1767 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1769 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1770 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1771 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1772 | 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 | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1773 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1774 | 0 \ |
| 1775 | -s "parse ServerName extension" \ |
| 1776 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1777 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1779 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1780 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1781 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 1782 | 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 | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1783 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1784 | 1 \ |
| 1785 | -s "parse ServerName extension" \ |
| 1786 | -s "ssl_sni_wrapper() returned" \ |
| 1787 | -s "mbedtls_ssl_handshake returned" \ |
| 1788 | -c "mbedtls_ssl_handshake returned" \ |
| 1789 | -c "SSL - A fatal alert message was received from our peer" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1790 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1791 | run_test "SNI: client auth no override: optional" \ |
| 1792 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1793 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1794 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 1795 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1796 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1797 | -S "skip write certificate request" \ |
| 1798 | -C "skip parse certificate request" \ |
| 1799 | -c "got a certificate request" \ |
| 1800 | -C "skip write certificate" \ |
| 1801 | -C "skip write certificate verify" \ |
| 1802 | -S "skip parse certificate verify" |
| 1803 | |
| 1804 | run_test "SNI: client auth override: none -> optional" \ |
| 1805 | "$P_SRV debug_level=3 auth_mode=none \ |
| 1806 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1807 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 1808 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1809 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1810 | -S "skip write certificate request" \ |
| 1811 | -C "skip parse certificate request" \ |
| 1812 | -c "got a certificate request" \ |
| 1813 | -C "skip write certificate" \ |
| 1814 | -C "skip write certificate verify" \ |
| 1815 | -S "skip parse certificate verify" |
| 1816 | |
| 1817 | run_test "SNI: client auth override: optional -> none" \ |
| 1818 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1819 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1820 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 1821 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1822 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 1823 | -s "skip write certificate request" \ |
| 1824 | -C "skip parse certificate request" \ |
| 1825 | -c "got no certificate request" \ |
| 1826 | -c "skip write certificate" \ |
| 1827 | -c "skip write certificate verify" \ |
| 1828 | -s "skip parse certificate verify" |
| 1829 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1830 | run_test "SNI: CA no override" \ |
| 1831 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1832 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1833 | ca_file=data_files/test-ca.crt \ |
| 1834 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 1835 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1836 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1837 | 1 \ |
| 1838 | -S "skip write certificate request" \ |
| 1839 | -C "skip parse certificate request" \ |
| 1840 | -c "got a certificate request" \ |
| 1841 | -C "skip write certificate" \ |
| 1842 | -C "skip write certificate verify" \ |
| 1843 | -S "skip parse certificate verify" \ |
| 1844 | -s "x509_verify_cert() returned" \ |
| 1845 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 1846 | -S "The certificate has been revoked (is on a CRL)" |
| 1847 | |
| 1848 | run_test "SNI: CA override" \ |
| 1849 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1850 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1851 | ca_file=data_files/test-ca.crt \ |
| 1852 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 1853 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1854 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1855 | 0 \ |
| 1856 | -S "skip write certificate request" \ |
| 1857 | -C "skip parse certificate request" \ |
| 1858 | -c "got a certificate request" \ |
| 1859 | -C "skip write certificate" \ |
| 1860 | -C "skip write certificate verify" \ |
| 1861 | -S "skip parse certificate verify" \ |
| 1862 | -S "x509_verify_cert() returned" \ |
| 1863 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 1864 | -S "The certificate has been revoked (is on a CRL)" |
| 1865 | |
| 1866 | run_test "SNI: CA override with CRL" \ |
| 1867 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 1868 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1869 | ca_file=data_files/test-ca.crt \ |
| 1870 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 1871 | "$P_CLI debug_level=3 server_name=localhost \ |
| 1872 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 1873 | 1 \ |
| 1874 | -S "skip write certificate request" \ |
| 1875 | -C "skip parse certificate request" \ |
| 1876 | -c "got a certificate request" \ |
| 1877 | -C "skip write certificate" \ |
| 1878 | -C "skip write certificate verify" \ |
| 1879 | -S "skip parse certificate verify" \ |
| 1880 | -s "x509_verify_cert() returned" \ |
| 1881 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 1882 | -s "The certificate has been revoked (is on a CRL)" |
| 1883 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1884 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1886 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1887 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1888 | "$P_CLI nbio=2 tickets=0" \ |
| 1889 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1890 | -S "mbedtls_ssl_handshake returned" \ |
| 1891 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1892 | -c "Read from server: .* bytes read" |
| 1893 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1894 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1895 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1896 | "$P_CLI nbio=2 tickets=0" \ |
| 1897 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1898 | -S "mbedtls_ssl_handshake returned" \ |
| 1899 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1900 | -c "Read from server: .* bytes read" |
| 1901 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1902 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1903 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1904 | "$P_CLI nbio=2 tickets=1" \ |
| 1905 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1906 | -S "mbedtls_ssl_handshake returned" \ |
| 1907 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1908 | -c "Read from server: .* bytes read" |
| 1909 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1910 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1911 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1912 | "$P_CLI nbio=2 tickets=1" \ |
| 1913 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1914 | -S "mbedtls_ssl_handshake returned" \ |
| 1915 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1916 | -c "Read from server: .* bytes read" |
| 1917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1918 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1919 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1920 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1921 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1922 | -S "mbedtls_ssl_handshake returned" \ |
| 1923 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1924 | -c "Read from server: .* bytes read" |
| 1925 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1926 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1927 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1928 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1929 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1930 | -S "mbedtls_ssl_handshake returned" \ |
| 1931 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1932 | -c "Read from server: .* bytes read" |
| 1933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1934 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1935 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1936 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1937 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1938 | -S "mbedtls_ssl_handshake returned" \ |
| 1939 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1940 | -c "Read from server: .* bytes read" |
| 1941 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1942 | # Tests for version negotiation |
| 1943 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1944 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1945 | "$P_SRV" \ |
| 1946 | "$P_CLI" \ |
| 1947 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1948 | -S "mbedtls_ssl_handshake returned" \ |
| 1949 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1950 | -s "Protocol is TLSv1.2" \ |
| 1951 | -c "Protocol is TLSv1.2" |
| 1952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1953 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1954 | "$P_SRV" \ |
| 1955 | "$P_CLI max_version=tls1_1" \ |
| 1956 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1957 | -S "mbedtls_ssl_handshake returned" \ |
| 1958 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1959 | -s "Protocol is TLSv1.1" \ |
| 1960 | -c "Protocol is TLSv1.1" |
| 1961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1962 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1963 | "$P_SRV max_version=tls1_1" \ |
| 1964 | "$P_CLI" \ |
| 1965 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1966 | -S "mbedtls_ssl_handshake returned" \ |
| 1967 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1968 | -s "Protocol is TLSv1.1" \ |
| 1969 | -c "Protocol is TLSv1.1" |
| 1970 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1971 | 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] | 1972 | "$P_SRV max_version=tls1_1" \ |
| 1973 | "$P_CLI max_version=tls1_1" \ |
| 1974 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1975 | -S "mbedtls_ssl_handshake returned" \ |
| 1976 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1977 | -s "Protocol is TLSv1.1" \ |
| 1978 | -c "Protocol is TLSv1.1" |
| 1979 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1980 | 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] | 1981 | "$P_SRV min_version=tls1_1" \ |
| 1982 | "$P_CLI max_version=tls1_1" \ |
| 1983 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1984 | -S "mbedtls_ssl_handshake returned" \ |
| 1985 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1986 | -s "Protocol is TLSv1.1" \ |
| 1987 | -c "Protocol is TLSv1.1" |
| 1988 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1989 | 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] | 1990 | "$P_SRV max_version=tls1_1" \ |
| 1991 | "$P_CLI min_version=tls1_1" \ |
| 1992 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1993 | -S "mbedtls_ssl_handshake returned" \ |
| 1994 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1995 | -s "Protocol is TLSv1.1" \ |
| 1996 | -c "Protocol is TLSv1.1" |
| 1997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1998 | 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] | 1999 | "$P_SRV max_version=tls1_1" \ |
| 2000 | "$P_CLI min_version=tls1_2" \ |
| 2001 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2002 | -s "mbedtls_ssl_handshake returned" \ |
| 2003 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2004 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 2005 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2006 | 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] | 2007 | "$P_SRV min_version=tls1_2" \ |
| 2008 | "$P_CLI max_version=tls1_1" \ |
| 2009 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2010 | -s "mbedtls_ssl_handshake returned" \ |
| 2011 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2012 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 2013 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2014 | # Tests for ALPN extension |
| 2015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2016 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2017 | "$P_SRV debug_level=3" \ |
| 2018 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2019 | 0 \ |
| 2020 | -C "client hello, adding alpn extension" \ |
| 2021 | -S "found alpn extension" \ |
| 2022 | -C "got an alert message, type: \\[2:120]" \ |
| 2023 | -S "server hello, adding alpn extension" \ |
| 2024 | -C "found alpn extension " \ |
| 2025 | -C "Application Layer Protocol is" \ |
| 2026 | -S "Application Layer Protocol is" |
| 2027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2028 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2029 | "$P_SRV debug_level=3" \ |
| 2030 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2031 | 0 \ |
| 2032 | -c "client hello, adding alpn extension" \ |
| 2033 | -s "found alpn extension" \ |
| 2034 | -C "got an alert message, type: \\[2:120]" \ |
| 2035 | -S "server hello, adding alpn extension" \ |
| 2036 | -C "found alpn extension " \ |
| 2037 | -c "Application Layer Protocol is (none)" \ |
| 2038 | -S "Application Layer Protocol is" |
| 2039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2040 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2041 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2042 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2043 | 0 \ |
| 2044 | -C "client hello, adding alpn extension" \ |
| 2045 | -S "found alpn extension" \ |
| 2046 | -C "got an alert message, type: \\[2:120]" \ |
| 2047 | -S "server hello, adding alpn extension" \ |
| 2048 | -C "found alpn extension " \ |
| 2049 | -C "Application Layer Protocol is" \ |
| 2050 | -s "Application Layer Protocol is (none)" |
| 2051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2052 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2053 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2054 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2055 | 0 \ |
| 2056 | -c "client hello, adding alpn extension" \ |
| 2057 | -s "found alpn extension" \ |
| 2058 | -C "got an alert message, type: \\[2:120]" \ |
| 2059 | -s "server hello, adding alpn extension" \ |
| 2060 | -c "found alpn extension" \ |
| 2061 | -c "Application Layer Protocol is abc" \ |
| 2062 | -s "Application Layer Protocol is abc" |
| 2063 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2064 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2065 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2066 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2067 | 0 \ |
| 2068 | -c "client hello, adding alpn extension" \ |
| 2069 | -s "found alpn extension" \ |
| 2070 | -C "got an alert message, type: \\[2:120]" \ |
| 2071 | -s "server hello, adding alpn extension" \ |
| 2072 | -c "found alpn extension" \ |
| 2073 | -c "Application Layer Protocol is abc" \ |
| 2074 | -s "Application Layer Protocol is abc" |
| 2075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2076 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2077 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2078 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2079 | 0 \ |
| 2080 | -c "client hello, adding alpn extension" \ |
| 2081 | -s "found alpn extension" \ |
| 2082 | -C "got an alert message, type: \\[2:120]" \ |
| 2083 | -s "server hello, adding alpn extension" \ |
| 2084 | -c "found alpn extension" \ |
| 2085 | -c "Application Layer Protocol is 1234" \ |
| 2086 | -s "Application Layer Protocol is 1234" |
| 2087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2088 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2089 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 2090 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2091 | 1 \ |
| 2092 | -c "client hello, adding alpn extension" \ |
| 2093 | -s "found alpn extension" \ |
| 2094 | -c "got an alert message, type: \\[2:120]" \ |
| 2095 | -S "server hello, adding alpn extension" \ |
| 2096 | -C "found alpn extension" \ |
| 2097 | -C "Application Layer Protocol is 1234" \ |
| 2098 | -S "Application Layer Protocol is 1234" |
| 2099 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2100 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2101 | # Tests for keyUsage in leaf certificates, part 1: |
| 2102 | # server-side certificate/suite selection |
| 2103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2104 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2105 | "$P_SRV key_file=data_files/server2.key \ |
| 2106 | crt_file=data_files/server2.ku-ds.crt" \ |
| 2107 | "$P_CLI" \ |
| 2108 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2109 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2110 | |
| 2111 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2112 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2113 | "$P_SRV key_file=data_files/server2.key \ |
| 2114 | crt_file=data_files/server2.ku-ke.crt" \ |
| 2115 | "$P_CLI" \ |
| 2116 | 0 \ |
| 2117 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 2118 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2119 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2120 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2121 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2122 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2123 | 1 \ |
| 2124 | -C "Ciphersuite is " |
| 2125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2126 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2127 | "$P_SRV key_file=data_files/server5.key \ |
| 2128 | crt_file=data_files/server5.ku-ds.crt" \ |
| 2129 | "$P_CLI" \ |
| 2130 | 0 \ |
| 2131 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 2132 | |
| 2133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2134 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2135 | "$P_SRV key_file=data_files/server5.key \ |
| 2136 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2137 | "$P_CLI" \ |
| 2138 | 0 \ |
| 2139 | -c "Ciphersuite is TLS-ECDH-" |
| 2140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2141 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2142 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2143 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2144 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2145 | 1 \ |
| 2146 | -C "Ciphersuite is " |
| 2147 | |
| 2148 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2149 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2150 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2151 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2152 | "$O_SRV -key data_files/server2.key \ |
| 2153 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2154 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2155 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2156 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2157 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2158 | -C "Processing of the Certificate handshake message failed" \ |
| 2159 | -c "Ciphersuite is TLS-" |
| 2160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2161 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2162 | "$O_SRV -key data_files/server2.key \ |
| 2163 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2164 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2165 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2166 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2167 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2168 | -C "Processing of the Certificate handshake message failed" \ |
| 2169 | -c "Ciphersuite is TLS-" |
| 2170 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2171 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2172 | "$O_SRV -key data_files/server2.key \ |
| 2173 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2174 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2175 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2176 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2177 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2178 | -C "Processing of the Certificate handshake message failed" \ |
| 2179 | -c "Ciphersuite is TLS-" |
| 2180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2181 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2182 | "$O_SRV -key data_files/server2.key \ |
| 2183 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2184 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2185 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2186 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2187 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2188 | -c "Processing of the Certificate handshake message failed" \ |
| 2189 | -C "Ciphersuite is TLS-" |
| 2190 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2191 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 2192 | "$O_SRV -key data_files/server2.key \ |
| 2193 | -cert data_files/server2.ku-ke.crt" \ |
| 2194 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2195 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2196 | 0 \ |
| 2197 | -c "bad certificate (usage extensions)" \ |
| 2198 | -C "Processing of the Certificate handshake message failed" \ |
| 2199 | -c "Ciphersuite is TLS-" \ |
| 2200 | -c "! Usage does not match the keyUsage extension" |
| 2201 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2202 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2203 | "$O_SRV -key data_files/server2.key \ |
| 2204 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2205 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2206 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2207 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2208 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2209 | -C "Processing of the Certificate handshake message failed" \ |
| 2210 | -c "Ciphersuite is TLS-" |
| 2211 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2212 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2213 | "$O_SRV -key data_files/server2.key \ |
| 2214 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2215 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2216 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2217 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2218 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2219 | -c "Processing of the Certificate handshake message failed" \ |
| 2220 | -C "Ciphersuite is TLS-" |
| 2221 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2222 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 2223 | "$O_SRV -key data_files/server2.key \ |
| 2224 | -cert data_files/server2.ku-ds.crt" \ |
| 2225 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2226 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2227 | 0 \ |
| 2228 | -c "bad certificate (usage extensions)" \ |
| 2229 | -C "Processing of the Certificate handshake message failed" \ |
| 2230 | -c "Ciphersuite is TLS-" \ |
| 2231 | -c "! Usage does not match the keyUsage extension" |
| 2232 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2233 | # Tests for keyUsage in leaf certificates, part 3: |
| 2234 | # server-side checking of client cert |
| 2235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2236 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2237 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2238 | "$O_CLI -key data_files/server2.key \ |
| 2239 | -cert data_files/server2.ku-ds.crt" \ |
| 2240 | 0 \ |
| 2241 | -S "bad certificate (usage extensions)" \ |
| 2242 | -S "Processing of the Certificate handshake message failed" |
| 2243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2244 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2245 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2246 | "$O_CLI -key data_files/server2.key \ |
| 2247 | -cert data_files/server2.ku-ke.crt" \ |
| 2248 | 0 \ |
| 2249 | -s "bad certificate (usage extensions)" \ |
| 2250 | -S "Processing of the Certificate handshake message failed" |
| 2251 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2252 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2253 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2254 | "$O_CLI -key data_files/server2.key \ |
| 2255 | -cert data_files/server2.ku-ke.crt" \ |
| 2256 | 1 \ |
| 2257 | -s "bad certificate (usage extensions)" \ |
| 2258 | -s "Processing of the Certificate handshake message failed" |
| 2259 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2260 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2261 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2262 | "$O_CLI -key data_files/server5.key \ |
| 2263 | -cert data_files/server5.ku-ds.crt" \ |
| 2264 | 0 \ |
| 2265 | -S "bad certificate (usage extensions)" \ |
| 2266 | -S "Processing of the Certificate handshake message failed" |
| 2267 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2268 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2269 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2270 | "$O_CLI -key data_files/server5.key \ |
| 2271 | -cert data_files/server5.ku-ka.crt" \ |
| 2272 | 0 \ |
| 2273 | -s "bad certificate (usage extensions)" \ |
| 2274 | -S "Processing of the Certificate handshake message failed" |
| 2275 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2276 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 2277 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2278 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2279 | "$P_SRV key_file=data_files/server5.key \ |
| 2280 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2281 | "$P_CLI" \ |
| 2282 | 0 |
| 2283 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2284 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2285 | "$P_SRV key_file=data_files/server5.key \ |
| 2286 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2287 | "$P_CLI" \ |
| 2288 | 0 |
| 2289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2290 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2291 | "$P_SRV key_file=data_files/server5.key \ |
| 2292 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 2293 | "$P_CLI" \ |
| 2294 | 0 |
| 2295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2296 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2297 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2298 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2299 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2300 | 1 |
| 2301 | |
| 2302 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 2303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2304 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2305 | "$O_SRV -key data_files/server5.key \ |
| 2306 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2307 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2308 | 0 \ |
| 2309 | -C "bad certificate (usage extensions)" \ |
| 2310 | -C "Processing of the Certificate handshake message failed" \ |
| 2311 | -c "Ciphersuite is TLS-" |
| 2312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2313 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2314 | "$O_SRV -key data_files/server5.key \ |
| 2315 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2316 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2317 | 0 \ |
| 2318 | -C "bad certificate (usage extensions)" \ |
| 2319 | -C "Processing of the Certificate handshake message failed" \ |
| 2320 | -c "Ciphersuite is TLS-" |
| 2321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2322 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2323 | "$O_SRV -key data_files/server5.key \ |
| 2324 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2325 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2326 | 0 \ |
| 2327 | -C "bad certificate (usage extensions)" \ |
| 2328 | -C "Processing of the Certificate handshake message failed" \ |
| 2329 | -c "Ciphersuite is TLS-" |
| 2330 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2331 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2332 | "$O_SRV -key data_files/server5.key \ |
| 2333 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2334 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2335 | 1 \ |
| 2336 | -c "bad certificate (usage extensions)" \ |
| 2337 | -c "Processing of the Certificate handshake message failed" \ |
| 2338 | -C "Ciphersuite is TLS-" |
| 2339 | |
| 2340 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 2341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2342 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2343 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2344 | "$O_CLI -key data_files/server5.key \ |
| 2345 | -cert data_files/server5.eku-cli.crt" \ |
| 2346 | 0 \ |
| 2347 | -S "bad certificate (usage extensions)" \ |
| 2348 | -S "Processing of the Certificate handshake message failed" |
| 2349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2350 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2351 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2352 | "$O_CLI -key data_files/server5.key \ |
| 2353 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 2354 | 0 \ |
| 2355 | -S "bad certificate (usage extensions)" \ |
| 2356 | -S "Processing of the Certificate handshake message failed" |
| 2357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2358 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2359 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2360 | "$O_CLI -key data_files/server5.key \ |
| 2361 | -cert data_files/server5.eku-cs_any.crt" \ |
| 2362 | 0 \ |
| 2363 | -S "bad certificate (usage extensions)" \ |
| 2364 | -S "Processing of the Certificate handshake message failed" |
| 2365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2366 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2367 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2368 | "$O_CLI -key data_files/server5.key \ |
| 2369 | -cert data_files/server5.eku-cs.crt" \ |
| 2370 | 0 \ |
| 2371 | -s "bad certificate (usage extensions)" \ |
| 2372 | -S "Processing of the Certificate handshake message failed" |
| 2373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2374 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2375 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2376 | "$O_CLI -key data_files/server5.key \ |
| 2377 | -cert data_files/server5.eku-cs.crt" \ |
| 2378 | 1 \ |
| 2379 | -s "bad certificate (usage extensions)" \ |
| 2380 | -s "Processing of the Certificate handshake message failed" |
| 2381 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2382 | # Tests for DHM parameters loading |
| 2383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2384 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2385 | "$P_SRV" \ |
| 2386 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2387 | debug_level=3" \ |
| 2388 | 0 \ |
| 2389 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 2390 | -c "value of 'DHM: G ' (2048 bits)" |
| 2391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2392 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2393 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2394 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2395 | debug_level=3" \ |
| 2396 | 0 \ |
| 2397 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 2398 | -c "value of 'DHM: G ' (2 bits)" |
| 2399 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 2400 | # Tests for DHM client-side size checking |
| 2401 | |
| 2402 | run_test "DHM size: server default, client default, OK" \ |
| 2403 | "$P_SRV" \ |
| 2404 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2405 | debug_level=1" \ |
| 2406 | 0 \ |
| 2407 | -C "DHM prime too short:" |
| 2408 | |
| 2409 | run_test "DHM size: server default, client 2048, OK" \ |
| 2410 | "$P_SRV" \ |
| 2411 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2412 | debug_level=1 dhmlen=2048" \ |
| 2413 | 0 \ |
| 2414 | -C "DHM prime too short:" |
| 2415 | |
| 2416 | run_test "DHM size: server 1024, client default, OK" \ |
| 2417 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2418 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2419 | debug_level=1" \ |
| 2420 | 0 \ |
| 2421 | -C "DHM prime too short:" |
| 2422 | |
| 2423 | run_test "DHM size: server 1000, client default, rejected" \ |
| 2424 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 2425 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2426 | debug_level=1" \ |
| 2427 | 1 \ |
| 2428 | -c "DHM prime too short:" |
| 2429 | |
| 2430 | run_test "DHM size: server default, client 2049, rejected" \ |
| 2431 | "$P_SRV" \ |
| 2432 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2433 | debug_level=1 dhmlen=2049" \ |
| 2434 | 1 \ |
| 2435 | -c "DHM prime too short:" |
| 2436 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2437 | # Tests for PSK callback |
| 2438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2439 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2440 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 2441 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2442 | psk_identity=foo psk=abc123" \ |
| 2443 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2444 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2445 | -S "SSL - Unknown identity received" \ |
| 2446 | -S "SSL - Verification of the message MAC failed" |
| 2447 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2448 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2449 | "$P_SRV" \ |
| 2450 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2451 | psk_identity=foo psk=abc123" \ |
| 2452 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2453 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2454 | -S "SSL - Unknown identity received" \ |
| 2455 | -S "SSL - Verification of the message MAC failed" |
| 2456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2457 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2458 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 2459 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2460 | psk_identity=foo psk=abc123" \ |
| 2461 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2462 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2463 | -s "SSL - Unknown identity received" \ |
| 2464 | -S "SSL - Verification of the message MAC failed" |
| 2465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2466 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2467 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2468 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2469 | psk_identity=abc psk=dead" \ |
| 2470 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2471 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2472 | -S "SSL - Unknown identity received" \ |
| 2473 | -S "SSL - Verification of the message MAC failed" |
| 2474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2475 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2476 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2477 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2478 | psk_identity=def psk=beef" \ |
| 2479 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2480 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2481 | -S "SSL - Unknown identity received" \ |
| 2482 | -S "SSL - Verification of the message MAC failed" |
| 2483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2484 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2485 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2486 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2487 | psk_identity=ghi psk=beef" \ |
| 2488 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2489 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2490 | -s "SSL - Unknown identity received" \ |
| 2491 | -S "SSL - Verification of the message MAC failed" |
| 2492 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2493 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2494 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2495 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2496 | psk_identity=abc psk=beef" \ |
| 2497 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2498 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2499 | -S "SSL - Unknown identity received" \ |
| 2500 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2501 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2502 | # Tests for ciphersuites per version |
| 2503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2504 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2505 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-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] | 2506 | "$P_CLI force_version=ssl3" \ |
| 2507 | 0 \ |
| 2508 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2509 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2510 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2511 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2512 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2513 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2514 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2516 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2517 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-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] | 2518 | "$P_CLI force_version=tls1_1" \ |
| 2519 | 0 \ |
| 2520 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2522 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2523 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-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] | 2524 | "$P_CLI force_version=tls1_2" \ |
| 2525 | 0 \ |
| 2526 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2527 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 2528 | # Test for ClientHello without extensions |
| 2529 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 2530 | requires_gnutls |
| 2531 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 2532 | "$P_SRV debug_level=3" \ |
| 2533 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2534 | 0 \ |
| 2535 | -s "dumping 'client hello extensions' (0 bytes)" |
| 2536 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2537 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2538 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2539 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2540 | "$P_SRV" \ |
| 2541 | "$P_CLI request_size=100" \ |
| 2542 | 0 \ |
| 2543 | -s "Read from client: 100 bytes read$" |
| 2544 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2545 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2546 | "$P_SRV" \ |
| 2547 | "$P_CLI request_size=500" \ |
| 2548 | 0 \ |
| 2549 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2550 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2551 | # Tests for small packets |
| 2552 | |
| 2553 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2554 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2555 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2556 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2557 | 0 \ |
| 2558 | -s "Read from client: 1 bytes read" |
| 2559 | |
| 2560 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2561 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2562 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2563 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2564 | 0 \ |
| 2565 | -s "Read from client: 1 bytes read" |
| 2566 | |
| 2567 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2568 | "$P_SRV" \ |
| 2569 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2570 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2571 | 0 \ |
| 2572 | -s "Read from client: 1 bytes read" |
| 2573 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2574 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2575 | "$P_SRV" \ |
| 2576 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2577 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2578 | 0 \ |
| 2579 | -s "Read from client: 1 bytes read" |
| 2580 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2581 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2582 | "$P_SRV" \ |
| 2583 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2584 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2585 | trunc_hmac=1" \ |
| 2586 | 0 \ |
| 2587 | -s "Read from client: 1 bytes read" |
| 2588 | |
| 2589 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2590 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2591 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2592 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2593 | trunc_hmac=1" \ |
| 2594 | 0 \ |
| 2595 | -s "Read from client: 1 bytes read" |
| 2596 | |
| 2597 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2598 | "$P_SRV" \ |
| 2599 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2600 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2601 | 0 \ |
| 2602 | -s "Read from client: 1 bytes read" |
| 2603 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2604 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2605 | "$P_SRV" \ |
| 2606 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2607 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2608 | 0 \ |
| 2609 | -s "Read from client: 1 bytes read" |
| 2610 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2611 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2612 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2613 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2614 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2615 | 0 \ |
| 2616 | -s "Read from client: 1 bytes read" |
| 2617 | |
| 2618 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2619 | "$P_SRV" \ |
| 2620 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2621 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2622 | trunc_hmac=1" \ |
| 2623 | 0 \ |
| 2624 | -s "Read from client: 1 bytes read" |
| 2625 | |
| 2626 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2627 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2628 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2629 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2630 | trunc_hmac=1" \ |
| 2631 | 0 \ |
| 2632 | -s "Read from client: 1 bytes read" |
| 2633 | |
| 2634 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2635 | "$P_SRV" \ |
| 2636 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2637 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2638 | 0 \ |
| 2639 | -s "Read from client: 1 bytes read" |
| 2640 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2641 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2642 | "$P_SRV" \ |
| 2643 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2644 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2645 | 0 \ |
| 2646 | -s "Read from client: 1 bytes read" |
| 2647 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2648 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2649 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2650 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2651 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2652 | 0 \ |
| 2653 | -s "Read from client: 1 bytes read" |
| 2654 | |
| 2655 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2656 | "$P_SRV" \ |
| 2657 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2658 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2659 | trunc_hmac=1" \ |
| 2660 | 0 \ |
| 2661 | -s "Read from client: 1 bytes read" |
| 2662 | |
| 2663 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2664 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2665 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2666 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2667 | 0 \ |
| 2668 | -s "Read from client: 1 bytes read" |
| 2669 | |
| 2670 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2671 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2672 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2673 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2674 | trunc_hmac=1" \ |
| 2675 | 0 \ |
| 2676 | -s "Read from client: 1 bytes read" |
| 2677 | |
| 2678 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2679 | "$P_SRV" \ |
| 2680 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2681 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2682 | 0 \ |
| 2683 | -s "Read from client: 1 bytes read" |
| 2684 | |
| 2685 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2686 | "$P_SRV" \ |
| 2687 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2688 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2689 | 0 \ |
| 2690 | -s "Read from client: 1 bytes read" |
| 2691 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2692 | # Test for large packets |
| 2693 | |
| 2694 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2695 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2696 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2697 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2698 | 0 \ |
| 2699 | -s "Read from client: 16384 bytes read" |
| 2700 | |
| 2701 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2702 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2703 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2704 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2705 | 0 \ |
| 2706 | -s "Read from client: 16384 bytes read" |
| 2707 | |
| 2708 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2709 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2710 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2711 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2712 | 0 \ |
| 2713 | -s "Read from client: 16384 bytes read" |
| 2714 | |
| 2715 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2716 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2717 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2718 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2719 | trunc_hmac=1" \ |
| 2720 | 0 \ |
| 2721 | -s "Read from client: 16384 bytes read" |
| 2722 | |
| 2723 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2724 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2725 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2726 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2727 | trunc_hmac=1" \ |
| 2728 | 0 \ |
| 2729 | -s "Read from client: 16384 bytes read" |
| 2730 | |
| 2731 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2732 | "$P_SRV" \ |
| 2733 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2734 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2735 | 0 \ |
| 2736 | -s "Read from client: 16384 bytes read" |
| 2737 | |
| 2738 | run_test "Large packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2739 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2740 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2741 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2742 | 0 \ |
| 2743 | -s "Read from client: 16384 bytes read" |
| 2744 | |
| 2745 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2746 | "$P_SRV" \ |
| 2747 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2749 | trunc_hmac=1" \ |
| 2750 | 0 \ |
| 2751 | -s "Read from client: 16384 bytes read" |
| 2752 | |
| 2753 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2754 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2755 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2756 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2757 | trunc_hmac=1" \ |
| 2758 | 0 \ |
| 2759 | -s "Read from client: 16384 bytes read" |
| 2760 | |
| 2761 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2762 | "$P_SRV" \ |
| 2763 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2764 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2765 | 0 \ |
| 2766 | -s "Read from client: 16384 bytes read" |
| 2767 | |
| 2768 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2769 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2770 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2771 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2772 | 0 \ |
| 2773 | -s "Read from client: 16384 bytes read" |
| 2774 | |
| 2775 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2776 | "$P_SRV" \ |
| 2777 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2779 | trunc_hmac=1" \ |
| 2780 | 0 \ |
| 2781 | -s "Read from client: 16384 bytes read" |
| 2782 | |
| 2783 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2784 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2785 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2786 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2787 | 0 \ |
| 2788 | -s "Read from client: 16384 bytes read" |
| 2789 | |
| 2790 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2791 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2792 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2793 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2794 | trunc_hmac=1" \ |
| 2795 | 0 \ |
| 2796 | -s "Read from client: 16384 bytes read" |
| 2797 | |
| 2798 | run_test "Large packet TLS 1.2 AEAD" \ |
| 2799 | "$P_SRV" \ |
| 2800 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2801 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2802 | 0 \ |
| 2803 | -s "Read from client: 16384 bytes read" |
| 2804 | |
| 2805 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 2806 | "$P_SRV" \ |
| 2807 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2809 | 0 \ |
| 2810 | -s "Read from client: 16384 bytes read" |
| 2811 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2812 | # Tests for DTLS HelloVerifyRequest |
| 2813 | |
| 2814 | run_test "DTLS cookie: enabled" \ |
| 2815 | "$P_SRV dtls=1 debug_level=2" \ |
| 2816 | "$P_CLI dtls=1 debug_level=2" \ |
| 2817 | 0 \ |
| 2818 | -s "cookie verification failed" \ |
| 2819 | -s "cookie verification passed" \ |
| 2820 | -S "cookie verification skipped" \ |
| 2821 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2822 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2823 | -S "SSL - The requested feature is not available" |
| 2824 | |
| 2825 | run_test "DTLS cookie: disabled" \ |
| 2826 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 2827 | "$P_CLI dtls=1 debug_level=2" \ |
| 2828 | 0 \ |
| 2829 | -S "cookie verification failed" \ |
| 2830 | -S "cookie verification passed" \ |
| 2831 | -s "cookie verification skipped" \ |
| 2832 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2833 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2834 | -S "SSL - The requested feature is not available" |
| 2835 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2836 | run_test "DTLS cookie: default (failing)" \ |
| 2837 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 2838 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 2839 | 1 \ |
| 2840 | -s "cookie verification failed" \ |
| 2841 | -S "cookie verification passed" \ |
| 2842 | -S "cookie verification skipped" \ |
| 2843 | -C "received hello verify request" \ |
| 2844 | -S "hello verification requested" \ |
| 2845 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2846 | |
| 2847 | requires_ipv6 |
| 2848 | run_test "DTLS cookie: enabled, IPv6" \ |
| 2849 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 2850 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 2851 | 0 \ |
| 2852 | -s "cookie verification failed" \ |
| 2853 | -s "cookie verification passed" \ |
| 2854 | -S "cookie verification skipped" \ |
| 2855 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2856 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2857 | -S "SSL - The requested feature is not available" |
| 2858 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2859 | run_test "DTLS cookie: enabled, nbio" \ |
| 2860 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 2861 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2862 | 0 \ |
| 2863 | -s "cookie verification failed" \ |
| 2864 | -s "cookie verification passed" \ |
| 2865 | -S "cookie verification skipped" \ |
| 2866 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2867 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2868 | -S "SSL - The requested feature is not available" |
| 2869 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2870 | # Tests for various cases of client authentication with DTLS |
| 2871 | # (focused on handshake flows and message parsing) |
| 2872 | |
| 2873 | run_test "DTLS client auth: required" \ |
| 2874 | "$P_SRV dtls=1 auth_mode=required" \ |
| 2875 | "$P_CLI dtls=1" \ |
| 2876 | 0 \ |
| 2877 | -s "Verifying peer X.509 certificate... ok" |
| 2878 | |
| 2879 | run_test "DTLS client auth: optional, client has no cert" \ |
| 2880 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 2881 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 2882 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2883 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2884 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2885 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2886 | "$P_SRV dtls=1 auth_mode=none" \ |
| 2887 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 2888 | 0 \ |
| 2889 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2890 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2891 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 2892 | run_test "DTLS wrong PSK: badmac alert" \ |
| 2893 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 2894 | "$P_CLI dtls=1 psk=abc124" \ |
| 2895 | 1 \ |
| 2896 | -s "SSL - Verification of the message MAC failed" \ |
| 2897 | -c "SSL - A fatal alert message was received from our peer" |
| 2898 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 2899 | # Tests for receiving fragmented handshake messages with DTLS |
| 2900 | |
| 2901 | requires_gnutls |
| 2902 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 2903 | "$G_SRV -u --mtu 2048 -a" \ |
| 2904 | "$P_CLI dtls=1 debug_level=2" \ |
| 2905 | 0 \ |
| 2906 | -C "found fragmented DTLS handshake message" \ |
| 2907 | -C "error" |
| 2908 | |
| 2909 | requires_gnutls |
| 2910 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 2911 | "$G_SRV -u --mtu 512" \ |
| 2912 | "$P_CLI dtls=1 debug_level=2" \ |
| 2913 | 0 \ |
| 2914 | -c "found fragmented DTLS handshake message" \ |
| 2915 | -C "error" |
| 2916 | |
| 2917 | requires_gnutls |
| 2918 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 2919 | "$G_SRV -u --mtu 128" \ |
| 2920 | "$P_CLI dtls=1 debug_level=2" \ |
| 2921 | 0 \ |
| 2922 | -c "found fragmented DTLS handshake message" \ |
| 2923 | -C "error" |
| 2924 | |
| 2925 | requires_gnutls |
| 2926 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 2927 | "$G_SRV -u --mtu 128" \ |
| 2928 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2929 | 0 \ |
| 2930 | -c "found fragmented DTLS handshake message" \ |
| 2931 | -C "error" |
| 2932 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2933 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2934 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 2935 | "$G_SRV -u --mtu 256" \ |
| 2936 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2937 | 0 \ |
| 2938 | -c "found fragmented DTLS handshake message" \ |
| 2939 | -c "client hello, adding renegotiation extension" \ |
| 2940 | -c "found renegotiation extension" \ |
| 2941 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2942 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2943 | -C "error" \ |
| 2944 | -s "Extra-header:" |
| 2945 | |
| 2946 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2947 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 2948 | "$G_SRV -u --mtu 256" \ |
| 2949 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2950 | 0 \ |
| 2951 | -c "found fragmented DTLS handshake message" \ |
| 2952 | -c "client hello, adding renegotiation extension" \ |
| 2953 | -c "found renegotiation extension" \ |
| 2954 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2955 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2956 | -C "error" \ |
| 2957 | -s "Extra-header:" |
| 2958 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2959 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 2960 | "$O_SRV -dtls1 -mtu 2048" \ |
| 2961 | "$P_CLI dtls=1 debug_level=2" \ |
| 2962 | 0 \ |
| 2963 | -C "found fragmented DTLS handshake message" \ |
| 2964 | -C "error" |
| 2965 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2966 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 2967 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2968 | "$P_CLI dtls=1 debug_level=2" \ |
| 2969 | 0 \ |
| 2970 | -c "found fragmented DTLS handshake message" \ |
| 2971 | -C "error" |
| 2972 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2973 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2974 | "$O_SRV -dtls1 -mtu 256" \ |
| 2975 | "$P_CLI dtls=1 debug_level=2" \ |
| 2976 | 0 \ |
| 2977 | -c "found fragmented DTLS handshake message" \ |
| 2978 | -C "error" |
| 2979 | |
| 2980 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 2981 | "$O_SRV -dtls1 -mtu 256" \ |
| 2982 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2983 | 0 \ |
| 2984 | -c "found fragmented DTLS handshake message" \ |
| 2985 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2986 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 2987 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2988 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2989 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2990 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2991 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2992 | "$P_SRV dtls=1 debug_level=2" \ |
| 2993 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2994 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2995 | -C "replayed record" \ |
| 2996 | -S "replayed record" \ |
| 2997 | -C "record from another epoch" \ |
| 2998 | -S "record from another epoch" \ |
| 2999 | -C "discarding invalid record" \ |
| 3000 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3001 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3002 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3003 | -c "HTTP/1.0 200 OK" |
| 3004 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3005 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3006 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3007 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3008 | "$P_SRV dtls=1 debug_level=2" \ |
| 3009 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3010 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3011 | -c "replayed record" \ |
| 3012 | -s "replayed record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3013 | -c "discarding invalid record" \ |
| 3014 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3015 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3016 | -s "Extra-header:" \ |
| 3017 | -c "HTTP/1.0 200 OK" |
| 3018 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3019 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 3020 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3021 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 3022 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3023 | 0 \ |
| 3024 | -c "replayed record" \ |
| 3025 | -S "replayed record" \ |
| 3026 | -c "discarding invalid record" \ |
| 3027 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3028 | -c "resend" \ |
| 3029 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3030 | -s "Extra-header:" \ |
| 3031 | -c "HTTP/1.0 200 OK" |
| 3032 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3033 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3034 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3035 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3036 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3037 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3038 | -c "discarding invalid record (mac)" \ |
| 3039 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3040 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3041 | -c "HTTP/1.0 200 OK" \ |
| 3042 | -S "too many records with bad MAC" \ |
| 3043 | -S "Verification of the message MAC failed" |
| 3044 | |
| 3045 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 3046 | -p "$P_PXY bad_ad=1" \ |
| 3047 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 3048 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 3049 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3050 | -C "discarding invalid record (mac)" \ |
| 3051 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3052 | -S "Extra-header:" \ |
| 3053 | -C "HTTP/1.0 200 OK" \ |
| 3054 | -s "too many records with bad MAC" \ |
| 3055 | -s "Verification of the message MAC failed" |
| 3056 | |
| 3057 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 3058 | -p "$P_PXY bad_ad=1" \ |
| 3059 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 3060 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 3061 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3062 | -c "discarding invalid record (mac)" \ |
| 3063 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3064 | -s "Extra-header:" \ |
| 3065 | -c "HTTP/1.0 200 OK" \ |
| 3066 | -S "too many records with bad MAC" \ |
| 3067 | -S "Verification of the message MAC failed" |
| 3068 | |
| 3069 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 3070 | -p "$P_PXY bad_ad=1" \ |
| 3071 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 3072 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 3073 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3074 | -c "discarding invalid record (mac)" \ |
| 3075 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3076 | -s "Extra-header:" \ |
| 3077 | -c "HTTP/1.0 200 OK" \ |
| 3078 | -s "too many records with bad MAC" \ |
| 3079 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3080 | |
| 3081 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3082 | -p "$P_PXY delay_ccs=1" \ |
| 3083 | "$P_SRV dtls=1 debug_level=1" \ |
| 3084 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3085 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3086 | -c "record from another epoch" \ |
| 3087 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3088 | -c "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3089 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3090 | -s "Extra-header:" \ |
| 3091 | -c "HTTP/1.0 200 OK" |
| 3092 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 3093 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3094 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3095 | needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3096 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3097 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3098 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3099 | psk=abc123" \ |
| 3100 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3101 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3102 | 0 \ |
| 3103 | -s "Extra-header:" \ |
| 3104 | -c "HTTP/1.0 200 OK" |
| 3105 | |
| 3106 | needs_more_time 2 |
| 3107 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 3108 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3109 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3110 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3111 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3112 | 0 \ |
| 3113 | -s "Extra-header:" \ |
| 3114 | -c "HTTP/1.0 200 OK" |
| 3115 | |
| 3116 | needs_more_time 2 |
| 3117 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 3118 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3119 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3120 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3121 | 0 \ |
| 3122 | -s "Extra-header:" \ |
| 3123 | -c "HTTP/1.0 200 OK" |
| 3124 | |
| 3125 | needs_more_time 2 |
| 3126 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 3127 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3128 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 3129 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3130 | 0 \ |
| 3131 | -s "Extra-header:" \ |
| 3132 | -c "HTTP/1.0 200 OK" |
| 3133 | |
| 3134 | needs_more_time 2 |
| 3135 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 3136 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3137 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 3138 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3139 | 0 \ |
| 3140 | -s "Extra-header:" \ |
| 3141 | -c "HTTP/1.0 200 OK" |
| 3142 | |
| 3143 | needs_more_time 2 |
| 3144 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 3145 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3146 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 3147 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3148 | 0 \ |
| 3149 | -s "Extra-header:" \ |
| 3150 | -c "HTTP/1.0 200 OK" |
| 3151 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3152 | needs_more_time 2 |
| 3153 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 3154 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3155 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 3156 | auth_mode=required" \ |
| 3157 | "$P_CLI dtls=1 hs_timeout=250-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3158 | 0 \ |
| 3159 | -s "Extra-header:" \ |
| 3160 | -c "HTTP/1.0 200 OK" |
| 3161 | |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3162 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 3163 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 3164 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3165 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3166 | psk=abc123 debug_level=3" \ |
| 3167 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3168 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3169 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3170 | 0 \ |
| 3171 | -s "a session has been resumed" \ |
| 3172 | -c "a session has been resumed" \ |
| 3173 | -s "Extra-header:" \ |
| 3174 | -c "HTTP/1.0 200 OK" |
| 3175 | |
| 3176 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 3177 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 3178 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3179 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3180 | psk=abc123 debug_level=3 nbio=2" \ |
| 3181 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3182 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3183 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 3184 | 0 \ |
| 3185 | -s "a session has been resumed" \ |
| 3186 | -c "a session has been resumed" \ |
| 3187 | -s "Extra-header:" \ |
| 3188 | -c "HTTP/1.0 200 OK" |
| 3189 | |
| 3190 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3191 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3192 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3193 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3194 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3195 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3196 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3197 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3198 | 0 \ |
| 3199 | -c "=> renegotiate" \ |
| 3200 | -s "=> renegotiate" \ |
| 3201 | -s "Extra-header:" \ |
| 3202 | -c "HTTP/1.0 200 OK" |
| 3203 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3204 | needs_more_time 4 |
| 3205 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 3206 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3207 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3208 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3209 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3210 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3211 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3212 | 0 \ |
| 3213 | -c "=> renegotiate" \ |
| 3214 | -s "=> renegotiate" \ |
| 3215 | -s "Extra-header:" \ |
| 3216 | -c "HTTP/1.0 200 OK" |
| 3217 | |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3218 | needs_more_time 4 |
| 3219 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3220 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3221 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3222 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3223 | debug_level=2" \ |
| 3224 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3225 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3226 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3227 | 0 \ |
| 3228 | -c "=> renegotiate" \ |
| 3229 | -s "=> renegotiate" \ |
| 3230 | -s "Extra-header:" \ |
| 3231 | -c "HTTP/1.0 200 OK" |
| 3232 | |
| 3233 | needs_more_time 4 |
| 3234 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3236 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3237 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3238 | debug_level=2 nbio=2" \ |
| 3239 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3240 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3241 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3242 | 0 \ |
| 3243 | -c "=> renegotiate" \ |
| 3244 | -s "=> renegotiate" \ |
| 3245 | -s "Extra-header:" \ |
| 3246 | -c "HTTP/1.0 200 OK" |
| 3247 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3248 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3249 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3250 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3251 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3252 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3253 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3254 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3255 | -c "HTTP/1.0 200 OK" |
| 3256 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3257 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3258 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3259 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 3260 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3261 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3262 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3263 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3264 | -c "HTTP/1.0 200 OK" |
| 3265 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3266 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3267 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3268 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 3269 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3270 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3271 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3272 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3273 | -c "HTTP/1.0 200 OK" |
| 3274 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3275 | requires_gnutls |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3276 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3277 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3278 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 3279 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3280 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3281 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3282 | 0 \ |
| 3283 | -s "Extra-header:" \ |
| 3284 | -c "Extra-header:" |
| 3285 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3286 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3287 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3288 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3289 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 3290 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3291 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3292 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3293 | 0 \ |
| 3294 | -s "Extra-header:" \ |
| 3295 | -c "Extra-header:" |
| 3296 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3297 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3298 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 3299 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3300 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 3301 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3302 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3303 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3304 | 0 \ |
| 3305 | -s "Extra-header:" \ |
| 3306 | -c "Extra-header:" |
| 3307 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3308 | # Final report |
| 3309 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3310 | echo "------------------------------------------------------------------------" |
| 3311 | |
| 3312 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3313 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3314 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3315 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3316 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 3317 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 3318 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3319 | |
| 3320 | exit $FAILS |