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