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" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 24 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
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$$" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame^] | 498 | PORT_BASE="$( echo -n $PORT_BASE | tail -c 5 )" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 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 | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame^] | 504 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 505 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 506 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 507 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT" |
| 508 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 509 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 510 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame^] | 511 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 512 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 513 | # Also pick a unique name for intermediate files |
| 514 | SRV_OUT="srv_out.$$" |
| 515 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 516 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 517 | SESSION="session.$$" |
| 518 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 519 | SKIP_NEXT="NO" |
| 520 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 521 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 522 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 523 | # Basic test |
| 524 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 525 | # Checks that: |
| 526 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 527 | # - the expected (highest security) parameters are selected |
| 528 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 529 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 530 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 531 | "$P_CLI" \ |
| 532 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 533 | -s "Protocol is TLSv1.2" \ |
| 534 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 535 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 536 | -s "ECDHE curve: secp521r1" \ |
| 537 | -S "error" \ |
| 538 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 539 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 540 | # Test for SSLv2 ClientHello |
| 541 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 542 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 543 | run_test "SSLv2 ClientHello: reference" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 544 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 545 | "$O_CLI -no_ssl2" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 546 | 0 \ |
| 547 | -S "parse client hello v2" \ |
| 548 | -S "ssl_handshake returned" |
| 549 | |
| 550 | # 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] | 551 | requires_openssl_with_sslv2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 552 | run_test "SSLv2 ClientHello: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 553 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 554 | "$O_CLI -cipher 'DES-CBC-MD5:ALL'" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 555 | 0 \ |
| 556 | -s "parse client hello v2" \ |
| 557 | -S "ssl_handshake returned" |
| 558 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 559 | # Tests for Truncated HMAC extension |
| 560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 561 | run_test "Truncated HMAC: reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 562 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 563 | "$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] | 564 | 0 \ |
| 565 | -s "dumping 'computed mac' (20 bytes)" |
| 566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 567 | run_test "Truncated HMAC: actual test" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 568 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 569 | "$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] | 570 | 0 \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 571 | -s "dumping 'computed mac' (10 bytes)" |
| 572 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 573 | # Tests for Encrypt-then-MAC extension |
| 574 | |
| 575 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 576 | "$P_SRV debug_level=3 \ |
| 577 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 578 | "$P_CLI debug_level=3" \ |
| 579 | 0 \ |
| 580 | -c "client hello, adding encrypt_then_mac extension" \ |
| 581 | -s "found encrypt then mac extension" \ |
| 582 | -s "server hello, adding encrypt then mac extension" \ |
| 583 | -c "found encrypt_then_mac extension" \ |
| 584 | -c "using encrypt then mac" \ |
| 585 | -s "using encrypt then mac" |
| 586 | |
| 587 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 588 | "$P_SRV debug_level=3 etm=0 \ |
| 589 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 590 | "$P_CLI debug_level=3 etm=1" \ |
| 591 | 0 \ |
| 592 | -c "client hello, adding encrypt_then_mac extension" \ |
| 593 | -s "found encrypt then mac extension" \ |
| 594 | -S "server hello, adding encrypt then mac extension" \ |
| 595 | -C "found encrypt_then_mac extension" \ |
| 596 | -C "using encrypt then mac" \ |
| 597 | -S "using encrypt then mac" |
| 598 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 599 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 600 | "$P_SRV debug_level=3 etm=1 \ |
| 601 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 602 | "$P_CLI debug_level=3 etm=1" \ |
| 603 | 0 \ |
| 604 | -c "client hello, adding encrypt_then_mac extension" \ |
| 605 | -s "found encrypt then mac extension" \ |
| 606 | -S "server hello, adding encrypt then mac extension" \ |
| 607 | -C "found encrypt_then_mac extension" \ |
| 608 | -C "using encrypt then mac" \ |
| 609 | -S "using encrypt then mac" |
| 610 | |
| 611 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 612 | "$P_SRV debug_level=3 etm=1 \ |
| 613 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 614 | "$P_CLI debug_level=3 etm=1" \ |
| 615 | 0 \ |
| 616 | -c "client hello, adding encrypt_then_mac extension" \ |
| 617 | -s "found encrypt then mac extension" \ |
| 618 | -S "server hello, adding encrypt then mac extension" \ |
| 619 | -C "found encrypt_then_mac extension" \ |
| 620 | -C "using encrypt then mac" \ |
| 621 | -S "using encrypt then mac" |
| 622 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 623 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 624 | "$P_SRV debug_level=3 etm=1 \ |
| 625 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 626 | "$P_CLI debug_level=3 etm=0" \ |
| 627 | 0 \ |
| 628 | -C "client hello, adding encrypt_then_mac extension" \ |
| 629 | -S "found encrypt then mac extension" \ |
| 630 | -S "server hello, adding encrypt then mac extension" \ |
| 631 | -C "found encrypt_then_mac extension" \ |
| 632 | -C "using encrypt then mac" \ |
| 633 | -S "using encrypt then mac" |
| 634 | |
| 635 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 636 | "$P_SRV debug_level=3 \ |
| 637 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 638 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 639 | 0 \ |
| 640 | -C "client hello, adding encrypt_then_mac extension" \ |
| 641 | -S "found encrypt then mac extension" \ |
| 642 | -S "server hello, adding encrypt then mac extension" \ |
| 643 | -C "found encrypt_then_mac extension" \ |
| 644 | -C "using encrypt then mac" \ |
| 645 | -S "using encrypt then mac" |
| 646 | |
| 647 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 648 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 649 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 650 | "$P_CLI debug_level=3" \ |
| 651 | 0 \ |
| 652 | -c "client hello, adding encrypt_then_mac extension" \ |
| 653 | -s "found encrypt then mac extension" \ |
| 654 | -S "server hello, adding encrypt then mac extension" \ |
| 655 | -C "found encrypt_then_mac extension" \ |
| 656 | -C "using encrypt then mac" \ |
| 657 | -S "using encrypt then mac" |
| 658 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 659 | # Tests for Extended Master Secret extension |
| 660 | |
| 661 | run_test "Extended Master Secret: default" \ |
| 662 | "$P_SRV debug_level=3" \ |
| 663 | "$P_CLI debug_level=3" \ |
| 664 | 0 \ |
| 665 | -c "client hello, adding extended_master_secret extension" \ |
| 666 | -s "found extended master secret extension" \ |
| 667 | -s "server hello, adding extended master secret extension" \ |
| 668 | -c "found extended_master_secret extension" \ |
| 669 | -c "using extended master secret" \ |
| 670 | -s "using extended master secret" |
| 671 | |
| 672 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 673 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 674 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 675 | 0 \ |
| 676 | -c "client hello, adding extended_master_secret extension" \ |
| 677 | -s "found extended master secret extension" \ |
| 678 | -S "server hello, adding extended master secret extension" \ |
| 679 | -C "found extended_master_secret extension" \ |
| 680 | -C "using extended master secret" \ |
| 681 | -S "using extended master secret" |
| 682 | |
| 683 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 684 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 685 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 686 | 0 \ |
| 687 | -C "client hello, adding extended_master_secret extension" \ |
| 688 | -S "found extended master secret extension" \ |
| 689 | -S "server hello, adding extended master secret extension" \ |
| 690 | -C "found extended_master_secret extension" \ |
| 691 | -C "using extended master secret" \ |
| 692 | -S "using extended master secret" |
| 693 | |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 694 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
| 695 | "$P_SRV debug_level=3" \ |
| 696 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 697 | 0 \ |
| 698 | -C "client hello, adding extended_master_secret extension" \ |
| 699 | -S "found extended master secret extension" \ |
| 700 | -S "server hello, adding extended master secret extension" \ |
| 701 | -C "found extended_master_secret extension" \ |
| 702 | -C "using extended master secret" \ |
| 703 | -S "using extended master secret" |
| 704 | |
| 705 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 706 | "$P_SRV debug_level=3 force_version=ssl3" \ |
| 707 | "$P_CLI debug_level=3" \ |
| 708 | 0 \ |
| 709 | -c "client hello, adding extended_master_secret extension" \ |
| 710 | -s "found extended master secret extension" \ |
| 711 | -S "server hello, adding extended master secret extension" \ |
| 712 | -C "found extended_master_secret extension" \ |
| 713 | -C "using extended master secret" \ |
| 714 | -S "using extended master secret" |
| 715 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 716 | # Tests for FALLBACK_SCSV |
| 717 | |
| 718 | run_test "Fallback SCSV: default" \ |
| 719 | "$P_SRV" \ |
| 720 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 721 | 0 \ |
| 722 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 723 | -S "received FALLBACK_SCSV" \ |
| 724 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 725 | -C "is a fatal alert message (msg 86)" |
| 726 | |
| 727 | run_test "Fallback SCSV: explicitly disabled" \ |
| 728 | "$P_SRV" \ |
| 729 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 730 | 0 \ |
| 731 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 732 | -S "received FALLBACK_SCSV" \ |
| 733 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 734 | -C "is a fatal alert message (msg 86)" |
| 735 | |
| 736 | run_test "Fallback SCSV: enabled" \ |
| 737 | "$P_SRV" \ |
| 738 | "$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] | 739 | 1 \ |
| 740 | -c "adding FALLBACK_SCSV" \ |
| 741 | -s "received FALLBACK_SCSV" \ |
| 742 | -s "inapropriate fallback" \ |
| 743 | -c "is a fatal alert message (msg 86)" |
| 744 | |
| 745 | run_test "Fallback SCSV: enabled, max version" \ |
| 746 | "$P_SRV" \ |
| 747 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 748 | 0 \ |
| 749 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 750 | -s "received FALLBACK_SCSV" \ |
| 751 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 752 | -C "is a fatal alert message (msg 86)" |
| 753 | |
| 754 | requires_openssl_with_fallback_scsv |
| 755 | run_test "Fallback SCSV: default, openssl server" \ |
| 756 | "$O_SRV" \ |
| 757 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 758 | 0 \ |
| 759 | -C "adding FALLBACK_SCSV" \ |
| 760 | -C "is a fatal alert message (msg 86)" |
| 761 | |
| 762 | requires_openssl_with_fallback_scsv |
| 763 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 764 | "$O_SRV" \ |
| 765 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 766 | 1 \ |
| 767 | -c "adding FALLBACK_SCSV" \ |
| 768 | -c "is a fatal alert message (msg 86)" |
| 769 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 770 | requires_openssl_with_fallback_scsv |
| 771 | run_test "Fallback SCSV: disabled, openssl client" \ |
| 772 | "$P_SRV" \ |
| 773 | "$O_CLI -tls1_1" \ |
| 774 | 0 \ |
| 775 | -S "received FALLBACK_SCSV" \ |
| 776 | -S "inapropriate fallback" |
| 777 | |
| 778 | requires_openssl_with_fallback_scsv |
| 779 | run_test "Fallback SCSV: enabled, openssl client" \ |
| 780 | "$P_SRV" \ |
| 781 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 782 | 1 \ |
| 783 | -s "received FALLBACK_SCSV" \ |
| 784 | -s "inapropriate fallback" |
| 785 | |
| 786 | requires_openssl_with_fallback_scsv |
| 787 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
| 788 | "$P_SRV" \ |
| 789 | "$O_CLI -fallback_scsv" \ |
| 790 | 0 \ |
| 791 | -s "received FALLBACK_SCSV" \ |
| 792 | -S "inapropriate fallback" |
| 793 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 794 | # Tests for Session Tickets |
| 795 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 796 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 797 | "$P_SRV debug_level=3 tickets=1" \ |
| 798 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 799 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 800 | -c "client hello, adding session ticket extension" \ |
| 801 | -s "found session ticket extension" \ |
| 802 | -s "server hello, adding session ticket extension" \ |
| 803 | -c "found session_ticket extension" \ |
| 804 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 805 | -S "session successfully restored from cache" \ |
| 806 | -s "session successfully restored from ticket" \ |
| 807 | -s "a session has been resumed" \ |
| 808 | -c "a session has been resumed" |
| 809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 810 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 811 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 812 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 813 | 0 \ |
| 814 | -c "client hello, adding session ticket extension" \ |
| 815 | -s "found session ticket extension" \ |
| 816 | -s "server hello, adding session ticket extension" \ |
| 817 | -c "found session_ticket extension" \ |
| 818 | -c "parse new session ticket" \ |
| 819 | -S "session successfully restored from cache" \ |
| 820 | -s "session successfully restored from ticket" \ |
| 821 | -s "a session has been resumed" \ |
| 822 | -c "a session has been resumed" |
| 823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 824 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 825 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 826 | "$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] | 827 | 0 \ |
| 828 | -c "client hello, adding session ticket extension" \ |
| 829 | -s "found session ticket extension" \ |
| 830 | -s "server hello, adding session ticket extension" \ |
| 831 | -c "found session_ticket extension" \ |
| 832 | -c "parse new session ticket" \ |
| 833 | -S "session successfully restored from cache" \ |
| 834 | -S "session successfully restored from ticket" \ |
| 835 | -S "a session has been resumed" \ |
| 836 | -C "a session has been resumed" |
| 837 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 838 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 839 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 840 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 841 | 0 \ |
| 842 | -c "client hello, adding session ticket extension" \ |
| 843 | -c "found session_ticket extension" \ |
| 844 | -c "parse new session ticket" \ |
| 845 | -c "a session has been resumed" |
| 846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 847 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 848 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 849 | "( $O_CLI -sess_out $SESSION; \ |
| 850 | $O_CLI -sess_in $SESSION; \ |
| 851 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 852 | 0 \ |
| 853 | -s "found session ticket extension" \ |
| 854 | -s "server hello, adding session ticket extension" \ |
| 855 | -S "session successfully restored from cache" \ |
| 856 | -s "session successfully restored from ticket" \ |
| 857 | -s "a session has been resumed" |
| 858 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 859 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 861 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 862 | "$P_SRV debug_level=3 tickets=0" \ |
| 863 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 864 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 865 | -c "client hello, adding session ticket extension" \ |
| 866 | -s "found session ticket extension" \ |
| 867 | -S "server hello, adding session ticket extension" \ |
| 868 | -C "found session_ticket extension" \ |
| 869 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 870 | -s "session successfully restored from cache" \ |
| 871 | -S "session successfully restored from ticket" \ |
| 872 | -s "a session has been resumed" \ |
| 873 | -c "a session has been resumed" |
| 874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 875 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 876 | "$P_SRV debug_level=3 tickets=1" \ |
| 877 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 878 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 879 | -C "client hello, adding session ticket extension" \ |
| 880 | -S "found session ticket extension" \ |
| 881 | -S "server hello, adding session ticket extension" \ |
| 882 | -C "found session_ticket extension" \ |
| 883 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 884 | -s "session successfully restored from cache" \ |
| 885 | -S "session successfully restored from ticket" \ |
| 886 | -s "a session has been resumed" \ |
| 887 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 888 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 889 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 890 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 891 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 892 | 0 \ |
| 893 | -S "session successfully restored from cache" \ |
| 894 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 895 | -S "a session has been resumed" \ |
| 896 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 897 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 898 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 899 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 900 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 901 | 0 \ |
| 902 | -s "session successfully restored from cache" \ |
| 903 | -S "session successfully restored from ticket" \ |
| 904 | -s "a session has been resumed" \ |
| 905 | -c "a session has been resumed" |
| 906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 907 | run_test "Session resume using cache: timemout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 908 | "$P_SRV debug_level=3 tickets=0" \ |
| 909 | "$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] | 910 | 0 \ |
| 911 | -s "session successfully restored from cache" \ |
| 912 | -S "session successfully restored from ticket" \ |
| 913 | -s "a session has been resumed" \ |
| 914 | -c "a session has been resumed" |
| 915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 916 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 917 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 918 | "$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] | 919 | 0 \ |
| 920 | -S "session successfully restored from cache" \ |
| 921 | -S "session successfully restored from ticket" \ |
| 922 | -S "a session has been resumed" \ |
| 923 | -C "a session has been resumed" |
| 924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 925 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 926 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 927 | "$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] | 928 | 0 \ |
| 929 | -s "session successfully restored from cache" \ |
| 930 | -S "session successfully restored from ticket" \ |
| 931 | -s "a session has been resumed" \ |
| 932 | -c "a session has been resumed" |
| 933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 934 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 935 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 936 | "( $O_CLI -sess_out $SESSION; \ |
| 937 | $O_CLI -sess_in $SESSION; \ |
| 938 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 939 | 0 \ |
| 940 | -s "found session ticket extension" \ |
| 941 | -S "server hello, adding session ticket extension" \ |
| 942 | -s "session successfully restored from cache" \ |
| 943 | -S "session successfully restored from ticket" \ |
| 944 | -s "a session has been resumed" |
| 945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 946 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 947 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 948 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 949 | 0 \ |
| 950 | -C "found session_ticket extension" \ |
| 951 | -C "parse new session ticket" \ |
| 952 | -c "a session has been resumed" |
| 953 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 954 | # Tests for Max Fragment Length extension |
| 955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 956 | run_test "Max fragment length: not used, reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 957 | "$P_SRV debug_level=3" \ |
| 958 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 959 | 0 \ |
| 960 | -C "client hello, adding max_fragment_length extension" \ |
| 961 | -S "found max fragment length extension" \ |
| 962 | -S "server hello, max_fragment_length extension" \ |
| 963 | -C "found max_fragment_length extension" |
| 964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 965 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 966 | "$P_SRV debug_level=3" \ |
| 967 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 968 | 0 \ |
| 969 | -c "client hello, adding max_fragment_length extension" \ |
| 970 | -s "found max fragment length extension" \ |
| 971 | -s "server hello, max_fragment_length extension" \ |
| 972 | -c "found max_fragment_length extension" |
| 973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 974 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 975 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 976 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 977 | 0 \ |
| 978 | -C "client hello, adding max_fragment_length extension" \ |
| 979 | -S "found max fragment length extension" \ |
| 980 | -S "server hello, max_fragment_length extension" \ |
| 981 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 983 | requires_gnutls |
| 984 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 985 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 986 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 987 | 0 \ |
| 988 | -c "client hello, adding max_fragment_length extension" \ |
| 989 | -c "found max_fragment_length extension" |
| 990 | |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 991 | run_test "Max fragment length: client, message just fits" \ |
| 992 | "$P_SRV debug_level=3" \ |
| 993 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 994 | 0 \ |
| 995 | -c "client hello, adding max_fragment_length extension" \ |
| 996 | -s "found max fragment length extension" \ |
| 997 | -s "server hello, max_fragment_length extension" \ |
| 998 | -c "found max_fragment_length extension" \ |
| 999 | -c "2048 bytes written in 1 fragments" \ |
| 1000 | -s "2048 bytes read" |
| 1001 | |
| 1002 | run_test "Max fragment length: client, larger message" \ |
| 1003 | "$P_SRV debug_level=3" \ |
| 1004 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1005 | 0 \ |
| 1006 | -c "client hello, adding max_fragment_length extension" \ |
| 1007 | -s "found max fragment length extension" \ |
| 1008 | -s "server hello, max_fragment_length extension" \ |
| 1009 | -c "found max_fragment_length extension" \ |
| 1010 | -c "2345 bytes written in 2 fragments" \ |
| 1011 | -s "2048 bytes read" \ |
| 1012 | -s "297 bytes read" |
| 1013 | |
| 1014 | run_test "Max fragment length: client, larger message" \ |
| 1015 | "$P_SRV debug_level=3 dtls=1" \ |
| 1016 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1017 | 1 \ |
| 1018 | -c "client hello, adding max_fragment_length extension" \ |
| 1019 | -s "found max fragment length extension" \ |
| 1020 | -s "server hello, max_fragment_length extension" \ |
| 1021 | -c "found max_fragment_length extension" \ |
| 1022 | -c "fragment larger than.*maximum" |
| 1023 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1024 | # Tests for renegotiation |
| 1025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1026 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1027 | "$P_SRV debug_level=3 exchanges=2" \ |
| 1028 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1029 | 0 \ |
| 1030 | -C "client hello, adding renegotiation extension" \ |
| 1031 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1032 | -S "found renegotiation extension" \ |
| 1033 | -s "server hello, secure renegotiation extension" \ |
| 1034 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1035 | -C "=> renegotiate" \ |
| 1036 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1037 | -S "write hello request" |
| 1038 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1039 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1040 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1" \ |
| 1041 | "$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] | 1042 | 0 \ |
| 1043 | -c "client hello, adding renegotiation extension" \ |
| 1044 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1045 | -s "found renegotiation extension" \ |
| 1046 | -s "server hello, secure renegotiation extension" \ |
| 1047 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1048 | -c "=> renegotiate" \ |
| 1049 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1050 | -S "write hello request" |
| 1051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1052 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1053 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1054 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1055 | 0 \ |
| 1056 | -c "client hello, adding renegotiation extension" \ |
| 1057 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1058 | -s "found renegotiation extension" \ |
| 1059 | -s "server hello, secure renegotiation extension" \ |
| 1060 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1061 | -c "=> renegotiate" \ |
| 1062 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1063 | -s "write hello request" |
| 1064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1065 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1066 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1067 | "$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] | 1068 | 0 \ |
| 1069 | -c "client hello, adding renegotiation extension" \ |
| 1070 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1071 | -s "found renegotiation extension" \ |
| 1072 | -s "server hello, secure renegotiation extension" \ |
| 1073 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1074 | -c "=> renegotiate" \ |
| 1075 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1076 | -s "write hello request" |
| 1077 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1078 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1079 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0" \ |
| 1080 | "$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] | 1081 | 1 \ |
| 1082 | -c "client hello, adding renegotiation extension" \ |
| 1083 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1084 | -S "found renegotiation extension" \ |
| 1085 | -s "server hello, secure renegotiation extension" \ |
| 1086 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1087 | -c "=> renegotiate" \ |
| 1088 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1089 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1090 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1091 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1093 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1094 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1095 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1096 | 0 \ |
| 1097 | -C "client hello, adding renegotiation extension" \ |
| 1098 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1099 | -S "found renegotiation extension" \ |
| 1100 | -s "server hello, secure renegotiation extension" \ |
| 1101 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1102 | -C "=> renegotiate" \ |
| 1103 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1104 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1105 | -S "SSL - An unexpected message was received from our peer" \ |
| 1106 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1108 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1109 | "$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] | 1110 | renego_delay=-1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1111 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1112 | 0 \ |
| 1113 | -C "client hello, adding renegotiation extension" \ |
| 1114 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1115 | -S "found renegotiation extension" \ |
| 1116 | -s "server hello, secure renegotiation extension" \ |
| 1117 | -c "found renegotiation extension" \ |
| 1118 | -C "=> renegotiate" \ |
| 1119 | -S "=> renegotiate" \ |
| 1120 | -s "write hello request" \ |
| 1121 | -S "SSL - An unexpected message was received from our peer" \ |
| 1122 | -S "failed" |
| 1123 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1124 | # delay 2 for 1 alert record + 1 application data record |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1125 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1126 | "$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] | 1127 | renego_delay=2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1128 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1129 | 0 \ |
| 1130 | -C "client hello, adding renegotiation extension" \ |
| 1131 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1132 | -S "found renegotiation extension" \ |
| 1133 | -s "server hello, secure renegotiation extension" \ |
| 1134 | -c "found renegotiation extension" \ |
| 1135 | -C "=> renegotiate" \ |
| 1136 | -S "=> renegotiate" \ |
| 1137 | -s "write hello request" \ |
| 1138 | -S "SSL - An unexpected message was received from our peer" \ |
| 1139 | -S "failed" |
| 1140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1141 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1142 | "$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] | 1143 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1144 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1145 | 0 \ |
| 1146 | -C "client hello, adding renegotiation extension" \ |
| 1147 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1148 | -S "found renegotiation extension" \ |
| 1149 | -s "server hello, secure renegotiation extension" \ |
| 1150 | -c "found renegotiation extension" \ |
| 1151 | -C "=> renegotiate" \ |
| 1152 | -S "=> renegotiate" \ |
| 1153 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1154 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1156 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1157 | "$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] | 1158 | renego_delay=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1159 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1160 | 0 \ |
| 1161 | -c "client hello, adding renegotiation extension" \ |
| 1162 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1163 | -s "found renegotiation extension" \ |
| 1164 | -s "server hello, secure renegotiation extension" \ |
| 1165 | -c "found renegotiation extension" \ |
| 1166 | -c "=> renegotiate" \ |
| 1167 | -s "=> renegotiate" \ |
| 1168 | -s "write hello request" \ |
| 1169 | -S "SSL - An unexpected message was received from our peer" \ |
| 1170 | -S "failed" |
| 1171 | |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1172 | run_test "Renegotiation: periodic, just below period" \ |
| 1173 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1174 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1175 | 0 \ |
| 1176 | -C "client hello, adding renegotiation extension" \ |
| 1177 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1178 | -S "found renegotiation extension" \ |
| 1179 | -s "server hello, secure renegotiation extension" \ |
| 1180 | -c "found renegotiation extension" \ |
| 1181 | -S "record counter limit reached: renegotiate" \ |
| 1182 | -C "=> renegotiate" \ |
| 1183 | -S "=> renegotiate" \ |
| 1184 | -S "write hello request" \ |
| 1185 | -S "SSL - An unexpected message was received from our peer" \ |
| 1186 | -S "failed" |
| 1187 | |
| 1188 | run_test "Renegotiation: periodic, just above period" \ |
| 1189 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1190 | "$P_CLI debug_level=3 exchanges=3 renegotiation=1" \ |
| 1191 | 0 \ |
| 1192 | -c "client hello, adding renegotiation extension" \ |
| 1193 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1194 | -s "found renegotiation extension" \ |
| 1195 | -s "server hello, secure renegotiation extension" \ |
| 1196 | -c "found renegotiation extension" \ |
| 1197 | -s "record counter limit reached: renegotiate" \ |
| 1198 | -c "=> renegotiate" \ |
| 1199 | -s "=> renegotiate" \ |
| 1200 | -s "write hello request" \ |
| 1201 | -S "SSL - An unexpected message was received from our peer" \ |
| 1202 | -S "failed" |
| 1203 | |
| 1204 | run_test "Renegotiation: periodic, two times period" \ |
| 1205 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3" \ |
| 1206 | "$P_CLI debug_level=3 exchanges=6 renegotiation=1" \ |
| 1207 | 0 \ |
| 1208 | -c "client hello, adding renegotiation extension" \ |
| 1209 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1210 | -s "found renegotiation extension" \ |
| 1211 | -s "server hello, secure renegotiation extension" \ |
| 1212 | -c "found renegotiation extension" \ |
| 1213 | -s "record counter limit reached: renegotiate" \ |
| 1214 | -c "=> renegotiate" \ |
| 1215 | -s "=> renegotiate" \ |
| 1216 | -s "write hello request" \ |
| 1217 | -S "SSL - An unexpected message was received from our peer" \ |
| 1218 | -S "failed" |
| 1219 | |
| 1220 | run_test "Renegotiation: periodic, above period, disabled" \ |
| 1221 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3" \ |
| 1222 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1223 | 0 \ |
| 1224 | -C "client hello, adding renegotiation extension" \ |
| 1225 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1226 | -S "found renegotiation extension" \ |
| 1227 | -s "server hello, secure renegotiation extension" \ |
| 1228 | -c "found renegotiation extension" \ |
| 1229 | -S "record counter limit reached: renegotiate" \ |
| 1230 | -C "=> renegotiate" \ |
| 1231 | -S "=> renegotiate" \ |
| 1232 | -S "write hello request" \ |
| 1233 | -S "SSL - An unexpected message was received from our peer" \ |
| 1234 | -S "failed" |
| 1235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1236 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1237 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
| 1238 | "$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] | 1239 | 0 \ |
| 1240 | -c "client hello, adding renegotiation extension" \ |
| 1241 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1242 | -s "found renegotiation extension" \ |
| 1243 | -s "server hello, secure renegotiation extension" \ |
| 1244 | -c "found renegotiation extension" \ |
| 1245 | -c "=> renegotiate" \ |
| 1246 | -s "=> renegotiate" \ |
| 1247 | -S "write hello request" |
| 1248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1249 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1250 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1251 | "$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] | 1252 | 0 \ |
| 1253 | -c "client hello, adding renegotiation extension" \ |
| 1254 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1255 | -s "found renegotiation extension" \ |
| 1256 | -s "server hello, secure renegotiation extension" \ |
| 1257 | -c "found renegotiation extension" \ |
| 1258 | -c "=> renegotiate" \ |
| 1259 | -s "=> renegotiate" \ |
| 1260 | -s "write hello request" |
| 1261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1262 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1263 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1264 | "$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] | 1265 | 0 \ |
| 1266 | -c "client hello, adding renegotiation extension" \ |
| 1267 | -c "found renegotiation extension" \ |
| 1268 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1269 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1270 | -C "error" \ |
| 1271 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1272 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1273 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1274 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1275 | "$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] | 1276 | 0 \ |
| 1277 | -c "client hello, adding renegotiation extension" \ |
| 1278 | -c "found renegotiation extension" \ |
| 1279 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1280 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1281 | -C "error" \ |
| 1282 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1283 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1284 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1285 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1286 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1287 | 1 \ |
| 1288 | -c "client hello, adding renegotiation extension" \ |
| 1289 | -C "found renegotiation extension" \ |
| 1290 | -c "=> renegotiate" \ |
| 1291 | -c "ssl_handshake() returned" \ |
| 1292 | -c "error" \ |
| 1293 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1294 | |
| 1295 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1296 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1297 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1298 | allow_legacy=0" \ |
| 1299 | 1 \ |
| 1300 | -c "client hello, adding renegotiation extension" \ |
| 1301 | -C "found renegotiation extension" \ |
| 1302 | -c "=> renegotiate" \ |
| 1303 | -c "ssl_handshake() returned" \ |
| 1304 | -c "error" \ |
| 1305 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1306 | |
| 1307 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1308 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1309 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1310 | allow_legacy=1" \ |
| 1311 | 0 \ |
| 1312 | -c "client hello, adding renegotiation extension" \ |
| 1313 | -C "found renegotiation extension" \ |
| 1314 | -c "=> renegotiate" \ |
| 1315 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1316 | -C "error" \ |
| 1317 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1318 | |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1319 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1320 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1321 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1322 | 0 \ |
| 1323 | -c "client hello, adding renegotiation extension" \ |
| 1324 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1325 | -s "found renegotiation extension" \ |
| 1326 | -s "server hello, secure renegotiation extension" \ |
| 1327 | -c "found renegotiation extension" \ |
| 1328 | -c "=> renegotiate" \ |
| 1329 | -s "=> renegotiate" \ |
| 1330 | -S "write hello request" |
| 1331 | |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1332 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1333 | "$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] | 1334 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1335 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1336 | 0 \ |
| 1337 | -c "client hello, adding renegotiation extension" \ |
| 1338 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1339 | -s "found renegotiation extension" \ |
| 1340 | -s "server hello, secure renegotiation extension" \ |
| 1341 | -c "found renegotiation extension" \ |
| 1342 | -c "=> renegotiate" \ |
| 1343 | -s "=> renegotiate" \ |
| 1344 | -s "write hello request" |
| 1345 | |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1346 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 1347 | "$G_SRV -u --mtu 4096" \ |
| 1348 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1349 | 0 \ |
| 1350 | -c "client hello, adding renegotiation extension" \ |
| 1351 | -c "found renegotiation extension" \ |
| 1352 | -c "=> renegotiate" \ |
| 1353 | -C "ssl_handshake returned" \ |
| 1354 | -C "error" \ |
| 1355 | -s "Extra-header:" |
| 1356 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1357 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 1358 | |
| 1359 | run_test "Renego ext: gnutls server strict, client default" \ |
| 1360 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1361 | "$P_CLI debug_level=3" \ |
| 1362 | 0 \ |
| 1363 | -c "found renegotiation extension" \ |
| 1364 | -C "error" \ |
| 1365 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1366 | |
| 1367 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 1368 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1369 | "$P_CLI debug_level=3" \ |
| 1370 | 0 \ |
| 1371 | -C "found renegotiation extension" \ |
| 1372 | -C "error" \ |
| 1373 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1374 | |
| 1375 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 1376 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1377 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 1378 | 1 \ |
| 1379 | -C "found renegotiation extension" \ |
| 1380 | -c "error" \ |
| 1381 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1382 | |
| 1383 | run_test "Renego ext: gnutls client strict, server default" \ |
| 1384 | "$P_SRV debug_level=3" \ |
| 1385 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 1386 | 0 \ |
| 1387 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1388 | -s "server hello, secure renegotiation extension" |
| 1389 | |
| 1390 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 1391 | "$P_SRV debug_level=3" \ |
| 1392 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1393 | 0 \ |
| 1394 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1395 | -S "server hello, secure renegotiation extension" |
| 1396 | |
| 1397 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 1398 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 1399 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1400 | 1 \ |
| 1401 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 1402 | -S "server hello, secure renegotiation extension" |
| 1403 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1404 | # Tests for auth_mode |
| 1405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1406 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1407 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1408 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1409 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1410 | 1 \ |
| 1411 | -c "x509_verify_cert() returned" \ |
| 1412 | -c "! self-signed or not signed by a trusted CA" \ |
| 1413 | -c "! ssl_handshake returned" \ |
| 1414 | -c "X509 - Certificate verification failed" |
| 1415 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1416 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1417 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 1418 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1419 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1420 | 0 \ |
| 1421 | -c "x509_verify_cert() returned" \ |
| 1422 | -c "! self-signed or not signed by a trusted CA" \ |
| 1423 | -C "! ssl_handshake returned" \ |
| 1424 | -C "X509 - Certificate verification failed" |
| 1425 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1426 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1427 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1428 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1429 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1430 | 0 \ |
| 1431 | -C "x509_verify_cert() returned" \ |
| 1432 | -C "! self-signed or not signed by a trusted CA" \ |
| 1433 | -C "! ssl_handshake returned" \ |
| 1434 | -C "X509 - Certificate verification failed" |
| 1435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1436 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1437 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 1438 | "$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] | 1439 | key_file=data_files/server5.key" \ |
| 1440 | 1 \ |
| 1441 | -S "skip write certificate request" \ |
| 1442 | -C "skip parse certificate request" \ |
| 1443 | -c "got a certificate request" \ |
| 1444 | -C "skip write certificate" \ |
| 1445 | -C "skip write certificate verify" \ |
| 1446 | -S "skip parse certificate verify" \ |
| 1447 | -s "x509_verify_cert() returned" \ |
| 1448 | -S "! self-signed or not signed by a trusted CA" \ |
| 1449 | -s "! ssl_handshake returned" \ |
| 1450 | -c "! ssl_handshake returned" \ |
| 1451 | -s "X509 - Certificate verification failed" |
| 1452 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1453 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1454 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1455 | "$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] | 1456 | key_file=data_files/server5.key" \ |
| 1457 | 0 \ |
| 1458 | -S "skip write certificate request" \ |
| 1459 | -C "skip parse certificate request" \ |
| 1460 | -c "got a certificate request" \ |
| 1461 | -C "skip write certificate" \ |
| 1462 | -C "skip write certificate verify" \ |
| 1463 | -S "skip parse certificate verify" \ |
| 1464 | -s "x509_verify_cert() returned" \ |
| 1465 | -s "! self-signed or not signed by a trusted CA" \ |
| 1466 | -S "! ssl_handshake returned" \ |
| 1467 | -C "! ssl_handshake returned" \ |
| 1468 | -S "X509 - Certificate verification failed" |
| 1469 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1470 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1471 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 1472 | "$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] | 1473 | key_file=data_files/server5.key" \ |
| 1474 | 0 \ |
| 1475 | -s "skip write certificate request" \ |
| 1476 | -C "skip parse certificate request" \ |
| 1477 | -c "got no certificate request" \ |
| 1478 | -c "skip write certificate" \ |
| 1479 | -c "skip write certificate verify" \ |
| 1480 | -s "skip parse certificate verify" \ |
| 1481 | -S "x509_verify_cert() returned" \ |
| 1482 | -S "! self-signed or not signed by a trusted CA" \ |
| 1483 | -S "! ssl_handshake returned" \ |
| 1484 | -C "! ssl_handshake returned" \ |
| 1485 | -S "X509 - Certificate verification failed" |
| 1486 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1487 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1488 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 1489 | "$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] | 1490 | 0 \ |
| 1491 | -S "skip write certificate request" \ |
| 1492 | -C "skip parse certificate request" \ |
| 1493 | -c "got a certificate request" \ |
| 1494 | -C "skip write certificate$" \ |
| 1495 | -C "got no certificate to send" \ |
| 1496 | -S "SSLv3 client has no certificate" \ |
| 1497 | -c "skip write certificate verify" \ |
| 1498 | -s "skip parse certificate verify" \ |
| 1499 | -s "! no client certificate sent" \ |
| 1500 | -S "! ssl_handshake returned" \ |
| 1501 | -C "! ssl_handshake returned" \ |
| 1502 | -S "X509 - Certificate verification failed" |
| 1503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1504 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1505 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1506 | "$O_CLI" \ |
| 1507 | 0 \ |
| 1508 | -S "skip write certificate request" \ |
| 1509 | -s "skip parse certificate verify" \ |
| 1510 | -s "! no client certificate sent" \ |
| 1511 | -S "! ssl_handshake returned" \ |
| 1512 | -S "X509 - Certificate verification failed" |
| 1513 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1514 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 1515 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1516 | "$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] | 1517 | 0 \ |
| 1518 | -C "skip parse certificate request" \ |
| 1519 | -c "got a certificate request" \ |
| 1520 | -C "skip write certificate$" \ |
| 1521 | -c "skip write certificate verify" \ |
| 1522 | -C "! ssl_handshake returned" |
| 1523 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1524 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1525 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
| 1526 | "$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] | 1527 | 0 \ |
| 1528 | -S "skip write certificate request" \ |
| 1529 | -C "skip parse certificate request" \ |
| 1530 | -c "got a certificate request" \ |
| 1531 | -C "skip write certificate$" \ |
| 1532 | -c "skip write certificate verify" \ |
| 1533 | -c "got no certificate to send" \ |
| 1534 | -s "SSLv3 client has no certificate" \ |
| 1535 | -s "skip parse certificate verify" \ |
| 1536 | -s "! no client certificate sent" \ |
| 1537 | -S "! ssl_handshake returned" \ |
| 1538 | -C "! ssl_handshake returned" \ |
| 1539 | -S "X509 - Certificate verification failed" |
| 1540 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1541 | # tests for SNI |
| 1542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1543 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1544 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1545 | 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] | 1546 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1547 | 0 \ |
| 1548 | -S "parse ServerName extension" \ |
| 1549 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1550 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1552 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1553 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1554 | 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] | 1555 | 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] | 1556 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1557 | 0 \ |
| 1558 | -s "parse ServerName extension" \ |
| 1559 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1560 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1561 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1562 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1563 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1564 | 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] | 1565 | 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] | 1566 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1567 | 0 \ |
| 1568 | -s "parse ServerName extension" \ |
| 1569 | -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] | 1570 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1572 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1573 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1574 | 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] | 1575 | 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] | 1576 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1577 | 1 \ |
| 1578 | -s "parse ServerName extension" \ |
| 1579 | -s "ssl_sni_wrapper() returned" \ |
| 1580 | -s "ssl_handshake returned" \ |
| 1581 | -c "ssl_handshake returned" \ |
| 1582 | -c "SSL - A fatal alert message was received from our peer" |
| 1583 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1584 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1585 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1586 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1587 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1588 | "$P_CLI nbio=2 tickets=0" \ |
| 1589 | 0 \ |
| 1590 | -S "ssl_handshake returned" \ |
| 1591 | -C "ssl_handshake returned" \ |
| 1592 | -c "Read from server: .* bytes read" |
| 1593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1594 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1595 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1596 | "$P_CLI nbio=2 tickets=0" \ |
| 1597 | 0 \ |
| 1598 | -S "ssl_handshake returned" \ |
| 1599 | -C "ssl_handshake returned" \ |
| 1600 | -c "Read from server: .* bytes read" |
| 1601 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1602 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1603 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1604 | "$P_CLI nbio=2 tickets=1" \ |
| 1605 | 0 \ |
| 1606 | -S "ssl_handshake returned" \ |
| 1607 | -C "ssl_handshake returned" \ |
| 1608 | -c "Read from server: .* bytes read" |
| 1609 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1610 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1611 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1612 | "$P_CLI nbio=2 tickets=1" \ |
| 1613 | 0 \ |
| 1614 | -S "ssl_handshake returned" \ |
| 1615 | -C "ssl_handshake returned" \ |
| 1616 | -c "Read from server: .* bytes read" |
| 1617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1618 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1619 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1620 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1621 | 0 \ |
| 1622 | -S "ssl_handshake returned" \ |
| 1623 | -C "ssl_handshake returned" \ |
| 1624 | -c "Read from server: .* bytes read" |
| 1625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1626 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1627 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1628 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1629 | 0 \ |
| 1630 | -S "ssl_handshake returned" \ |
| 1631 | -C "ssl_handshake returned" \ |
| 1632 | -c "Read from server: .* bytes read" |
| 1633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1634 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1635 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1636 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1637 | 0 \ |
| 1638 | -S "ssl_handshake returned" \ |
| 1639 | -C "ssl_handshake returned" \ |
| 1640 | -c "Read from server: .* bytes read" |
| 1641 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1642 | # Tests for version negotiation |
| 1643 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1644 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1645 | "$P_SRV" \ |
| 1646 | "$P_CLI" \ |
| 1647 | 0 \ |
| 1648 | -S "ssl_handshake returned" \ |
| 1649 | -C "ssl_handshake returned" \ |
| 1650 | -s "Protocol is TLSv1.2" \ |
| 1651 | -c "Protocol is TLSv1.2" |
| 1652 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1653 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1654 | "$P_SRV" \ |
| 1655 | "$P_CLI max_version=tls1_1" \ |
| 1656 | 0 \ |
| 1657 | -S "ssl_handshake returned" \ |
| 1658 | -C "ssl_handshake returned" \ |
| 1659 | -s "Protocol is TLSv1.1" \ |
| 1660 | -c "Protocol is TLSv1.1" |
| 1661 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1662 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1663 | "$P_SRV max_version=tls1_1" \ |
| 1664 | "$P_CLI" \ |
| 1665 | 0 \ |
| 1666 | -S "ssl_handshake returned" \ |
| 1667 | -C "ssl_handshake returned" \ |
| 1668 | -s "Protocol is TLSv1.1" \ |
| 1669 | -c "Protocol is TLSv1.1" |
| 1670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1671 | 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] | 1672 | "$P_SRV max_version=tls1_1" \ |
| 1673 | "$P_CLI max_version=tls1_1" \ |
| 1674 | 0 \ |
| 1675 | -S "ssl_handshake returned" \ |
| 1676 | -C "ssl_handshake returned" \ |
| 1677 | -s "Protocol is TLSv1.1" \ |
| 1678 | -c "Protocol is TLSv1.1" |
| 1679 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1680 | 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] | 1681 | "$P_SRV min_version=tls1_1" \ |
| 1682 | "$P_CLI max_version=tls1_1" \ |
| 1683 | 0 \ |
| 1684 | -S "ssl_handshake returned" \ |
| 1685 | -C "ssl_handshake returned" \ |
| 1686 | -s "Protocol is TLSv1.1" \ |
| 1687 | -c "Protocol is TLSv1.1" |
| 1688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1689 | 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] | 1690 | "$P_SRV max_version=tls1_1" \ |
| 1691 | "$P_CLI min_version=tls1_1" \ |
| 1692 | 0 \ |
| 1693 | -S "ssl_handshake returned" \ |
| 1694 | -C "ssl_handshake returned" \ |
| 1695 | -s "Protocol is TLSv1.1" \ |
| 1696 | -c "Protocol is TLSv1.1" |
| 1697 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1698 | 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] | 1699 | "$P_SRV max_version=tls1_1" \ |
| 1700 | "$P_CLI min_version=tls1_2" \ |
| 1701 | 1 \ |
| 1702 | -s "ssl_handshake returned" \ |
| 1703 | -c "ssl_handshake returned" \ |
| 1704 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1706 | 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] | 1707 | "$P_SRV min_version=tls1_2" \ |
| 1708 | "$P_CLI max_version=tls1_1" \ |
| 1709 | 1 \ |
| 1710 | -s "ssl_handshake returned" \ |
| 1711 | -c "ssl_handshake returned" \ |
| 1712 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1713 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1714 | # Tests for ALPN extension |
| 1715 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1716 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1718 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1719 | "$P_SRV debug_level=3" \ |
| 1720 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1721 | 0 \ |
| 1722 | -C "client hello, adding alpn extension" \ |
| 1723 | -S "found alpn extension" \ |
| 1724 | -C "got an alert message, type: \\[2:120]" \ |
| 1725 | -S "server hello, adding alpn extension" \ |
| 1726 | -C "found alpn extension " \ |
| 1727 | -C "Application Layer Protocol is" \ |
| 1728 | -S "Application Layer Protocol is" |
| 1729 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1730 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1731 | "$P_SRV debug_level=3" \ |
| 1732 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1733 | 0 \ |
| 1734 | -c "client hello, adding alpn extension" \ |
| 1735 | -s "found alpn extension" \ |
| 1736 | -C "got an alert message, type: \\[2:120]" \ |
| 1737 | -S "server hello, adding alpn extension" \ |
| 1738 | -C "found alpn extension " \ |
| 1739 | -c "Application Layer Protocol is (none)" \ |
| 1740 | -S "Application Layer Protocol is" |
| 1741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1742 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1743 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1744 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1745 | 0 \ |
| 1746 | -C "client hello, adding alpn extension" \ |
| 1747 | -S "found alpn extension" \ |
| 1748 | -C "got an alert message, type: \\[2:120]" \ |
| 1749 | -S "server hello, adding alpn extension" \ |
| 1750 | -C "found alpn extension " \ |
| 1751 | -C "Application Layer Protocol is" \ |
| 1752 | -s "Application Layer Protocol is (none)" |
| 1753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1754 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1755 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1756 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1757 | 0 \ |
| 1758 | -c "client hello, adding alpn extension" \ |
| 1759 | -s "found alpn extension" \ |
| 1760 | -C "got an alert message, type: \\[2:120]" \ |
| 1761 | -s "server hello, adding alpn extension" \ |
| 1762 | -c "found alpn extension" \ |
| 1763 | -c "Application Layer Protocol is abc" \ |
| 1764 | -s "Application Layer Protocol is abc" |
| 1765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1766 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1767 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1768 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1769 | 0 \ |
| 1770 | -c "client hello, adding alpn extension" \ |
| 1771 | -s "found alpn extension" \ |
| 1772 | -C "got an alert message, type: \\[2:120]" \ |
| 1773 | -s "server hello, adding alpn extension" \ |
| 1774 | -c "found alpn extension" \ |
| 1775 | -c "Application Layer Protocol is abc" \ |
| 1776 | -s "Application Layer Protocol is abc" |
| 1777 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1778 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1779 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1780 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1781 | 0 \ |
| 1782 | -c "client hello, adding alpn extension" \ |
| 1783 | -s "found alpn extension" \ |
| 1784 | -C "got an alert message, type: \\[2:120]" \ |
| 1785 | -s "server hello, adding alpn extension" \ |
| 1786 | -c "found alpn extension" \ |
| 1787 | -c "Application Layer Protocol is 1234" \ |
| 1788 | -s "Application Layer Protocol is 1234" |
| 1789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1790 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1791 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1792 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1793 | 1 \ |
| 1794 | -c "client hello, adding alpn extension" \ |
| 1795 | -s "found alpn extension" \ |
| 1796 | -c "got an alert message, type: \\[2:120]" \ |
| 1797 | -S "server hello, adding alpn extension" \ |
| 1798 | -C "found alpn extension" \ |
| 1799 | -C "Application Layer Protocol is 1234" \ |
| 1800 | -S "Application Layer Protocol is 1234" |
| 1801 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1802 | fi |
| 1803 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1804 | # Tests for keyUsage in leaf certificates, part 1: |
| 1805 | # server-side certificate/suite selection |
| 1806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1807 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1808 | "$P_SRV key_file=data_files/server2.key \ |
| 1809 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1810 | "$P_CLI" \ |
| 1811 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1812 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1813 | |
| 1814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1815 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1816 | "$P_SRV key_file=data_files/server2.key \ |
| 1817 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1818 | "$P_CLI" \ |
| 1819 | 0 \ |
| 1820 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1822 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1823 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1824 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1825 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1826 | 1 \ |
| 1827 | -C "Ciphersuite is " |
| 1828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1829 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1830 | "$P_SRV key_file=data_files/server5.key \ |
| 1831 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1832 | "$P_CLI" \ |
| 1833 | 0 \ |
| 1834 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1835 | |
| 1836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1837 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1838 | "$P_SRV key_file=data_files/server5.key \ |
| 1839 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1840 | "$P_CLI" \ |
| 1841 | 0 \ |
| 1842 | -c "Ciphersuite is TLS-ECDH-" |
| 1843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1844 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1845 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1846 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1847 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1848 | 1 \ |
| 1849 | -C "Ciphersuite is " |
| 1850 | |
| 1851 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1852 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1853 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1854 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1855 | "$O_SRV -key data_files/server2.key \ |
| 1856 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1857 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1858 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1859 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1860 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1861 | -C "Processing of the Certificate handshake message failed" \ |
| 1862 | -c "Ciphersuite is TLS-" |
| 1863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1864 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1865 | "$O_SRV -key data_files/server2.key \ |
| 1866 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1867 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1868 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1869 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1870 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1871 | -C "Processing of the Certificate handshake message failed" \ |
| 1872 | -c "Ciphersuite is TLS-" |
| 1873 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1874 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1875 | "$O_SRV -key data_files/server2.key \ |
| 1876 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1877 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1878 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1879 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1880 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1881 | -C "Processing of the Certificate handshake message failed" \ |
| 1882 | -c "Ciphersuite is TLS-" |
| 1883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1884 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1885 | "$O_SRV -key data_files/server2.key \ |
| 1886 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1887 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1888 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1889 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1890 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1891 | -c "Processing of the Certificate handshake message failed" \ |
| 1892 | -C "Ciphersuite is TLS-" |
| 1893 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1894 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1895 | "$O_SRV -key data_files/server2.key \ |
| 1896 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1897 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1898 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1899 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1900 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1901 | -C "Processing of the Certificate handshake message failed" \ |
| 1902 | -c "Ciphersuite is TLS-" |
| 1903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1904 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1905 | "$O_SRV -key data_files/server2.key \ |
| 1906 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1907 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1908 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1909 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1910 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1911 | -c "Processing of the Certificate handshake message failed" \ |
| 1912 | -C "Ciphersuite is TLS-" |
| 1913 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1914 | # Tests for keyUsage in leaf certificates, part 3: |
| 1915 | # server-side checking of client cert |
| 1916 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1917 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1918 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1919 | "$O_CLI -key data_files/server2.key \ |
| 1920 | -cert data_files/server2.ku-ds.crt" \ |
| 1921 | 0 \ |
| 1922 | -S "bad certificate (usage extensions)" \ |
| 1923 | -S "Processing of the Certificate handshake message failed" |
| 1924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1925 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1926 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1927 | "$O_CLI -key data_files/server2.key \ |
| 1928 | -cert data_files/server2.ku-ke.crt" \ |
| 1929 | 0 \ |
| 1930 | -s "bad certificate (usage extensions)" \ |
| 1931 | -S "Processing of the Certificate handshake message failed" |
| 1932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1933 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1934 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1935 | "$O_CLI -key data_files/server2.key \ |
| 1936 | -cert data_files/server2.ku-ke.crt" \ |
| 1937 | 1 \ |
| 1938 | -s "bad certificate (usage extensions)" \ |
| 1939 | -s "Processing of the Certificate handshake message failed" |
| 1940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1941 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1942 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1943 | "$O_CLI -key data_files/server5.key \ |
| 1944 | -cert data_files/server5.ku-ds.crt" \ |
| 1945 | 0 \ |
| 1946 | -S "bad certificate (usage extensions)" \ |
| 1947 | -S "Processing of the Certificate handshake message failed" |
| 1948 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1949 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1950 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1951 | "$O_CLI -key data_files/server5.key \ |
| 1952 | -cert data_files/server5.ku-ka.crt" \ |
| 1953 | 0 \ |
| 1954 | -s "bad certificate (usage extensions)" \ |
| 1955 | -S "Processing of the Certificate handshake message failed" |
| 1956 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1957 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1959 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1960 | "$P_SRV key_file=data_files/server5.key \ |
| 1961 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1962 | "$P_CLI" \ |
| 1963 | 0 |
| 1964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1965 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1966 | "$P_SRV key_file=data_files/server5.key \ |
| 1967 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1968 | "$P_CLI" \ |
| 1969 | 0 |
| 1970 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1971 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1972 | "$P_SRV key_file=data_files/server5.key \ |
| 1973 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1974 | "$P_CLI" \ |
| 1975 | 0 |
| 1976 | |
| 1977 | # 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] | 1978 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1979 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1980 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1981 | "$P_CLI psk=badbad" \ |
| 1982 | 1 |
| 1983 | |
| 1984 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1985 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1986 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1987 | "$O_SRV -key data_files/server5.key \ |
| 1988 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1989 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1990 | 0 \ |
| 1991 | -C "bad certificate (usage extensions)" \ |
| 1992 | -C "Processing of the Certificate handshake message failed" \ |
| 1993 | -c "Ciphersuite is TLS-" |
| 1994 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1995 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1996 | "$O_SRV -key data_files/server5.key \ |
| 1997 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1998 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1999 | 0 \ |
| 2000 | -C "bad certificate (usage extensions)" \ |
| 2001 | -C "Processing of the Certificate handshake message failed" \ |
| 2002 | -c "Ciphersuite is TLS-" |
| 2003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2004 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2005 | "$O_SRV -key data_files/server5.key \ |
| 2006 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2007 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2008 | 0 \ |
| 2009 | -C "bad certificate (usage extensions)" \ |
| 2010 | -C "Processing of the Certificate handshake message failed" \ |
| 2011 | -c "Ciphersuite is TLS-" |
| 2012 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2013 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2014 | "$O_SRV -key data_files/server5.key \ |
| 2015 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2016 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2017 | 1 \ |
| 2018 | -c "bad certificate (usage extensions)" \ |
| 2019 | -c "Processing of the Certificate handshake message failed" \ |
| 2020 | -C "Ciphersuite is TLS-" |
| 2021 | |
| 2022 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 2023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2024 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2025 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2026 | "$O_CLI -key data_files/server5.key \ |
| 2027 | -cert data_files/server5.eku-cli.crt" \ |
| 2028 | 0 \ |
| 2029 | -S "bad certificate (usage extensions)" \ |
| 2030 | -S "Processing of the Certificate handshake message failed" |
| 2031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2032 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2033 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2034 | "$O_CLI -key data_files/server5.key \ |
| 2035 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 2036 | 0 \ |
| 2037 | -S "bad certificate (usage extensions)" \ |
| 2038 | -S "Processing of the Certificate handshake message failed" |
| 2039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2040 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2041 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2042 | "$O_CLI -key data_files/server5.key \ |
| 2043 | -cert data_files/server5.eku-cs_any.crt" \ |
| 2044 | 0 \ |
| 2045 | -S "bad certificate (usage extensions)" \ |
| 2046 | -S "Processing of the Certificate handshake message failed" |
| 2047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2048 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2049 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2050 | "$O_CLI -key data_files/server5.key \ |
| 2051 | -cert data_files/server5.eku-cs.crt" \ |
| 2052 | 0 \ |
| 2053 | -s "bad certificate (usage extensions)" \ |
| 2054 | -S "Processing of the Certificate handshake message failed" |
| 2055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2056 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2057 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2058 | "$O_CLI -key data_files/server5.key \ |
| 2059 | -cert data_files/server5.eku-cs.crt" \ |
| 2060 | 1 \ |
| 2061 | -s "bad certificate (usage extensions)" \ |
| 2062 | -s "Processing of the Certificate handshake message failed" |
| 2063 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2064 | # Tests for DHM parameters loading |
| 2065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2066 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2067 | "$P_SRV" \ |
| 2068 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2069 | debug_level=3" \ |
| 2070 | 0 \ |
| 2071 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 2072 | -c "value of 'DHM: G ' (2048 bits)" |
| 2073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2074 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2075 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 2076 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2077 | debug_level=3" \ |
| 2078 | 0 \ |
| 2079 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 2080 | -c "value of 'DHM: G ' (2 bits)" |
| 2081 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2082 | # Tests for PSK callback |
| 2083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2084 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2085 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 2086 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2087 | psk_identity=foo psk=abc123" \ |
| 2088 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2089 | -S "SSL - The server has no ciphersuites in common" \ |
| 2090 | -S "SSL - Unknown identity received" \ |
| 2091 | -S "SSL - Verification of the message MAC failed" |
| 2092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2093 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2094 | "$P_SRV" \ |
| 2095 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2096 | psk_identity=foo psk=abc123" \ |
| 2097 | 1 \ |
| 2098 | -s "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2099 | -S "SSL - Unknown identity received" \ |
| 2100 | -S "SSL - Verification of the message MAC failed" |
| 2101 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2102 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2103 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 2104 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2105 | psk_identity=foo psk=abc123" \ |
| 2106 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2107 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2108 | -s "SSL - Unknown identity received" \ |
| 2109 | -S "SSL - Verification of the message MAC failed" |
| 2110 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2111 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2112 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2113 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2114 | psk_identity=abc psk=dead" \ |
| 2115 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2116 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2117 | -S "SSL - Unknown identity received" \ |
| 2118 | -S "SSL - Verification of the message MAC failed" |
| 2119 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2120 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2121 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2122 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2123 | psk_identity=def psk=beef" \ |
| 2124 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2125 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2126 | -S "SSL - Unknown identity received" \ |
| 2127 | -S "SSL - Verification of the message MAC failed" |
| 2128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2129 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2130 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2131 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2132 | psk_identity=ghi psk=beef" \ |
| 2133 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2134 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2135 | -s "SSL - Unknown identity received" \ |
| 2136 | -S "SSL - Verification of the message MAC failed" |
| 2137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2138 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2139 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 2140 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 2141 | psk_identity=abc psk=beef" \ |
| 2142 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2143 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2144 | -S "SSL - Unknown identity received" \ |
| 2145 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2146 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2147 | # Tests for ciphersuites per version |
| 2148 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2149 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2150 | "$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" \ |
| 2151 | "$P_CLI force_version=ssl3" \ |
| 2152 | 0 \ |
| 2153 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 2154 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2155 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2156 | "$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" \ |
| 2157 | "$P_CLI force_version=tls1" \ |
| 2158 | 0 \ |
| 2159 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 2160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2161 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2162 | "$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" \ |
| 2163 | "$P_CLI force_version=tls1_1" \ |
| 2164 | 0 \ |
| 2165 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 2166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2167 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2168 | "$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" \ |
| 2169 | "$P_CLI force_version=tls1_2" \ |
| 2170 | 0 \ |
| 2171 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 2172 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2173 | # Tests for ssl_get_bytes_avail() |
| 2174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2175 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2176 | "$P_SRV" \ |
| 2177 | "$P_CLI request_size=100" \ |
| 2178 | 0 \ |
| 2179 | -s "Read from client: 100 bytes read$" |
| 2180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2181 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 2182 | "$P_SRV" \ |
| 2183 | "$P_CLI request_size=500" \ |
| 2184 | 0 \ |
| 2185 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 2186 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2187 | # Tests for small packets |
| 2188 | |
| 2189 | run_test "Small packet SSLv3 BlockCipher" \ |
| 2190 | "$P_SRV" \ |
| 2191 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2192 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2193 | 0 \ |
| 2194 | -s "Read from client: 1 bytes read" |
| 2195 | |
| 2196 | run_test "Small packet SSLv3 StreamCipher" \ |
| 2197 | "$P_SRV" \ |
| 2198 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 2199 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2200 | 0 \ |
| 2201 | -s "Read from client: 1 bytes read" |
| 2202 | |
| 2203 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 2204 | "$P_SRV" \ |
| 2205 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2207 | 0 \ |
| 2208 | -s "Read from client: 1 bytes read" |
| 2209 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2210 | run_test "Small packet TLS 1.0 BlockCipher without EtM" \ |
| 2211 | "$P_SRV" \ |
| 2212 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 2213 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2214 | 0 \ |
| 2215 | -s "Read from client: 1 bytes read" |
| 2216 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2217 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2218 | "$P_SRV" \ |
| 2219 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2220 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2221 | trunc_hmac=1" \ |
| 2222 | 0 \ |
| 2223 | -s "Read from client: 1 bytes read" |
| 2224 | |
| 2225 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
| 2226 | "$P_SRV" \ |
| 2227 | "$P_CLI request_size=1 force_version=tls1 \ |
| 2228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2229 | trunc_hmac=1" \ |
| 2230 | 0 \ |
| 2231 | -s "Read from client: 1 bytes read" |
| 2232 | |
| 2233 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 2234 | "$P_SRV" \ |
| 2235 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2237 | 0 \ |
| 2238 | -s "Read from client: 1 bytes read" |
| 2239 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2240 | run_test "Small packet TLS 1.1 BlockCipher without EtM" \ |
| 2241 | "$P_SRV" \ |
| 2242 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ |
| 2243 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2244 | 0 \ |
| 2245 | -s "Read from client: 1 bytes read" |
| 2246 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2247 | run_test "Small packet TLS 1.1 StreamCipher" \ |
| 2248 | "$P_SRV" \ |
| 2249 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2250 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2251 | 0 \ |
| 2252 | -s "Read from client: 1 bytes read" |
| 2253 | |
| 2254 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2255 | "$P_SRV" \ |
| 2256 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2257 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2258 | trunc_hmac=1" \ |
| 2259 | 0 \ |
| 2260 | -s "Read from client: 1 bytes read" |
| 2261 | |
| 2262 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
| 2263 | "$P_SRV" \ |
| 2264 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 2265 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2266 | trunc_hmac=1" \ |
| 2267 | 0 \ |
| 2268 | -s "Read from client: 1 bytes read" |
| 2269 | |
| 2270 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 2271 | "$P_SRV" \ |
| 2272 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2274 | 0 \ |
| 2275 | -s "Read from client: 1 bytes read" |
| 2276 | |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 2277 | run_test "Small packet TLS 1.2 BlockCipher without EtM" \ |
| 2278 | "$P_SRV" \ |
| 2279 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ |
| 2280 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2281 | 0 \ |
| 2282 | -s "Read from client: 1 bytes read" |
| 2283 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 2284 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 2285 | "$P_SRV" \ |
| 2286 | "$P_CLI request_size=1 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 2287 | 0 \ |
| 2288 | -s "Read from client: 1 bytes read" |
| 2289 | |
| 2290 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2291 | "$P_SRV" \ |
| 2292 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2293 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2294 | trunc_hmac=1" \ |
| 2295 | 0 \ |
| 2296 | -s "Read from client: 1 bytes read" |
| 2297 | |
| 2298 | run_test "Small packet TLS 1.2 StreamCipher" \ |
| 2299 | "$P_SRV" \ |
| 2300 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2302 | 0 \ |
| 2303 | -s "Read from client: 1 bytes read" |
| 2304 | |
| 2305 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
| 2306 | "$P_SRV" \ |
| 2307 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2308 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2309 | trunc_hmac=1" \ |
| 2310 | 0 \ |
| 2311 | -s "Read from client: 1 bytes read" |
| 2312 | |
| 2313 | run_test "Small packet TLS 1.2 AEAD" \ |
| 2314 | "$P_SRV" \ |
| 2315 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2317 | 0 \ |
| 2318 | -s "Read from client: 1 bytes read" |
| 2319 | |
| 2320 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 2321 | "$P_SRV" \ |
| 2322 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 2323 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2324 | 0 \ |
| 2325 | -s "Read from client: 1 bytes read" |
| 2326 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 2327 | # Test for large packets |
| 2328 | |
| 2329 | run_test "Large packet SSLv3 BlockCipher" \ |
| 2330 | "$P_SRV" \ |
| 2331 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2332 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2333 | 0 \ |
| 2334 | -s "Read from client: 16384 bytes read" |
| 2335 | |
| 2336 | run_test "Large packet SSLv3 StreamCipher" \ |
| 2337 | "$P_SRV" \ |
| 2338 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 2339 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2340 | 0 \ |
| 2341 | -s "Read from client: 16384 bytes read" |
| 2342 | |
| 2343 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 2344 | "$P_SRV" \ |
| 2345 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2346 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2347 | 0 \ |
| 2348 | -s "Read from client: 16384 bytes read" |
| 2349 | |
| 2350 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 2351 | "$P_SRV" \ |
| 2352 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2354 | trunc_hmac=1" \ |
| 2355 | 0 \ |
| 2356 | -s "Read from client: 16384 bytes read" |
| 2357 | |
| 2358 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
| 2359 | "$P_SRV" \ |
| 2360 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 2361 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2362 | trunc_hmac=1" \ |
| 2363 | 0 \ |
| 2364 | -s "Read from client: 16384 bytes read" |
| 2365 | |
| 2366 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 2367 | "$P_SRV" \ |
| 2368 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2369 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2370 | 0 \ |
| 2371 | -s "Read from client: 16384 bytes read" |
| 2372 | |
| 2373 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 2374 | "$P_SRV" \ |
| 2375 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2376 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2377 | 0 \ |
| 2378 | -s "Read from client: 16384 bytes read" |
| 2379 | |
| 2380 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 2381 | "$P_SRV" \ |
| 2382 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2383 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2384 | trunc_hmac=1" \ |
| 2385 | 0 \ |
| 2386 | -s "Read from client: 16384 bytes read" |
| 2387 | |
| 2388 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
| 2389 | "$P_SRV" \ |
| 2390 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 2391 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2392 | trunc_hmac=1" \ |
| 2393 | 0 \ |
| 2394 | -s "Read from client: 16384 bytes read" |
| 2395 | |
| 2396 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 2397 | "$P_SRV" \ |
| 2398 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2399 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 2400 | 0 \ |
| 2401 | -s "Read from client: 16384 bytes read" |
| 2402 | |
| 2403 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 2404 | "$P_SRV" \ |
| 2405 | "$P_CLI request_size=16384 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 2406 | 0 \ |
| 2407 | -s "Read from client: 16384 bytes read" |
| 2408 | |
| 2409 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 2410 | "$P_SRV" \ |
| 2411 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2412 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 2413 | trunc_hmac=1" \ |
| 2414 | 0 \ |
| 2415 | -s "Read from client: 16384 bytes read" |
| 2416 | |
| 2417 | run_test "Large packet TLS 1.2 StreamCipher" \ |
| 2418 | "$P_SRV" \ |
| 2419 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2420 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2421 | 0 \ |
| 2422 | -s "Read from client: 16384 bytes read" |
| 2423 | |
| 2424 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
| 2425 | "$P_SRV" \ |
| 2426 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2427 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2428 | trunc_hmac=1" \ |
| 2429 | 0 \ |
| 2430 | -s "Read from client: 16384 bytes read" |
| 2431 | |
| 2432 | run_test "Large packet TLS 1.2 AEAD" \ |
| 2433 | "$P_SRV" \ |
| 2434 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2435 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 2436 | 0 \ |
| 2437 | -s "Read from client: 16384 bytes read" |
| 2438 | |
| 2439 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 2440 | "$P_SRV" \ |
| 2441 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 2442 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 2443 | 0 \ |
| 2444 | -s "Read from client: 16384 bytes read" |
| 2445 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2446 | # Tests for DTLS HelloVerifyRequest |
| 2447 | |
| 2448 | run_test "DTLS cookie: enabled" \ |
| 2449 | "$P_SRV dtls=1 debug_level=2" \ |
| 2450 | "$P_CLI dtls=1 debug_level=2" \ |
| 2451 | 0 \ |
| 2452 | -s "cookie verification failed" \ |
| 2453 | -s "cookie verification passed" \ |
| 2454 | -S "cookie verification skipped" \ |
| 2455 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2456 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2457 | -S "SSL - The requested feature is not available" |
| 2458 | |
| 2459 | run_test "DTLS cookie: disabled" \ |
| 2460 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 2461 | "$P_CLI dtls=1 debug_level=2" \ |
| 2462 | 0 \ |
| 2463 | -S "cookie verification failed" \ |
| 2464 | -S "cookie verification passed" \ |
| 2465 | -s "cookie verification skipped" \ |
| 2466 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2467 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2468 | -S "SSL - The requested feature is not available" |
| 2469 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2470 | run_test "DTLS cookie: default (failing)" \ |
| 2471 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 2472 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 2473 | 1 \ |
| 2474 | -s "cookie verification failed" \ |
| 2475 | -S "cookie verification passed" \ |
| 2476 | -S "cookie verification skipped" \ |
| 2477 | -C "received hello verify request" \ |
| 2478 | -S "hello verification requested" \ |
| 2479 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2480 | |
| 2481 | requires_ipv6 |
| 2482 | run_test "DTLS cookie: enabled, IPv6" \ |
| 2483 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 2484 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 2485 | 0 \ |
| 2486 | -s "cookie verification failed" \ |
| 2487 | -s "cookie verification passed" \ |
| 2488 | -S "cookie verification skipped" \ |
| 2489 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2490 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2491 | -S "SSL - The requested feature is not available" |
| 2492 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2493 | run_test "DTLS cookie: enabled, nbio" \ |
| 2494 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 2495 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2496 | 0 \ |
| 2497 | -s "cookie verification failed" \ |
| 2498 | -s "cookie verification passed" \ |
| 2499 | -S "cookie verification skipped" \ |
| 2500 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 2501 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 2502 | -S "SSL - The requested feature is not available" |
| 2503 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 2504 | # Tests for various cases of client authentication with DTLS |
| 2505 | # (focused on handshake flows and message parsing) |
| 2506 | |
| 2507 | run_test "DTLS client auth: required" \ |
| 2508 | "$P_SRV dtls=1 auth_mode=required" \ |
| 2509 | "$P_CLI dtls=1" \ |
| 2510 | 0 \ |
| 2511 | -s "Verifying peer X.509 certificate... ok" |
| 2512 | |
| 2513 | run_test "DTLS client auth: optional, client has no cert" \ |
| 2514 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 2515 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 2516 | 0 \ |
| 2517 | -s "! no client certificate sent" |
| 2518 | |
| 2519 | run_test "DTLS client auth: optional, client has no cert" \ |
| 2520 | "$P_SRV dtls=1 auth_mode=none" \ |
| 2521 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 2522 | 0 \ |
| 2523 | -c "skip write certificate$" \ |
| 2524 | -s "! no client certificate sent" |
| 2525 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 2526 | # Tests for receiving fragmented handshake messages with DTLS |
| 2527 | |
| 2528 | requires_gnutls |
| 2529 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 2530 | "$G_SRV -u --mtu 2048 -a" \ |
| 2531 | "$P_CLI dtls=1 debug_level=2" \ |
| 2532 | 0 \ |
| 2533 | -C "found fragmented DTLS handshake message" \ |
| 2534 | -C "error" |
| 2535 | |
| 2536 | requires_gnutls |
| 2537 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 2538 | "$G_SRV -u --mtu 512" \ |
| 2539 | "$P_CLI dtls=1 debug_level=2" \ |
| 2540 | 0 \ |
| 2541 | -c "found fragmented DTLS handshake message" \ |
| 2542 | -C "error" |
| 2543 | |
| 2544 | requires_gnutls |
| 2545 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 2546 | "$G_SRV -u --mtu 128" \ |
| 2547 | "$P_CLI dtls=1 debug_level=2" \ |
| 2548 | 0 \ |
| 2549 | -c "found fragmented DTLS handshake message" \ |
| 2550 | -C "error" |
| 2551 | |
| 2552 | requires_gnutls |
| 2553 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 2554 | "$G_SRV -u --mtu 128" \ |
| 2555 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2556 | 0 \ |
| 2557 | -c "found fragmented DTLS handshake message" \ |
| 2558 | -C "error" |
| 2559 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2560 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2561 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 2562 | "$G_SRV -u --mtu 256" \ |
| 2563 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2564 | 0 \ |
| 2565 | -c "found fragmented DTLS handshake message" \ |
| 2566 | -c "client hello, adding renegotiation extension" \ |
| 2567 | -c "found renegotiation extension" \ |
| 2568 | -c "=> renegotiate" \ |
| 2569 | -C "ssl_handshake returned" \ |
| 2570 | -C "error" \ |
| 2571 | -s "Extra-header:" |
| 2572 | |
| 2573 | requires_gnutls |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 2574 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 2575 | "$G_SRV -u --mtu 256" \ |
| 2576 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 2577 | 0 \ |
| 2578 | -c "found fragmented DTLS handshake message" \ |
| 2579 | -c "client hello, adding renegotiation extension" \ |
| 2580 | -c "found renegotiation extension" \ |
| 2581 | -c "=> renegotiate" \ |
| 2582 | -C "ssl_handshake returned" \ |
| 2583 | -C "error" \ |
| 2584 | -s "Extra-header:" |
| 2585 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2586 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 2587 | "$O_SRV -dtls1 -mtu 2048" \ |
| 2588 | "$P_CLI dtls=1 debug_level=2" \ |
| 2589 | 0 \ |
| 2590 | -C "found fragmented DTLS handshake message" \ |
| 2591 | -C "error" |
| 2592 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2593 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 2594 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2595 | "$P_CLI dtls=1 debug_level=2" \ |
| 2596 | 0 \ |
| 2597 | -c "found fragmented DTLS handshake message" \ |
| 2598 | -C "error" |
| 2599 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2600 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 2601 | "$O_SRV -dtls1 -mtu 256" \ |
| 2602 | "$P_CLI dtls=1 debug_level=2" \ |
| 2603 | 0 \ |
| 2604 | -c "found fragmented DTLS handshake message" \ |
| 2605 | -C "error" |
| 2606 | |
| 2607 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 2608 | "$O_SRV -dtls1 -mtu 256" \ |
| 2609 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 2610 | 0 \ |
| 2611 | -c "found fragmented DTLS handshake message" \ |
| 2612 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2613 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 2614 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2615 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2616 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2617 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2618 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2619 | "$P_SRV dtls=1 debug_level=2" \ |
| 2620 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2621 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2622 | -C "replayed record" \ |
| 2623 | -S "replayed record" \ |
| 2624 | -C "record from another epoch" \ |
| 2625 | -S "record from another epoch" \ |
| 2626 | -C "discarding invalid record" \ |
| 2627 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2628 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2629 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2630 | -c "HTTP/1.0 200 OK" |
| 2631 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2632 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 2633 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2634 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2635 | "$P_SRV dtls=1 debug_level=2" \ |
| 2636 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 2637 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 2638 | -c "replayed record" \ |
| 2639 | -s "replayed record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2640 | -c "discarding invalid record" \ |
| 2641 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2642 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 2643 | -s "Extra-header:" \ |
| 2644 | -c "HTTP/1.0 200 OK" |
| 2645 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2646 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 2647 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2648 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 2649 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2650 | 0 \ |
| 2651 | -c "replayed record" \ |
| 2652 | -S "replayed record" \ |
| 2653 | -c "discarding invalid record" \ |
| 2654 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 2655 | -c "resend" \ |
| 2656 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 2657 | -s "Extra-header:" \ |
| 2658 | -c "HTTP/1.0 200 OK" |
| 2659 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2660 | 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] | 2661 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2662 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2663 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2664 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2665 | -c "discarding invalid record (mac)" \ |
| 2666 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2667 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2668 | -c "HTTP/1.0 200 OK" \ |
| 2669 | -S "too many records with bad MAC" \ |
| 2670 | -S "Verification of the message MAC failed" |
| 2671 | |
| 2672 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 2673 | -p "$P_PXY bad_ad=1" \ |
| 2674 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 2675 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 2676 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2677 | -C "discarding invalid record (mac)" \ |
| 2678 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2679 | -S "Extra-header:" \ |
| 2680 | -C "HTTP/1.0 200 OK" \ |
| 2681 | -s "too many records with bad MAC" \ |
| 2682 | -s "Verification of the message MAC failed" |
| 2683 | |
| 2684 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 2685 | -p "$P_PXY bad_ad=1" \ |
| 2686 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 2687 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 2688 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2689 | -c "discarding invalid record (mac)" \ |
| 2690 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2691 | -s "Extra-header:" \ |
| 2692 | -c "HTTP/1.0 200 OK" \ |
| 2693 | -S "too many records with bad MAC" \ |
| 2694 | -S "Verification of the message MAC failed" |
| 2695 | |
| 2696 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 2697 | -p "$P_PXY bad_ad=1" \ |
| 2698 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 2699 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 2700 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 2701 | -c "discarding invalid record (mac)" \ |
| 2702 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 2703 | -s "Extra-header:" \ |
| 2704 | -c "HTTP/1.0 200 OK" \ |
| 2705 | -s "too many records with bad MAC" \ |
| 2706 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2707 | |
| 2708 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2709 | -p "$P_PXY delay_ccs=1" \ |
| 2710 | "$P_SRV dtls=1 debug_level=1" \ |
| 2711 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2712 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2713 | -c "record from another epoch" \ |
| 2714 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2715 | -c "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 2716 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2717 | -s "Extra-header:" \ |
| 2718 | -c "HTTP/1.0 200 OK" |
| 2719 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 2720 | # 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] | 2721 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2722 | needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2723 | 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] | 2724 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2725 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2726 | psk=abc123" \ |
| 2727 | "$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] | 2728 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2729 | 0 \ |
| 2730 | -s "Extra-header:" \ |
| 2731 | -c "HTTP/1.0 200 OK" |
| 2732 | |
| 2733 | needs_more_time 2 |
| 2734 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 2735 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2736 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 2737 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2738 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2739 | 0 \ |
| 2740 | -s "Extra-header:" \ |
| 2741 | -c "HTTP/1.0 200 OK" |
| 2742 | |
| 2743 | needs_more_time 2 |
| 2744 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 2745 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2746 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 2747 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2748 | 0 \ |
| 2749 | -s "Extra-header:" \ |
| 2750 | -c "HTTP/1.0 200 OK" |
| 2751 | |
| 2752 | needs_more_time 2 |
| 2753 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 2754 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2755 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 2756 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2757 | 0 \ |
| 2758 | -s "Extra-header:" \ |
| 2759 | -c "HTTP/1.0 200 OK" |
| 2760 | |
| 2761 | needs_more_time 2 |
| 2762 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 2763 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2764 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 2765 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 2766 | 0 \ |
| 2767 | -s "Extra-header:" \ |
| 2768 | -c "HTTP/1.0 200 OK" |
| 2769 | |
| 2770 | needs_more_time 2 |
| 2771 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 2772 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2773 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 2774 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 2775 | 0 \ |
| 2776 | -s "Extra-header:" \ |
| 2777 | -c "HTTP/1.0 200 OK" |
| 2778 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2779 | needs_more_time 2 |
| 2780 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 2781 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2782 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 2783 | auth_mode=required" \ |
| 2784 | "$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] | 2785 | 0 \ |
| 2786 | -s "Extra-header:" \ |
| 2787 | -c "HTTP/1.0 200 OK" |
| 2788 | |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 2789 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 2790 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 2791 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 2792 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2793 | psk=abc123 debug_level=3" \ |
| 2794 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 2795 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 2796 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2797 | 0 \ |
| 2798 | -s "a session has been resumed" \ |
| 2799 | -c "a session has been resumed" \ |
| 2800 | -s "Extra-header:" \ |
| 2801 | -c "HTTP/1.0 200 OK" |
| 2802 | |
| 2803 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 2804 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 2805 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 2806 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2807 | psk=abc123 debug_level=3 nbio=2" \ |
| 2808 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 2809 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 2810 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 2811 | 0 \ |
| 2812 | -s "a session has been resumed" \ |
| 2813 | -c "a session has been resumed" \ |
| 2814 | -s "Extra-header:" \ |
| 2815 | -c "HTTP/1.0 200 OK" |
| 2816 | |
| 2817 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2818 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 2819 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2820 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2821 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 2822 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 2823 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 2824 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2825 | 0 \ |
| 2826 | -c "=> renegotiate" \ |
| 2827 | -s "=> renegotiate" \ |
| 2828 | -s "Extra-header:" \ |
| 2829 | -c "HTTP/1.0 200 OK" |
| 2830 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2831 | needs_more_time 4 |
| 2832 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 2833 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 2834 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 2835 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 2836 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 2837 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2838 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2839 | 0 \ |
| 2840 | -c "=> renegotiate" \ |
| 2841 | -s "=> renegotiate" \ |
| 2842 | -s "Extra-header:" \ |
| 2843 | -c "HTTP/1.0 200 OK" |
| 2844 | |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2845 | needs_more_time 4 |
| 2846 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 2847 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2848 | "$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] | 2849 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2850 | debug_level=2" \ |
| 2851 | "$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] | 2852 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2853 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2854 | 0 \ |
| 2855 | -c "=> renegotiate" \ |
| 2856 | -s "=> renegotiate" \ |
| 2857 | -s "Extra-header:" \ |
| 2858 | -c "HTTP/1.0 200 OK" |
| 2859 | |
| 2860 | needs_more_time 4 |
| 2861 | 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] | 2862 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2863 | "$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] | 2864 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2865 | debug_level=2 nbio=2" \ |
| 2866 | "$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] | 2867 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 2868 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 2869 | 0 \ |
| 2870 | -c "=> renegotiate" \ |
| 2871 | -s "=> renegotiate" \ |
| 2872 | -s "Extra-header:" \ |
| 2873 | -c "HTTP/1.0 200 OK" |
| 2874 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2875 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2876 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 2877 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 2878 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2879 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 2880 | 0 \ |
| 2881 | -s "Extra-header:" \ |
| 2882 | -c "HTTP/1.0 200 OK" |
| 2883 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2884 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2885 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 2886 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 2887 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2888 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2889 | 0 \ |
| 2890 | -s "Extra-header:" \ |
| 2891 | -c "HTTP/1.0 200 OK" |
| 2892 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2893 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2894 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 2895 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 2896 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2897 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2898 | 0 \ |
| 2899 | -s "Extra-header:" \ |
| 2900 | -c "HTTP/1.0 200 OK" |
| 2901 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2902 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2903 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 2904 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 2905 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2906 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2907 | 0 \ |
| 2908 | -s "Extra-header:" \ |
| 2909 | -c "Extra-header:" |
| 2910 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2911 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2912 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 2913 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 2914 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2915 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 2916 | 0 \ |
| 2917 | -s "Extra-header:" \ |
| 2918 | -c "Extra-header:" |
| 2919 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 2920 | needs_more_time 6 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2921 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 2922 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 2923 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 2924 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 2925 | 0 \ |
| 2926 | -s "Extra-header:" \ |
| 2927 | -c "Extra-header:" |
| 2928 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2929 | # Final report |
| 2930 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2931 | echo "------------------------------------------------------------------------" |
| 2932 | |
| 2933 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2934 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2935 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 2936 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2937 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 2938 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2939 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2940 | |
| 2941 | exit $FAILS |