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