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