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