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