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