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" |
| 520 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 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 | 89addc4 | 2015-04-20 10:56:18 +0100 | [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 | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [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" |
| 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 | 76b8ab7 | 2014-03-26 09:31:35 +0100 | [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 | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [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" |
| 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 | 76b8ab7 | 2014-03-26 09:31:35 +0100 | [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 | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1773 | 0 \ |
| 1774 | -s "parse ServerName extension" \ |
| 1775 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
Manuel Pégourié-Gonnard | 76b8ab7 | 2014-03-26 09:31:35 +0100 | [diff] [blame] | 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 | 76b8ab7 | 2014-03-26 09:31:35 +0100 | [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 | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1783 | 1 \ |
| 1784 | -s "parse ServerName extension" \ |
| 1785 | -s "ssl_sni_wrapper() returned" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1786 | -s "mbedtls_ssl_handshake returned" \ |
| 1787 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1788 | -c "SSL - A fatal alert message was received from our peer" |
| 1789 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1790 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1792 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1793 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1794 | "$P_CLI nbio=2 tickets=0" \ |
| 1795 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1796 | -S "mbedtls_ssl_handshake returned" \ |
| 1797 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1798 | -c "Read from server: .* bytes read" |
| 1799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1800 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1801 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1802 | "$P_CLI nbio=2 tickets=0" \ |
| 1803 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1804 | -S "mbedtls_ssl_handshake returned" \ |
| 1805 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1806 | -c "Read from server: .* bytes read" |
| 1807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1808 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1809 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1810 | "$P_CLI nbio=2 tickets=1" \ |
| 1811 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1812 | -S "mbedtls_ssl_handshake returned" \ |
| 1813 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1814 | -c "Read from server: .* bytes read" |
| 1815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1816 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1817 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1818 | "$P_CLI nbio=2 tickets=1" \ |
| 1819 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1820 | -S "mbedtls_ssl_handshake returned" \ |
| 1821 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1822 | -c "Read from server: .* bytes read" |
| 1823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1824 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1825 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1826 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1827 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1828 | -S "mbedtls_ssl_handshake returned" \ |
| 1829 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1830 | -c "Read from server: .* bytes read" |
| 1831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1832 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1833 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1834 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1835 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1836 | -S "mbedtls_ssl_handshake returned" \ |
| 1837 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1838 | -c "Read from server: .* bytes read" |
| 1839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1840 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1841 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1842 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1843 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1844 | -S "mbedtls_ssl_handshake returned" \ |
| 1845 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1846 | -c "Read from server: .* bytes read" |
| 1847 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1848 | # Tests for version negotiation |
| 1849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1850 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1851 | "$P_SRV" \ |
| 1852 | "$P_CLI" \ |
| 1853 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1854 | -S "mbedtls_ssl_handshake returned" \ |
| 1855 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1856 | -s "Protocol is TLSv1.2" \ |
| 1857 | -c "Protocol is TLSv1.2" |
| 1858 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1859 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1860 | "$P_SRV" \ |
| 1861 | "$P_CLI max_version=tls1_1" \ |
| 1862 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1863 | -S "mbedtls_ssl_handshake returned" \ |
| 1864 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1865 | -s "Protocol is TLSv1.1" \ |
| 1866 | -c "Protocol is TLSv1.1" |
| 1867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1868 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1869 | "$P_SRV max_version=tls1_1" \ |
| 1870 | "$P_CLI" \ |
| 1871 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1872 | -S "mbedtls_ssl_handshake returned" \ |
| 1873 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1874 | -s "Protocol is TLSv1.1" \ |
| 1875 | -c "Protocol is TLSv1.1" |
| 1876 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1877 | 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] | 1878 | "$P_SRV max_version=tls1_1" \ |
| 1879 | "$P_CLI max_version=tls1_1" \ |
| 1880 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1881 | -S "mbedtls_ssl_handshake returned" \ |
| 1882 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1883 | -s "Protocol is TLSv1.1" \ |
| 1884 | -c "Protocol is TLSv1.1" |
| 1885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1886 | 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] | 1887 | "$P_SRV min_version=tls1_1" \ |
| 1888 | "$P_CLI max_version=tls1_1" \ |
| 1889 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1890 | -S "mbedtls_ssl_handshake returned" \ |
| 1891 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1892 | -s "Protocol is TLSv1.1" \ |
| 1893 | -c "Protocol is TLSv1.1" |
| 1894 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1895 | 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] | 1896 | "$P_SRV max_version=tls1_1" \ |
| 1897 | "$P_CLI min_version=tls1_1" \ |
| 1898 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1899 | -S "mbedtls_ssl_handshake returned" \ |
| 1900 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1901 | -s "Protocol is TLSv1.1" \ |
| 1902 | -c "Protocol is TLSv1.1" |
| 1903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1904 | 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] | 1905 | "$P_SRV max_version=tls1_1" \ |
| 1906 | "$P_CLI min_version=tls1_2" \ |
| 1907 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1908 | -s "mbedtls_ssl_handshake returned" \ |
| 1909 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1910 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1911 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1912 | 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] | 1913 | "$P_SRV min_version=tls1_2" \ |
| 1914 | "$P_CLI max_version=tls1_1" \ |
| 1915 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1916 | -s "mbedtls_ssl_handshake returned" \ |
| 1917 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1918 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1919 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1920 | # Tests for ALPN extension |
| 1921 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1922 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1923 | "$P_SRV debug_level=3" \ |
| 1924 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1925 | 0 \ |
| 1926 | -C "client hello, adding alpn extension" \ |
| 1927 | -S "found alpn extension" \ |
| 1928 | -C "got an alert message, type: \\[2:120]" \ |
| 1929 | -S "server hello, adding alpn extension" \ |
| 1930 | -C "found alpn extension " \ |
| 1931 | -C "Application Layer Protocol is" \ |
| 1932 | -S "Application Layer Protocol is" |
| 1933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1934 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1935 | "$P_SRV debug_level=3" \ |
| 1936 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1937 | 0 \ |
| 1938 | -c "client hello, adding alpn extension" \ |
| 1939 | -s "found alpn extension" \ |
| 1940 | -C "got an alert message, type: \\[2:120]" \ |
| 1941 | -S "server hello, adding alpn extension" \ |
| 1942 | -C "found alpn extension " \ |
| 1943 | -c "Application Layer Protocol is (none)" \ |
| 1944 | -S "Application Layer Protocol is" |
| 1945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1946 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1947 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1948 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1949 | 0 \ |
| 1950 | -C "client hello, adding alpn extension" \ |
| 1951 | -S "found alpn extension" \ |
| 1952 | -C "got an alert message, type: \\[2:120]" \ |
| 1953 | -S "server hello, adding alpn extension" \ |
| 1954 | -C "found alpn extension " \ |
| 1955 | -C "Application Layer Protocol is" \ |
| 1956 | -s "Application Layer Protocol is (none)" |
| 1957 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1958 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1959 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1960 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1961 | 0 \ |
| 1962 | -c "client hello, adding alpn extension" \ |
| 1963 | -s "found alpn extension" \ |
| 1964 | -C "got an alert message, type: \\[2:120]" \ |
| 1965 | -s "server hello, adding alpn extension" \ |
| 1966 | -c "found alpn extension" \ |
| 1967 | -c "Application Layer Protocol is abc" \ |
| 1968 | -s "Application Layer Protocol is abc" |
| 1969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1970 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1971 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1972 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1973 | 0 \ |
| 1974 | -c "client hello, adding alpn extension" \ |
| 1975 | -s "found alpn extension" \ |
| 1976 | -C "got an alert message, type: \\[2:120]" \ |
| 1977 | -s "server hello, adding alpn extension" \ |
| 1978 | -c "found alpn extension" \ |
| 1979 | -c "Application Layer Protocol is abc" \ |
| 1980 | -s "Application Layer Protocol is abc" |
| 1981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1982 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1983 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1984 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1985 | 0 \ |
| 1986 | -c "client hello, adding alpn extension" \ |
| 1987 | -s "found alpn extension" \ |
| 1988 | -C "got an alert message, type: \\[2:120]" \ |
| 1989 | -s "server hello, adding alpn extension" \ |
| 1990 | -c "found alpn extension" \ |
| 1991 | -c "Application Layer Protocol is 1234" \ |
| 1992 | -s "Application Layer Protocol is 1234" |
| 1993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1994 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1995 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1996 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1997 | 1 \ |
| 1998 | -c "client hello, adding alpn extension" \ |
| 1999 | -s "found alpn extension" \ |
| 2000 | -c "got an alert message, type: \\[2:120]" \ |
| 2001 | -S "server hello, adding alpn extension" \ |
| 2002 | -C "found alpn extension" \ |
| 2003 | -C "Application Layer Protocol is 1234" \ |
| 2004 | -S "Application Layer Protocol is 1234" |
| 2005 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2006 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2007 | # Tests for keyUsage in leaf certificates, part 1: |
| 2008 | # server-side certificate/suite selection |
| 2009 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2010 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2011 | "$P_SRV key_file=data_files/server2.key \ |
| 2012 | crt_file=data_files/server2.ku-ds.crt" \ |
| 2013 | "$P_CLI" \ |
| 2014 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2015 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2016 | |
| 2017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2018 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2019 | "$P_SRV key_file=data_files/server2.key \ |
| 2020 | crt_file=data_files/server2.ku-ke.crt" \ |
| 2021 | "$P_CLI" \ |
| 2022 | 0 \ |
| 2023 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 2024 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2025 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2026 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2027 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2028 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2029 | 1 \ |
| 2030 | -C "Ciphersuite is " |
| 2031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2032 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2033 | "$P_SRV key_file=data_files/server5.key \ |
| 2034 | crt_file=data_files/server5.ku-ds.crt" \ |
| 2035 | "$P_CLI" \ |
| 2036 | 0 \ |
| 2037 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 2038 | |
| 2039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2040 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2041 | "$P_SRV key_file=data_files/server5.key \ |
| 2042 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2043 | "$P_CLI" \ |
| 2044 | 0 \ |
| 2045 | -c "Ciphersuite is TLS-ECDH-" |
| 2046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2047 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2048 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2049 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2050 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2051 | 1 \ |
| 2052 | -C "Ciphersuite is " |
| 2053 | |
| 2054 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2055 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2057 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2058 | "$O_SRV -key data_files/server2.key \ |
| 2059 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2060 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2061 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2062 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2063 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2064 | -C "Processing of the Certificate handshake message failed" \ |
| 2065 | -c "Ciphersuite is TLS-" |
| 2066 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2067 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2068 | "$O_SRV -key data_files/server2.key \ |
| 2069 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2070 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2071 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2072 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2073 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2074 | -C "Processing of the Certificate handshake message failed" \ |
| 2075 | -c "Ciphersuite is TLS-" |
| 2076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2077 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2078 | "$O_SRV -key data_files/server2.key \ |
| 2079 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2080 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2081 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2082 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2083 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2084 | -C "Processing of the Certificate handshake message failed" \ |
| 2085 | -c "Ciphersuite is TLS-" |
| 2086 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2087 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2088 | "$O_SRV -key data_files/server2.key \ |
| 2089 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2090 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2091 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2092 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2093 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2094 | -c "Processing of the Certificate handshake message failed" \ |
| 2095 | -C "Ciphersuite is TLS-" |
| 2096 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2097 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 2098 | "$O_SRV -key data_files/server2.key \ |
| 2099 | -cert data_files/server2.ku-ke.crt" \ |
| 2100 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2101 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2102 | 0 \ |
| 2103 | -c "bad certificate (usage extensions)" \ |
| 2104 | -C "Processing of the Certificate handshake message failed" \ |
| 2105 | -c "Ciphersuite is TLS-" \ |
| 2106 | -c "! Usage does not match the keyUsage extension" |
| 2107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2108 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2109 | "$O_SRV -key data_files/server2.key \ |
| 2110 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2111 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2112 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2113 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2114 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2115 | -C "Processing of the Certificate handshake message failed" \ |
| 2116 | -c "Ciphersuite is TLS-" |
| 2117 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2118 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2119 | "$O_SRV -key data_files/server2.key \ |
| 2120 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2121 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2122 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2123 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2124 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2125 | -c "Processing of the Certificate handshake message failed" \ |
| 2126 | -C "Ciphersuite is TLS-" |
| 2127 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2128 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 2129 | "$O_SRV -key data_files/server2.key \ |
| 2130 | -cert data_files/server2.ku-ds.crt" \ |
| 2131 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 2132 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2133 | 0 \ |
| 2134 | -c "bad certificate (usage extensions)" \ |
| 2135 | -C "Processing of the Certificate handshake message failed" \ |
| 2136 | -c "Ciphersuite is TLS-" \ |
| 2137 | -c "! Usage does not match the keyUsage extension" |
| 2138 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2139 | # Tests for keyUsage in leaf certificates, part 3: |
| 2140 | # server-side checking of client cert |
| 2141 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2142 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2143 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2144 | "$O_CLI -key data_files/server2.key \ |
| 2145 | -cert data_files/server2.ku-ds.crt" \ |
| 2146 | 0 \ |
| 2147 | -S "bad certificate (usage extensions)" \ |
| 2148 | -S "Processing of the Certificate handshake message failed" |
| 2149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2150 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2151 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2152 | "$O_CLI -key data_files/server2.key \ |
| 2153 | -cert data_files/server2.ku-ke.crt" \ |
| 2154 | 0 \ |
| 2155 | -s "bad certificate (usage extensions)" \ |
| 2156 | -S "Processing of the Certificate handshake message failed" |
| 2157 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2158 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2159 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2160 | "$O_CLI -key data_files/server2.key \ |
| 2161 | -cert data_files/server2.ku-ke.crt" \ |
| 2162 | 1 \ |
| 2163 | -s "bad certificate (usage extensions)" \ |
| 2164 | -s "Processing of the Certificate handshake message failed" |
| 2165 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2166 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2167 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2168 | "$O_CLI -key data_files/server5.key \ |
| 2169 | -cert data_files/server5.ku-ds.crt" \ |
| 2170 | 0 \ |
| 2171 | -S "bad certificate (usage extensions)" \ |
| 2172 | -S "Processing of the Certificate handshake message failed" |
| 2173 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2174 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2175 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2176 | "$O_CLI -key data_files/server5.key \ |
| 2177 | -cert data_files/server5.ku-ka.crt" \ |
| 2178 | 0 \ |
| 2179 | -s "bad certificate (usage extensions)" \ |
| 2180 | -S "Processing of the Certificate handshake message failed" |
| 2181 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2182 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 2183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2184 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2185 | "$P_SRV key_file=data_files/server5.key \ |
| 2186 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2187 | "$P_CLI" \ |
| 2188 | 0 |
| 2189 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2190 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2191 | "$P_SRV key_file=data_files/server5.key \ |
| 2192 | crt_file=data_files/server5.eku-srv.crt" \ |
| 2193 | "$P_CLI" \ |
| 2194 | 0 |
| 2195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2196 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2197 | "$P_SRV key_file=data_files/server5.key \ |
| 2198 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 2199 | "$P_CLI" \ |
| 2200 | 0 |
| 2201 | |
| 2202 | # 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] | 2203 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2204 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 2205 | crt_file=data_files/server5.eku-cli.crt" \ |
| 2206 | "$P_CLI psk=badbad" \ |
| 2207 | 1 |
| 2208 | |
| 2209 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 2210 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2211 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2212 | "$O_SRV -key data_files/server5.key \ |
| 2213 | -cert data_files/server5.eku-srv.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 | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2215 | 0 \ |
| 2216 | -C "bad certificate (usage extensions)" \ |
| 2217 | -C "Processing of the Certificate handshake message failed" \ |
| 2218 | -c "Ciphersuite is TLS-" |
| 2219 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2220 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2221 | "$O_SRV -key data_files/server5.key \ |
| 2222 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2223 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2224 | 0 \ |
| 2225 | -C "bad certificate (usage extensions)" \ |
| 2226 | -C "Processing of the Certificate handshake message failed" \ |
| 2227 | -c "Ciphersuite is TLS-" |
| 2228 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2229 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2230 | "$O_SRV -key data_files/server5.key \ |
| 2231 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2232 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2233 | 0 \ |
| 2234 | -C "bad certificate (usage extensions)" \ |
| 2235 | -C "Processing of the Certificate handshake message failed" \ |
| 2236 | -c "Ciphersuite is TLS-" |
| 2237 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2238 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2239 | "$O_SRV -key data_files/server5.key \ |
| 2240 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2241 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2242 | 1 \ |
| 2243 | -c "bad certificate (usage extensions)" \ |
| 2244 | -c "Processing of the Certificate handshake message failed" \ |
| 2245 | -C "Ciphersuite is TLS-" |
| 2246 | |
| 2247 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 2248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2249 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2250 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2251 | "$O_CLI -key data_files/server5.key \ |
| 2252 | -cert data_files/server5.eku-cli.crt" \ |
| 2253 | 0 \ |
| 2254 | -S "bad certificate (usage extensions)" \ |
| 2255 | -S "Processing of the Certificate handshake message failed" |
| 2256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2257 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2258 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2259 | "$O_CLI -key data_files/server5.key \ |
| 2260 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 2261 | 0 \ |
| 2262 | -S "bad certificate (usage extensions)" \ |
| 2263 | -S "Processing of the Certificate handshake message failed" |
| 2264 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2265 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2266 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2267 | "$O_CLI -key data_files/server5.key \ |
| 2268 | -cert data_files/server5.eku-cs_any.crt" \ |
| 2269 | 0 \ |
| 2270 | -S "bad certificate (usage extensions)" \ |
| 2271 | -S "Processing of the Certificate handshake message failed" |
| 2272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2273 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2274 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2275 | "$O_CLI -key data_files/server5.key \ |
| 2276 | -cert data_files/server5.eku-cs.crt" \ |
| 2277 | 0 \ |
| 2278 | -s "bad certificate (usage extensions)" \ |
| 2279 | -S "Processing of the Certificate handshake message failed" |
| 2280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2281 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2282 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2283 | "$O_CLI -key data_files/server5.key \ |
| 2284 | -cert data_files/server5.eku-cs.crt" \ |
| 2285 | 1 \ |
| 2286 | -s "bad certificate (usage extensions)" \ |
| 2287 | -s "Processing of the Certificate handshake message failed" |
| 2288 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2289 | # Tests for DHM parameters loading |
| 2290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2291 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2292 | "$P_SRV" \ |
| 2293 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2294 | debug_level=3" \ |
| 2295 | 0 \ |
| 2296 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 2297 | -c "value of 'DHM: G ' (2048 bits)" |
| 2298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2299 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2300 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2301 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2302 | debug_level=3" \ |
| 2303 | 0 \ |
| 2304 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 2305 | -c "value of 'DHM: G ' (2 bits)" |
| 2306 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame^] | 2307 | # Tests for DHM client-side size checking |
| 2308 | |
| 2309 | run_test "DHM size: server default, client default, OK" \ |
| 2310 | "$P_SRV" \ |
| 2311 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2312 | debug_level=1" \ |
| 2313 | 0 \ |
| 2314 | -C "DHM prime too short:" |
| 2315 | |
| 2316 | run_test "DHM size: server default, client 2048, OK" \ |
| 2317 | "$P_SRV" \ |
| 2318 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2319 | debug_level=1 dhmlen=2048" \ |
| 2320 | 0 \ |
| 2321 | -C "DHM prime too short:" |
| 2322 | |
| 2323 | run_test "DHM size: server 1024, client default, OK" \ |
| 2324 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2325 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2326 | debug_level=1" \ |
| 2327 | 0 \ |
| 2328 | -C "DHM prime too short:" |
| 2329 | |
| 2330 | run_test "DHM size: server 1000, client default, rejected" \ |
| 2331 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 2332 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2333 | debug_level=1" \ |
| 2334 | 1 \ |
| 2335 | -c "DHM prime too short:" |
| 2336 | |
| 2337 | run_test "DHM size: server default, client 2049, rejected" \ |
| 2338 | "$P_SRV" \ |
| 2339 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2340 | debug_level=1 dhmlen=2049" \ |
| 2341 | 1 \ |
| 2342 | -c "DHM prime too short:" |
| 2343 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2344 | # Tests for PSK callback |
| 2345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2346 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2347 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 2348 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2349 | psk_identity=foo psk=abc123" \ |
| 2350 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2351 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2352 | -S "SSL - Unknown identity received" \ |
| 2353 | -S "SSL - Verification of the message MAC failed" |
| 2354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2355 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2356 | "$P_SRV" \ |
| 2357 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2358 | psk_identity=foo psk=abc123" \ |
| 2359 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2360 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2361 | -S "SSL - Unknown identity received" \ |
| 2362 | -S "SSL - Verification of the message MAC failed" |
| 2363 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2364 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2365 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 2366 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2367 | psk_identity=foo psk=abc123" \ |
| 2368 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2369 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2370 | -s "SSL - Unknown identity received" \ |
| 2371 | -S "SSL - Verification of the message MAC failed" |
| 2372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2373 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2374 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2375 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2376 | psk_identity=abc psk=dead" \ |
| 2377 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2378 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2379 | -S "SSL - Unknown identity received" \ |
| 2380 | -S "SSL - Verification of the message MAC failed" |
| 2381 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2382 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2383 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2384 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2385 | psk_identity=def psk=beef" \ |
| 2386 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2387 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2388 | -S "SSL - Unknown identity received" \ |
| 2389 | -S "SSL - Verification of the message MAC failed" |
| 2390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2391 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2392 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2393 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2394 | psk_identity=ghi psk=beef" \ |
| 2395 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2396 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2397 | -s "SSL - Unknown identity received" \ |
| 2398 | -S "SSL - Verification of the message MAC failed" |
| 2399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2400 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2401 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2402 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2403 | psk_identity=abc psk=beef" \ |
| 2404 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2405 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2406 | -S "SSL - Unknown identity received" \ |
| 2407 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2408 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2409 | # Tests for ciphersuites per version |
| 2410 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2411 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2412 | "$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] | 2413 | "$P_CLI force_version=ssl3" \ |
| 2414 | 0 \ |
| 2415 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2416 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2417 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2418 | "$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] | 2419 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2420 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2421 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2423 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2424 | "$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] | 2425 | "$P_CLI force_version=tls1_1" \ |
| 2426 | 0 \ |
| 2427 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2429 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2430 | "$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] | 2431 | "$P_CLI force_version=tls1_2" \ |
| 2432 | 0 \ |
| 2433 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2434 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2435 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2436 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2437 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2438 | "$P_SRV" \ |
| 2439 | "$P_CLI request_size=100" \ |
| 2440 | 0 \ |
| 2441 | -s "Read from client: 100 bytes read$" |
| 2442 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2443 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2444 | "$P_SRV" \ |
| 2445 | "$P_CLI request_size=500" \ |
| 2446 | 0 \ |
| 2447 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2448 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2449 | # Tests for small packets |
| 2450 | |
| 2451 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2452 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2453 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2454 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2455 | 0 \ |
| 2456 | -s "Read from client: 1 bytes read" |
| 2457 | |
| 2458 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2459 | "$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] | 2460 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2461 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2462 | 0 \ |
| 2463 | -s "Read from client: 1 bytes read" |
| 2464 | |
| 2465 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2466 | "$P_SRV" \ |
| 2467 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2468 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2469 | 0 \ |
| 2470 | -s "Read from client: 1 bytes read" |
| 2471 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2472 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2473 | "$P_SRV" \ |
| 2474 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2475 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2476 | 0 \ |
| 2477 | -s "Read from client: 1 bytes read" |
| 2478 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2479 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2480 | "$P_SRV" \ |
| 2481 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2482 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2483 | trunc_hmac=1" \ |
| 2484 | 0 \ |
| 2485 | -s "Read from client: 1 bytes read" |
| 2486 | |
| 2487 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2488 | "$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] | 2489 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2490 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2491 | trunc_hmac=1" \ |
| 2492 | 0 \ |
| 2493 | -s "Read from client: 1 bytes read" |
| 2494 | |
| 2495 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2496 | "$P_SRV" \ |
| 2497 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2498 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2499 | 0 \ |
| 2500 | -s "Read from client: 1 bytes read" |
| 2501 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2502 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2503 | "$P_SRV" \ |
| 2504 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2505 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2506 | 0 \ |
| 2507 | -s "Read from client: 1 bytes read" |
| 2508 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2509 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2510 | "$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] | 2511 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2512 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2513 | 0 \ |
| 2514 | -s "Read from client: 1 bytes read" |
| 2515 | |
| 2516 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2517 | "$P_SRV" \ |
| 2518 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2520 | trunc_hmac=1" \ |
| 2521 | 0 \ |
| 2522 | -s "Read from client: 1 bytes read" |
| 2523 | |
| 2524 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2525 | "$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] | 2526 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2527 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2528 | trunc_hmac=1" \ |
| 2529 | 0 \ |
| 2530 | -s "Read from client: 1 bytes read" |
| 2531 | |
| 2532 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2533 | "$P_SRV" \ |
| 2534 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2535 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2536 | 0 \ |
| 2537 | -s "Read from client: 1 bytes read" |
| 2538 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2539 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2540 | "$P_SRV" \ |
| 2541 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2543 | 0 \ |
| 2544 | -s "Read from client: 1 bytes read" |
| 2545 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2546 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2547 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2548 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2549 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2550 | 0 \ |
| 2551 | -s "Read from client: 1 bytes read" |
| 2552 | |
| 2553 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2554 | "$P_SRV" \ |
| 2555 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2556 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2557 | trunc_hmac=1" \ |
| 2558 | 0 \ |
| 2559 | -s "Read from client: 1 bytes read" |
| 2560 | |
| 2561 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2562 | "$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] | 2563 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2564 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2565 | 0 \ |
| 2566 | -s "Read from client: 1 bytes read" |
| 2567 | |
| 2568 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2569 | "$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] | 2570 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2571 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2572 | trunc_hmac=1" \ |
| 2573 | 0 \ |
| 2574 | -s "Read from client: 1 bytes read" |
| 2575 | |
| 2576 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2577 | "$P_SRV" \ |
| 2578 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2579 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2580 | 0 \ |
| 2581 | -s "Read from client: 1 bytes read" |
| 2582 | |
| 2583 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2584 | "$P_SRV" \ |
| 2585 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2586 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2587 | 0 \ |
| 2588 | -s "Read from client: 1 bytes read" |
| 2589 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2590 | # Test for large packets |
| 2591 | |
| 2592 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2593 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2594 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2595 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2596 | 0 \ |
| 2597 | -s "Read from client: 16384 bytes read" |
| 2598 | |
| 2599 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2600 | "$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] | 2601 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2602 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2603 | 0 \ |
| 2604 | -s "Read from client: 16384 bytes read" |
| 2605 | |
| 2606 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2607 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2608 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2609 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2610 | 0 \ |
| 2611 | -s "Read from client: 16384 bytes read" |
| 2612 | |
| 2613 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2614 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2615 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2616 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2617 | trunc_hmac=1" \ |
| 2618 | 0 \ |
| 2619 | -s "Read from client: 16384 bytes read" |
| 2620 | |
| 2621 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2622 | "$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] | 2623 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2624 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2625 | trunc_hmac=1" \ |
| 2626 | 0 \ |
| 2627 | -s "Read from client: 16384 bytes read" |
| 2628 | |
| 2629 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2630 | "$P_SRV" \ |
| 2631 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2633 | 0 \ |
| 2634 | -s "Read from client: 16384 bytes read" |
| 2635 | |
| 2636 | run_test "Large packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2637 | "$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] | 2638 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2639 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2640 | 0 \ |
| 2641 | -s "Read from client: 16384 bytes read" |
| 2642 | |
| 2643 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2644 | "$P_SRV" \ |
| 2645 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2646 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2647 | trunc_hmac=1" \ |
| 2648 | 0 \ |
| 2649 | -s "Read from client: 16384 bytes read" |
| 2650 | |
| 2651 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2652 | "$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] | 2653 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2654 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2655 | trunc_hmac=1" \ |
| 2656 | 0 \ |
| 2657 | -s "Read from client: 16384 bytes read" |
| 2658 | |
| 2659 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2660 | "$P_SRV" \ |
| 2661 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2662 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2663 | 0 \ |
| 2664 | -s "Read from client: 16384 bytes read" |
| 2665 | |
| 2666 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2667 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 2668 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2669 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2670 | 0 \ |
| 2671 | -s "Read from client: 16384 bytes read" |
| 2672 | |
| 2673 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2674 | "$P_SRV" \ |
| 2675 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2676 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2677 | trunc_hmac=1" \ |
| 2678 | 0 \ |
| 2679 | -s "Read from client: 16384 bytes read" |
| 2680 | |
| 2681 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2682 | "$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] | 2683 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2684 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2685 | 0 \ |
| 2686 | -s "Read from client: 16384 bytes read" |
| 2687 | |
| 2688 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2689 | "$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] | 2690 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2691 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2692 | trunc_hmac=1" \ |
| 2693 | 0 \ |
| 2694 | -s "Read from client: 16384 bytes read" |
| 2695 | |
| 2696 | run_test "Large packet TLS 1.2 AEAD" \ |
| 2697 | "$P_SRV" \ |
| 2698 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2700 | 0 \ |
| 2701 | -s "Read from client: 16384 bytes read" |
| 2702 | |
| 2703 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 2704 | "$P_SRV" \ |
| 2705 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2706 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2707 | 0 \ |
| 2708 | -s "Read from client: 16384 bytes read" |
| 2709 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2710 | # Tests for DTLS HelloVerifyRequest |
| 2711 | |
| 2712 | run_test "DTLS cookie: enabled" \ |
| 2713 | "$P_SRV dtls=1 debug_level=2" \ |
| 2714 | "$P_CLI dtls=1 debug_level=2" \ |
| 2715 | 0 \ |
| 2716 | -s "cookie verification failed" \ |
| 2717 | -s "cookie verification passed" \ |
| 2718 | -S "cookie verification skipped" \ |
| 2719 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2720 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2721 | -S "SSL - The requested feature is not available" |
| 2722 | |
| 2723 | run_test "DTLS cookie: disabled" \ |
| 2724 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 2725 | "$P_CLI dtls=1 debug_level=2" \ |
| 2726 | 0 \ |
| 2727 | -S "cookie verification failed" \ |
| 2728 | -S "cookie verification passed" \ |
| 2729 | -s "cookie verification skipped" \ |
| 2730 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2731 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2732 | -S "SSL - The requested feature is not available" |
| 2733 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2734 | run_test "DTLS cookie: default (failing)" \ |
| 2735 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 2736 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 2737 | 1 \ |
| 2738 | -s "cookie verification failed" \ |
| 2739 | -S "cookie verification passed" \ |
| 2740 | -S "cookie verification skipped" \ |
| 2741 | -C "received hello verify request" \ |
| 2742 | -S "hello verification requested" \ |
| 2743 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2744 | |
| 2745 | requires_ipv6 |
| 2746 | run_test "DTLS cookie: enabled, IPv6" \ |
| 2747 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 2748 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 2749 | 0 \ |
| 2750 | -s "cookie verification failed" \ |
| 2751 | -s "cookie verification passed" \ |
| 2752 | -S "cookie verification skipped" \ |
| 2753 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2754 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2755 | -S "SSL - The requested feature is not available" |
| 2756 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2757 | run_test "DTLS cookie: enabled, nbio" \ |
| 2758 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 2759 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2760 | 0 \ |
| 2761 | -s "cookie verification failed" \ |
| 2762 | -s "cookie verification passed" \ |
| 2763 | -S "cookie verification skipped" \ |
| 2764 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2765 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2766 | -S "SSL - The requested feature is not available" |
| 2767 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2768 | # Tests for various cases of client authentication with DTLS |
| 2769 | # (focused on handshake flows and message parsing) |
| 2770 | |
| 2771 | run_test "DTLS client auth: required" \ |
| 2772 | "$P_SRV dtls=1 auth_mode=required" \ |
| 2773 | "$P_CLI dtls=1" \ |
| 2774 | 0 \ |
| 2775 | -s "Verifying peer X.509 certificate... ok" |
| 2776 | |
| 2777 | run_test "DTLS client auth: optional, client has no cert" \ |
| 2778 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 2779 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 2780 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2781 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2782 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2783 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2784 | "$P_SRV dtls=1 auth_mode=none" \ |
| 2785 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 2786 | 0 \ |
| 2787 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2788 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2789 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 2790 | # Tests for receiving fragmented handshake messages with DTLS |
| 2791 | |
| 2792 | requires_gnutls |
| 2793 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 2794 | "$G_SRV -u --mtu 2048 -a" \ |
| 2795 | "$P_CLI dtls=1 debug_level=2" \ |
| 2796 | 0 \ |
| 2797 | -C "found fragmented DTLS handshake message" \ |
| 2798 | -C "error" |
| 2799 | |
| 2800 | requires_gnutls |
| 2801 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 2802 | "$G_SRV -u --mtu 512" \ |
| 2803 | "$P_CLI dtls=1 debug_level=2" \ |
| 2804 | 0 \ |
| 2805 | -c "found fragmented DTLS handshake message" \ |
| 2806 | -C "error" |
| 2807 | |
| 2808 | requires_gnutls |
| 2809 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 2810 | "$G_SRV -u --mtu 128" \ |
| 2811 | "$P_CLI dtls=1 debug_level=2" \ |
| 2812 | 0 \ |
| 2813 | -c "found fragmented DTLS handshake message" \ |
| 2814 | -C "error" |
| 2815 | |
| 2816 | requires_gnutls |
| 2817 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 2818 | "$G_SRV -u --mtu 128" \ |
| 2819 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2820 | 0 \ |
| 2821 | -c "found fragmented DTLS handshake message" \ |
| 2822 | -C "error" |
| 2823 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2824 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2825 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 2826 | "$G_SRV -u --mtu 256" \ |
| 2827 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2828 | 0 \ |
| 2829 | -c "found fragmented DTLS handshake message" \ |
| 2830 | -c "client hello, adding renegotiation extension" \ |
| 2831 | -c "found renegotiation extension" \ |
| 2832 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2833 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2834 | -C "error" \ |
| 2835 | -s "Extra-header:" |
| 2836 | |
| 2837 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2838 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 2839 | "$G_SRV -u --mtu 256" \ |
| 2840 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2841 | 0 \ |
| 2842 | -c "found fragmented DTLS handshake message" \ |
| 2843 | -c "client hello, adding renegotiation extension" \ |
| 2844 | -c "found renegotiation extension" \ |
| 2845 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2846 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2847 | -C "error" \ |
| 2848 | -s "Extra-header:" |
| 2849 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2850 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 2851 | "$O_SRV -dtls1 -mtu 2048" \ |
| 2852 | "$P_CLI dtls=1 debug_level=2" \ |
| 2853 | 0 \ |
| 2854 | -C "found fragmented DTLS handshake message" \ |
| 2855 | -C "error" |
| 2856 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2857 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 2858 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2859 | "$P_CLI dtls=1 debug_level=2" \ |
| 2860 | 0 \ |
| 2861 | -c "found fragmented DTLS handshake message" \ |
| 2862 | -C "error" |
| 2863 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2864 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2865 | "$O_SRV -dtls1 -mtu 256" \ |
| 2866 | "$P_CLI dtls=1 debug_level=2" \ |
| 2867 | 0 \ |
| 2868 | -c "found fragmented DTLS handshake message" \ |
| 2869 | -C "error" |
| 2870 | |
| 2871 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 2872 | "$O_SRV -dtls1 -mtu 256" \ |
| 2873 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2874 | 0 \ |
| 2875 | -c "found fragmented DTLS handshake message" \ |
| 2876 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2877 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 2878 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2879 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2880 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2881 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2882 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2883 | "$P_SRV dtls=1 debug_level=2" \ |
| 2884 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2885 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2886 | -C "replayed record" \ |
| 2887 | -S "replayed record" \ |
| 2888 | -C "record from another epoch" \ |
| 2889 | -S "record from another epoch" \ |
| 2890 | -C "discarding invalid record" \ |
| 2891 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2892 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2893 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2894 | -c "HTTP/1.0 200 OK" |
| 2895 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2896 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 2897 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2898 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2899 | "$P_SRV dtls=1 debug_level=2" \ |
| 2900 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2901 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 2902 | -c "replayed record" \ |
| 2903 | -s "replayed record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2904 | -c "discarding invalid record" \ |
| 2905 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2906 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2907 | -s "Extra-header:" \ |
| 2908 | -c "HTTP/1.0 200 OK" |
| 2909 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2910 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 2911 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2912 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 2913 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2914 | 0 \ |
| 2915 | -c "replayed record" \ |
| 2916 | -S "replayed record" \ |
| 2917 | -c "discarding invalid record" \ |
| 2918 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2919 | -c "resend" \ |
| 2920 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2921 | -s "Extra-header:" \ |
| 2922 | -c "HTTP/1.0 200 OK" |
| 2923 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2924 | 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] | 2925 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2926 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2927 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2928 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2929 | -c "discarding invalid record (mac)" \ |
| 2930 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2931 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2932 | -c "HTTP/1.0 200 OK" \ |
| 2933 | -S "too many records with bad MAC" \ |
| 2934 | -S "Verification of the message MAC failed" |
| 2935 | |
| 2936 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 2937 | -p "$P_PXY bad_ad=1" \ |
| 2938 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 2939 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 2940 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2941 | -C "discarding invalid record (mac)" \ |
| 2942 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2943 | -S "Extra-header:" \ |
| 2944 | -C "HTTP/1.0 200 OK" \ |
| 2945 | -s "too many records with bad MAC" \ |
| 2946 | -s "Verification of the message MAC failed" |
| 2947 | |
| 2948 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 2949 | -p "$P_PXY bad_ad=1" \ |
| 2950 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 2951 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 2952 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2953 | -c "discarding invalid record (mac)" \ |
| 2954 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2955 | -s "Extra-header:" \ |
| 2956 | -c "HTTP/1.0 200 OK" \ |
| 2957 | -S "too many records with bad MAC" \ |
| 2958 | -S "Verification of the message MAC failed" |
| 2959 | |
| 2960 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 2961 | -p "$P_PXY bad_ad=1" \ |
| 2962 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 2963 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 2964 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2965 | -c "discarding invalid record (mac)" \ |
| 2966 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2967 | -s "Extra-header:" \ |
| 2968 | -c "HTTP/1.0 200 OK" \ |
| 2969 | -s "too many records with bad MAC" \ |
| 2970 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2971 | |
| 2972 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2973 | -p "$P_PXY delay_ccs=1" \ |
| 2974 | "$P_SRV dtls=1 debug_level=1" \ |
| 2975 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2976 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2977 | -c "record from another epoch" \ |
| 2978 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2979 | -c "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2980 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2981 | -s "Extra-header:" \ |
| 2982 | -c "HTTP/1.0 200 OK" |
| 2983 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 2984 | # 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] | 2985 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2986 | needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2987 | 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] | 2988 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2989 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2990 | psk=abc123" \ |
| 2991 | "$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] | 2992 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2993 | 0 \ |
| 2994 | -s "Extra-header:" \ |
| 2995 | -c "HTTP/1.0 200 OK" |
| 2996 | |
| 2997 | needs_more_time 2 |
| 2998 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 2999 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3000 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3001 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3002 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3003 | 0 \ |
| 3004 | -s "Extra-header:" \ |
| 3005 | -c "HTTP/1.0 200 OK" |
| 3006 | |
| 3007 | needs_more_time 2 |
| 3008 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 3009 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3010 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 3011 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3012 | 0 \ |
| 3013 | -s "Extra-header:" \ |
| 3014 | -c "HTTP/1.0 200 OK" |
| 3015 | |
| 3016 | needs_more_time 2 |
| 3017 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 3018 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3019 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 3020 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3021 | 0 \ |
| 3022 | -s "Extra-header:" \ |
| 3023 | -c "HTTP/1.0 200 OK" |
| 3024 | |
| 3025 | needs_more_time 2 |
| 3026 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 3027 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3028 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 3029 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3030 | 0 \ |
| 3031 | -s "Extra-header:" \ |
| 3032 | -c "HTTP/1.0 200 OK" |
| 3033 | |
| 3034 | needs_more_time 2 |
| 3035 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 3036 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3037 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 3038 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3039 | 0 \ |
| 3040 | -s "Extra-header:" \ |
| 3041 | -c "HTTP/1.0 200 OK" |
| 3042 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3043 | needs_more_time 2 |
| 3044 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 3045 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3046 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 3047 | auth_mode=required" \ |
| 3048 | "$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] | 3049 | 0 \ |
| 3050 | -s "Extra-header:" \ |
| 3051 | -c "HTTP/1.0 200 OK" |
| 3052 | |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3053 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 3054 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 3055 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3056 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3057 | psk=abc123 debug_level=3" \ |
| 3058 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3059 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3060 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3061 | 0 \ |
| 3062 | -s "a session has been resumed" \ |
| 3063 | -c "a session has been resumed" \ |
| 3064 | -s "Extra-header:" \ |
| 3065 | -c "HTTP/1.0 200 OK" |
| 3066 | |
| 3067 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 3068 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 3069 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3070 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3071 | psk=abc123 debug_level=3 nbio=2" \ |
| 3072 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3073 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 3074 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 3075 | 0 \ |
| 3076 | -s "a session has been resumed" \ |
| 3077 | -c "a session has been resumed" \ |
| 3078 | -s "Extra-header:" \ |
| 3079 | -c "HTTP/1.0 200 OK" |
| 3080 | |
| 3081 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3082 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3083 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3084 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3085 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3086 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3087 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3088 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3089 | 0 \ |
| 3090 | -c "=> renegotiate" \ |
| 3091 | -s "=> renegotiate" \ |
| 3092 | -s "Extra-header:" \ |
| 3093 | -c "HTTP/1.0 200 OK" |
| 3094 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3095 | needs_more_time 4 |
| 3096 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 3097 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3098 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 3099 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 3100 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 3101 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3102 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3103 | 0 \ |
| 3104 | -c "=> renegotiate" \ |
| 3105 | -s "=> renegotiate" \ |
| 3106 | -s "Extra-header:" \ |
| 3107 | -c "HTTP/1.0 200 OK" |
| 3108 | |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3109 | needs_more_time 4 |
| 3110 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3111 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3112 | "$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] | 3113 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3114 | debug_level=2" \ |
| 3115 | "$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] | 3116 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3117 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3118 | 0 \ |
| 3119 | -c "=> renegotiate" \ |
| 3120 | -s "=> renegotiate" \ |
| 3121 | -s "Extra-header:" \ |
| 3122 | -c "HTTP/1.0 200 OK" |
| 3123 | |
| 3124 | needs_more_time 4 |
| 3125 | 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] | 3126 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3127 | "$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] | 3128 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3129 | debug_level=2 nbio=2" \ |
| 3130 | "$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] | 3131 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3132 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 3133 | 0 \ |
| 3134 | -c "=> renegotiate" \ |
| 3135 | -s "=> renegotiate" \ |
| 3136 | -s "Extra-header:" \ |
| 3137 | -c "HTTP/1.0 200 OK" |
| 3138 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3139 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3140 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3141 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3142 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3143 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 3144 | 0 \ |
| 3145 | -s "Extra-header:" \ |
| 3146 | -c "HTTP/1.0 200 OK" |
| 3147 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3148 | needs_more_time 8 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3149 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 3150 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3151 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3152 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3153 | 0 \ |
| 3154 | -s "Extra-header:" \ |
| 3155 | -c "HTTP/1.0 200 OK" |
| 3156 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3157 | needs_more_time 8 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3158 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 3159 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 3160 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 3161 | "$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] | 3162 | 0 \ |
| 3163 | -s "Extra-header:" \ |
| 3164 | -c "HTTP/1.0 200 OK" |
| 3165 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3166 | requires_gnutls |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 3167 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3168 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 3169 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3170 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3171 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3172 | 0 \ |
| 3173 | -s "Extra-header:" \ |
| 3174 | -c "Extra-header:" |
| 3175 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3176 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3177 | needs_more_time 8 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3178 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 3179 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3180 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3181 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 3182 | 0 \ |
| 3183 | -s "Extra-header:" \ |
| 3184 | -c "Extra-header:" |
| 3185 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3186 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 3187 | needs_more_time 8 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3188 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 3189 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 3190 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 3191 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3192 | 0 \ |
| 3193 | -s "Extra-header:" \ |
| 3194 | -c "Extra-header:" |
| 3195 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3196 | # Final report |
| 3197 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3198 | echo "------------------------------------------------------------------------" |
| 3199 | |
| 3200 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3201 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3202 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 3203 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3204 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 3205 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 3206 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3207 | |
| 3208 | exit $FAILS |