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