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