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 | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 858 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 859 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 860 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 861 | 0 \ |
| 862 | -c "client hello, adding renegotiation extension" \ |
| 863 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 864 | -s "found renegotiation extension" \ |
| 865 | -s "server hello, secure renegotiation extension" \ |
| 866 | -c "found renegotiation extension" \ |
| 867 | -c "=> renegotiate" \ |
| 868 | -s "=> renegotiate" \ |
| 869 | -S "write hello request" |
| 870 | |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 871 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 872 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 873 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 874 | 0 \ |
| 875 | -c "client hello, adding renegotiation extension" \ |
| 876 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 877 | -s "found renegotiation extension" \ |
| 878 | -s "server hello, secure renegotiation extension" \ |
| 879 | -c "found renegotiation extension" \ |
| 880 | -c "=> renegotiate" \ |
| 881 | -s "=> renegotiate" \ |
| 882 | -s "write hello request" |
| 883 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 884 | # Tests for auth_mode |
| 885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 886 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 887 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 888 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 889 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 890 | 1 \ |
| 891 | -c "x509_verify_cert() returned" \ |
| 892 | -c "! self-signed or not signed by a trusted CA" \ |
| 893 | -c "! ssl_handshake returned" \ |
| 894 | -c "X509 - Certificate verification failed" |
| 895 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 896 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 897 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 898 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 899 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 900 | 0 \ |
| 901 | -c "x509_verify_cert() returned" \ |
| 902 | -c "! self-signed or not signed by a trusted CA" \ |
| 903 | -C "! ssl_handshake returned" \ |
| 904 | -C "X509 - Certificate verification failed" |
| 905 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 906 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 907 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 908 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 909 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 910 | 0 \ |
| 911 | -C "x509_verify_cert() returned" \ |
| 912 | -C "! self-signed or not signed by a trusted CA" \ |
| 913 | -C "! ssl_handshake returned" \ |
| 914 | -C "X509 - Certificate verification failed" |
| 915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 916 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 917 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 918 | "$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] | 919 | key_file=data_files/server5.key" \ |
| 920 | 1 \ |
| 921 | -S "skip write certificate request" \ |
| 922 | -C "skip parse certificate request" \ |
| 923 | -c "got a certificate request" \ |
| 924 | -C "skip write certificate" \ |
| 925 | -C "skip write certificate verify" \ |
| 926 | -S "skip parse certificate verify" \ |
| 927 | -s "x509_verify_cert() returned" \ |
| 928 | -S "! self-signed or not signed by a trusted CA" \ |
| 929 | -s "! ssl_handshake returned" \ |
| 930 | -c "! ssl_handshake returned" \ |
| 931 | -s "X509 - Certificate verification failed" |
| 932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 933 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 934 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 935 | "$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] | 936 | key_file=data_files/server5.key" \ |
| 937 | 0 \ |
| 938 | -S "skip write certificate request" \ |
| 939 | -C "skip parse certificate request" \ |
| 940 | -c "got a certificate request" \ |
| 941 | -C "skip write certificate" \ |
| 942 | -C "skip write certificate verify" \ |
| 943 | -S "skip parse certificate verify" \ |
| 944 | -s "x509_verify_cert() returned" \ |
| 945 | -s "! self-signed or not signed by a trusted CA" \ |
| 946 | -S "! ssl_handshake returned" \ |
| 947 | -C "! ssl_handshake returned" \ |
| 948 | -S "X509 - Certificate verification failed" |
| 949 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 950 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 951 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 952 | "$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] | 953 | key_file=data_files/server5.key" \ |
| 954 | 0 \ |
| 955 | -s "skip write certificate request" \ |
| 956 | -C "skip parse certificate request" \ |
| 957 | -c "got no certificate request" \ |
| 958 | -c "skip write certificate" \ |
| 959 | -c "skip write certificate verify" \ |
| 960 | -s "skip parse certificate verify" \ |
| 961 | -S "x509_verify_cert() returned" \ |
| 962 | -S "! self-signed or not signed by a trusted CA" \ |
| 963 | -S "! ssl_handshake returned" \ |
| 964 | -C "! ssl_handshake returned" \ |
| 965 | -S "X509 - Certificate verification failed" |
| 966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 967 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 968 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 969 | "$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] | 970 | 0 \ |
| 971 | -S "skip write certificate request" \ |
| 972 | -C "skip parse certificate request" \ |
| 973 | -c "got a certificate request" \ |
| 974 | -C "skip write certificate$" \ |
| 975 | -C "got no certificate to send" \ |
| 976 | -S "SSLv3 client has no certificate" \ |
| 977 | -c "skip write certificate verify" \ |
| 978 | -s "skip parse certificate verify" \ |
| 979 | -s "! no client certificate sent" \ |
| 980 | -S "! ssl_handshake returned" \ |
| 981 | -C "! ssl_handshake returned" \ |
| 982 | -S "X509 - Certificate verification failed" |
| 983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 984 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 985 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 986 | "$O_CLI" \ |
| 987 | 0 \ |
| 988 | -S "skip write certificate request" \ |
| 989 | -s "skip parse certificate verify" \ |
| 990 | -s "! no client certificate sent" \ |
| 991 | -S "! ssl_handshake returned" \ |
| 992 | -S "X509 - Certificate verification failed" |
| 993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 994 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 995 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 996 | "$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] | 997 | 0 \ |
| 998 | -C "skip parse certificate request" \ |
| 999 | -c "got a certificate request" \ |
| 1000 | -C "skip write certificate$" \ |
| 1001 | -c "skip write certificate verify" \ |
| 1002 | -C "! ssl_handshake returned" |
| 1003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1004 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1005 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
| 1006 | "$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] | 1007 | 0 \ |
| 1008 | -S "skip write certificate request" \ |
| 1009 | -C "skip parse certificate request" \ |
| 1010 | -c "got a certificate request" \ |
| 1011 | -C "skip write certificate$" \ |
| 1012 | -c "skip write certificate verify" \ |
| 1013 | -c "got no certificate to send" \ |
| 1014 | -s "SSLv3 client has no certificate" \ |
| 1015 | -s "skip parse certificate verify" \ |
| 1016 | -s "! no client certificate sent" \ |
| 1017 | -S "! ssl_handshake returned" \ |
| 1018 | -C "! ssl_handshake returned" \ |
| 1019 | -S "X509 - Certificate verification failed" |
| 1020 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1021 | # tests for SNI |
| 1022 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1023 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1024 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1025 | 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] | 1026 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1027 | 0 \ |
| 1028 | -S "parse ServerName extension" \ |
| 1029 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 1030 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1032 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1033 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1034 | 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] | 1035 | 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] | 1036 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1037 | 0 \ |
| 1038 | -s "parse ServerName extension" \ |
| 1039 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 1040 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 1041 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1042 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1043 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1044 | 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] | 1045 | 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] | 1046 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1047 | 0 \ |
| 1048 | -s "parse ServerName extension" \ |
| 1049 | -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] | 1050 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1052 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1053 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1054 | 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] | 1055 | 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] | 1056 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 1057 | 1 \ |
| 1058 | -s "parse ServerName extension" \ |
| 1059 | -s "ssl_sni_wrapper() returned" \ |
| 1060 | -s "ssl_handshake returned" \ |
| 1061 | -c "ssl_handshake returned" \ |
| 1062 | -c "SSL - A fatal alert message was received from our peer" |
| 1063 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1064 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 1065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1066 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1067 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1068 | "$P_CLI nbio=2 tickets=0" \ |
| 1069 | 0 \ |
| 1070 | -S "ssl_handshake returned" \ |
| 1071 | -C "ssl_handshake returned" \ |
| 1072 | -c "Read from server: .* bytes read" |
| 1073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1074 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1075 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 1076 | "$P_CLI nbio=2 tickets=0" \ |
| 1077 | 0 \ |
| 1078 | -S "ssl_handshake returned" \ |
| 1079 | -C "ssl_handshake returned" \ |
| 1080 | -c "Read from server: .* bytes read" |
| 1081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1082 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1083 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1084 | "$P_CLI nbio=2 tickets=1" \ |
| 1085 | 0 \ |
| 1086 | -S "ssl_handshake returned" \ |
| 1087 | -C "ssl_handshake returned" \ |
| 1088 | -c "Read from server: .* bytes read" |
| 1089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1090 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1091 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1092 | "$P_CLI nbio=2 tickets=1" \ |
| 1093 | 0 \ |
| 1094 | -S "ssl_handshake returned" \ |
| 1095 | -C "ssl_handshake returned" \ |
| 1096 | -c "Read from server: .* bytes read" |
| 1097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1098 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1099 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 1100 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1101 | 0 \ |
| 1102 | -S "ssl_handshake returned" \ |
| 1103 | -C "ssl_handshake returned" \ |
| 1104 | -c "Read from server: .* bytes read" |
| 1105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1106 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1107 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 1108 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 1109 | 0 \ |
| 1110 | -S "ssl_handshake returned" \ |
| 1111 | -C "ssl_handshake returned" \ |
| 1112 | -c "Read from server: .* bytes read" |
| 1113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1114 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 1115 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 1116 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 1117 | 0 \ |
| 1118 | -S "ssl_handshake returned" \ |
| 1119 | -C "ssl_handshake returned" \ |
| 1120 | -c "Read from server: .* bytes read" |
| 1121 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1122 | # Tests for version negotiation |
| 1123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1124 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1125 | "$P_SRV" \ |
| 1126 | "$P_CLI" \ |
| 1127 | 0 \ |
| 1128 | -S "ssl_handshake returned" \ |
| 1129 | -C "ssl_handshake returned" \ |
| 1130 | -s "Protocol is TLSv1.2" \ |
| 1131 | -c "Protocol is TLSv1.2" |
| 1132 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1133 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1134 | "$P_SRV" \ |
| 1135 | "$P_CLI max_version=tls1_1" \ |
| 1136 | 0 \ |
| 1137 | -S "ssl_handshake returned" \ |
| 1138 | -C "ssl_handshake returned" \ |
| 1139 | -s "Protocol is TLSv1.1" \ |
| 1140 | -c "Protocol is TLSv1.1" |
| 1141 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1142 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 1143 | "$P_SRV max_version=tls1_1" \ |
| 1144 | "$P_CLI" \ |
| 1145 | 0 \ |
| 1146 | -S "ssl_handshake returned" \ |
| 1147 | -C "ssl_handshake returned" \ |
| 1148 | -s "Protocol is TLSv1.1" \ |
| 1149 | -c "Protocol is TLSv1.1" |
| 1150 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1151 | 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] | 1152 | "$P_SRV max_version=tls1_1" \ |
| 1153 | "$P_CLI max_version=tls1_1" \ |
| 1154 | 0 \ |
| 1155 | -S "ssl_handshake returned" \ |
| 1156 | -C "ssl_handshake returned" \ |
| 1157 | -s "Protocol is TLSv1.1" \ |
| 1158 | -c "Protocol is TLSv1.1" |
| 1159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1160 | 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] | 1161 | "$P_SRV min_version=tls1_1" \ |
| 1162 | "$P_CLI max_version=tls1_1" \ |
| 1163 | 0 \ |
| 1164 | -S "ssl_handshake returned" \ |
| 1165 | -C "ssl_handshake returned" \ |
| 1166 | -s "Protocol is TLSv1.1" \ |
| 1167 | -c "Protocol is TLSv1.1" |
| 1168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1169 | 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] | 1170 | "$P_SRV max_version=tls1_1" \ |
| 1171 | "$P_CLI min_version=tls1_1" \ |
| 1172 | 0 \ |
| 1173 | -S "ssl_handshake returned" \ |
| 1174 | -C "ssl_handshake returned" \ |
| 1175 | -s "Protocol is TLSv1.1" \ |
| 1176 | -c "Protocol is TLSv1.1" |
| 1177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1178 | 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] | 1179 | "$P_SRV max_version=tls1_1" \ |
| 1180 | "$P_CLI min_version=tls1_2" \ |
| 1181 | 1 \ |
| 1182 | -s "ssl_handshake returned" \ |
| 1183 | -c "ssl_handshake returned" \ |
| 1184 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 1185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1186 | 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] | 1187 | "$P_SRV min_version=tls1_2" \ |
| 1188 | "$P_CLI max_version=tls1_1" \ |
| 1189 | 1 \ |
| 1190 | -s "ssl_handshake returned" \ |
| 1191 | -c "ssl_handshake returned" \ |
| 1192 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 1193 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1194 | # Tests for ALPN extension |
| 1195 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1196 | if grep '^#define POLARSSL_SSL_ALPN' $CONFIG_H >/dev/null; then |
| 1197 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1198 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1199 | "$P_SRV debug_level=3" \ |
| 1200 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1201 | 0 \ |
| 1202 | -C "client hello, adding alpn extension" \ |
| 1203 | -S "found alpn extension" \ |
| 1204 | -C "got an alert message, type: \\[2:120]" \ |
| 1205 | -S "server hello, adding alpn extension" \ |
| 1206 | -C "found alpn extension " \ |
| 1207 | -C "Application Layer Protocol is" \ |
| 1208 | -S "Application Layer Protocol is" |
| 1209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1210 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1211 | "$P_SRV debug_level=3" \ |
| 1212 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1213 | 0 \ |
| 1214 | -c "client hello, adding alpn extension" \ |
| 1215 | -s "found alpn extension" \ |
| 1216 | -C "got an alert message, type: \\[2:120]" \ |
| 1217 | -S "server hello, adding alpn extension" \ |
| 1218 | -C "found alpn extension " \ |
| 1219 | -c "Application Layer Protocol is (none)" \ |
| 1220 | -S "Application Layer Protocol is" |
| 1221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1222 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1223 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1224 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1225 | 0 \ |
| 1226 | -C "client hello, adding alpn extension" \ |
| 1227 | -S "found alpn extension" \ |
| 1228 | -C "got an alert message, type: \\[2:120]" \ |
| 1229 | -S "server hello, adding alpn extension" \ |
| 1230 | -C "found alpn extension " \ |
| 1231 | -C "Application Layer Protocol is" \ |
| 1232 | -s "Application Layer Protocol is (none)" |
| 1233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1234 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1235 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1236 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1237 | 0 \ |
| 1238 | -c "client hello, adding alpn extension" \ |
| 1239 | -s "found alpn extension" \ |
| 1240 | -C "got an alert message, type: \\[2:120]" \ |
| 1241 | -s "server hello, adding alpn extension" \ |
| 1242 | -c "found alpn extension" \ |
| 1243 | -c "Application Layer Protocol is abc" \ |
| 1244 | -s "Application Layer Protocol is abc" |
| 1245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1246 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1247 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1248 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1249 | 0 \ |
| 1250 | -c "client hello, adding alpn extension" \ |
| 1251 | -s "found alpn extension" \ |
| 1252 | -C "got an alert message, type: \\[2:120]" \ |
| 1253 | -s "server hello, adding alpn extension" \ |
| 1254 | -c "found alpn extension" \ |
| 1255 | -c "Application Layer Protocol is abc" \ |
| 1256 | -s "Application Layer Protocol is abc" |
| 1257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1258 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1259 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 1260 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1261 | 0 \ |
| 1262 | -c "client hello, adding alpn extension" \ |
| 1263 | -s "found alpn extension" \ |
| 1264 | -C "got an alert message, type: \\[2:120]" \ |
| 1265 | -s "server hello, adding alpn extension" \ |
| 1266 | -c "found alpn extension" \ |
| 1267 | -c "Application Layer Protocol is 1234" \ |
| 1268 | -s "Application Layer Protocol is 1234" |
| 1269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1270 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1271 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 1272 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 1273 | 1 \ |
| 1274 | -c "client hello, adding alpn extension" \ |
| 1275 | -s "found alpn extension" \ |
| 1276 | -c "got an alert message, type: \\[2:120]" \ |
| 1277 | -S "server hello, adding alpn extension" \ |
| 1278 | -C "found alpn extension" \ |
| 1279 | -C "Application Layer Protocol is 1234" \ |
| 1280 | -S "Application Layer Protocol is 1234" |
| 1281 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 1282 | fi |
| 1283 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1284 | # Tests for keyUsage in leaf certificates, part 1: |
| 1285 | # server-side certificate/suite selection |
| 1286 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1287 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1288 | "$P_SRV key_file=data_files/server2.key \ |
| 1289 | crt_file=data_files/server2.ku-ds.crt" \ |
| 1290 | "$P_CLI" \ |
| 1291 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 1292 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1293 | |
| 1294 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1295 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1296 | "$P_SRV key_file=data_files/server2.key \ |
| 1297 | crt_file=data_files/server2.ku-ke.crt" \ |
| 1298 | "$P_CLI" \ |
| 1299 | 0 \ |
| 1300 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 1301 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1302 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1303 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1304 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1305 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1306 | 1 \ |
| 1307 | -C "Ciphersuite is " |
| 1308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1309 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1310 | "$P_SRV key_file=data_files/server5.key \ |
| 1311 | crt_file=data_files/server5.ku-ds.crt" \ |
| 1312 | "$P_CLI" \ |
| 1313 | 0 \ |
| 1314 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 1315 | |
| 1316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1317 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1318 | "$P_SRV key_file=data_files/server5.key \ |
| 1319 | crt_file=data_files/server5.ku-ka.crt" \ |
| 1320 | "$P_CLI" \ |
| 1321 | 0 \ |
| 1322 | -c "Ciphersuite is TLS-ECDH-" |
| 1323 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1324 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1325 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1326 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 1327 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1328 | 1 \ |
| 1329 | -C "Ciphersuite is " |
| 1330 | |
| 1331 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1332 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1334 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1335 | "$O_SRV -key data_files/server2.key \ |
| 1336 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1337 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1338 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1339 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1340 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1341 | -C "Processing of the Certificate handshake message failed" \ |
| 1342 | -c "Ciphersuite is TLS-" |
| 1343 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1344 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1345 | "$O_SRV -key data_files/server2.key \ |
| 1346 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1347 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1348 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1349 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1350 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1351 | -C "Processing of the Certificate handshake message failed" \ |
| 1352 | -c "Ciphersuite is TLS-" |
| 1353 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1354 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1355 | "$O_SRV -key data_files/server2.key \ |
| 1356 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1357 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1358 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1359 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1360 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1361 | -C "Processing of the Certificate handshake message failed" \ |
| 1362 | -c "Ciphersuite is TLS-" |
| 1363 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1364 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1365 | "$O_SRV -key data_files/server2.key \ |
| 1366 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1367 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1368 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1369 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1370 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1371 | -c "Processing of the Certificate handshake message failed" \ |
| 1372 | -C "Ciphersuite is TLS-" |
| 1373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1374 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1375 | "$O_SRV -key data_files/server2.key \ |
| 1376 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1377 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1378 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1379 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1380 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1381 | -C "Processing of the Certificate handshake message failed" \ |
| 1382 | -c "Ciphersuite is TLS-" |
| 1383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1384 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1385 | "$O_SRV -key data_files/server2.key \ |
| 1386 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1387 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1388 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1389 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1390 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 1391 | -c "Processing of the Certificate handshake message failed" \ |
| 1392 | -C "Ciphersuite is TLS-" |
| 1393 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1394 | # Tests for keyUsage in leaf certificates, part 3: |
| 1395 | # server-side checking of client cert |
| 1396 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1397 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1398 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1399 | "$O_CLI -key data_files/server2.key \ |
| 1400 | -cert data_files/server2.ku-ds.crt" \ |
| 1401 | 0 \ |
| 1402 | -S "bad certificate (usage extensions)" \ |
| 1403 | -S "Processing of the Certificate handshake message failed" |
| 1404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1405 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1406 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1407 | "$O_CLI -key data_files/server2.key \ |
| 1408 | -cert data_files/server2.ku-ke.crt" \ |
| 1409 | 0 \ |
| 1410 | -s "bad certificate (usage extensions)" \ |
| 1411 | -S "Processing of the Certificate handshake message failed" |
| 1412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1413 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1414 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1415 | "$O_CLI -key data_files/server2.key \ |
| 1416 | -cert data_files/server2.ku-ke.crt" \ |
| 1417 | 1 \ |
| 1418 | -s "bad certificate (usage extensions)" \ |
| 1419 | -s "Processing of the Certificate handshake message failed" |
| 1420 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1421 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1422 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1423 | "$O_CLI -key data_files/server5.key \ |
| 1424 | -cert data_files/server5.ku-ds.crt" \ |
| 1425 | 0 \ |
| 1426 | -S "bad certificate (usage extensions)" \ |
| 1427 | -S "Processing of the Certificate handshake message failed" |
| 1428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1429 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1430 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 1431 | "$O_CLI -key data_files/server5.key \ |
| 1432 | -cert data_files/server5.ku-ka.crt" \ |
| 1433 | 0 \ |
| 1434 | -s "bad certificate (usage extensions)" \ |
| 1435 | -S "Processing of the Certificate handshake message failed" |
| 1436 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1437 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 1438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1439 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1440 | "$P_SRV key_file=data_files/server5.key \ |
| 1441 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1442 | "$P_CLI" \ |
| 1443 | 0 |
| 1444 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1445 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1446 | "$P_SRV key_file=data_files/server5.key \ |
| 1447 | crt_file=data_files/server5.eku-srv.crt" \ |
| 1448 | "$P_CLI" \ |
| 1449 | 0 |
| 1450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1451 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1452 | "$P_SRV key_file=data_files/server5.key \ |
| 1453 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 1454 | "$P_CLI" \ |
| 1455 | 0 |
| 1456 | |
| 1457 | # 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] | 1458 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1459 | "$P_SRV psk=abc123 key_file=data_files/server5.key \ |
| 1460 | crt_file=data_files/server5.eku-cli.crt" \ |
| 1461 | "$P_CLI psk=badbad" \ |
| 1462 | 1 |
| 1463 | |
| 1464 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 1465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1466 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1467 | "$O_SRV -key data_files/server5.key \ |
| 1468 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1469 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1470 | 0 \ |
| 1471 | -C "bad certificate (usage extensions)" \ |
| 1472 | -C "Processing of the Certificate handshake message failed" \ |
| 1473 | -c "Ciphersuite is TLS-" |
| 1474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1475 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1476 | "$O_SRV -key data_files/server5.key \ |
| 1477 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1478 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1479 | 0 \ |
| 1480 | -C "bad certificate (usage extensions)" \ |
| 1481 | -C "Processing of the Certificate handshake message failed" \ |
| 1482 | -c "Ciphersuite is TLS-" |
| 1483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1484 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1485 | "$O_SRV -key data_files/server5.key \ |
| 1486 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1487 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1488 | 0 \ |
| 1489 | -C "bad certificate (usage extensions)" \ |
| 1490 | -C "Processing of the Certificate handshake message failed" \ |
| 1491 | -c "Ciphersuite is TLS-" |
| 1492 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1493 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1494 | "$O_SRV -key data_files/server5.key \ |
| 1495 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1496 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1497 | 1 \ |
| 1498 | -c "bad certificate (usage extensions)" \ |
| 1499 | -c "Processing of the Certificate handshake message failed" \ |
| 1500 | -C "Ciphersuite is TLS-" |
| 1501 | |
| 1502 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 1503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1504 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1505 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1506 | "$O_CLI -key data_files/server5.key \ |
| 1507 | -cert data_files/server5.eku-cli.crt" \ |
| 1508 | 0 \ |
| 1509 | -S "bad certificate (usage extensions)" \ |
| 1510 | -S "Processing of the Certificate handshake message failed" |
| 1511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1512 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1513 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1514 | "$O_CLI -key data_files/server5.key \ |
| 1515 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 1516 | 0 \ |
| 1517 | -S "bad certificate (usage extensions)" \ |
| 1518 | -S "Processing of the Certificate handshake message failed" |
| 1519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1520 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1521 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1522 | "$O_CLI -key data_files/server5.key \ |
| 1523 | -cert data_files/server5.eku-cs_any.crt" \ |
| 1524 | 0 \ |
| 1525 | -S "bad certificate (usage extensions)" \ |
| 1526 | -S "Processing of the Certificate handshake message failed" |
| 1527 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1528 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1529 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1530 | "$O_CLI -key data_files/server5.key \ |
| 1531 | -cert data_files/server5.eku-cs.crt" \ |
| 1532 | 0 \ |
| 1533 | -s "bad certificate (usage extensions)" \ |
| 1534 | -S "Processing of the Certificate handshake message failed" |
| 1535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1536 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1537 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 1538 | "$O_CLI -key data_files/server5.key \ |
| 1539 | -cert data_files/server5.eku-cs.crt" \ |
| 1540 | 1 \ |
| 1541 | -s "bad certificate (usage extensions)" \ |
| 1542 | -s "Processing of the Certificate handshake message failed" |
| 1543 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1544 | # Tests for DHM parameters loading |
| 1545 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1546 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1547 | "$P_SRV" \ |
| 1548 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1549 | debug_level=3" \ |
| 1550 | 0 \ |
| 1551 | -c "value of 'DHM: P ' (2048 bits)" \ |
| 1552 | -c "value of 'DHM: G ' (2048 bits)" |
| 1553 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1554 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1555 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 1556 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1557 | debug_level=3" \ |
| 1558 | 0 \ |
| 1559 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 1560 | -c "value of 'DHM: G ' (2 bits)" |
| 1561 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1562 | # Tests for PSK callback |
| 1563 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1564 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1565 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 1566 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1567 | psk_identity=foo psk=abc123" \ |
| 1568 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1569 | -S "SSL - The server has no ciphersuites in common" \ |
| 1570 | -S "SSL - Unknown identity received" \ |
| 1571 | -S "SSL - Verification of the message MAC failed" |
| 1572 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1573 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1574 | "$P_SRV" \ |
| 1575 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1576 | psk_identity=foo psk=abc123" \ |
| 1577 | 1 \ |
| 1578 | -s "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1579 | -S "SSL - Unknown identity received" \ |
| 1580 | -S "SSL - Verification of the message MAC failed" |
| 1581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1582 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1583 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 1584 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1585 | psk_identity=foo psk=abc123" \ |
| 1586 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1587 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1588 | -s "SSL - Unknown identity received" \ |
| 1589 | -S "SSL - Verification of the message MAC failed" |
| 1590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1591 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1592 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1593 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1594 | psk_identity=abc psk=dead" \ |
| 1595 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1596 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1597 | -S "SSL - Unknown identity received" \ |
| 1598 | -S "SSL - Verification of the message MAC failed" |
| 1599 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1600 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1601 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1602 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1603 | psk_identity=def psk=beef" \ |
| 1604 | 0 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1605 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1606 | -S "SSL - Unknown identity received" \ |
| 1607 | -S "SSL - Verification of the message MAC failed" |
| 1608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1609 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1610 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1611 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1612 | psk_identity=ghi psk=beef" \ |
| 1613 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1614 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1615 | -s "SSL - Unknown identity received" \ |
| 1616 | -S "SSL - Verification of the message MAC failed" |
| 1617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1618 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1619 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 1620 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 1621 | psk_identity=abc psk=beef" \ |
| 1622 | 1 \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 1623 | -S "SSL - The server has no ciphersuites in common" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 1624 | -S "SSL - Unknown identity received" \ |
| 1625 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 1626 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1627 | # Tests for ciphersuites per version |
| 1628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1629 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1630 | "$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" \ |
| 1631 | "$P_CLI force_version=ssl3" \ |
| 1632 | 0 \ |
| 1633 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 1634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1635 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1636 | "$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" \ |
| 1637 | "$P_CLI force_version=tls1" \ |
| 1638 | 0 \ |
| 1639 | -c "Ciphersuite is TLS-RSA-WITH-RC4-128-SHA" |
| 1640 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1641 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1642 | "$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" \ |
| 1643 | "$P_CLI force_version=tls1_1" \ |
| 1644 | 0 \ |
| 1645 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 1646 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1647 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1648 | "$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" \ |
| 1649 | "$P_CLI force_version=tls1_2" \ |
| 1650 | 0 \ |
| 1651 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 1652 | |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1653 | # Tests for ssl_get_bytes_avail() |
| 1654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1655 | run_test "ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1656 | "$P_SRV" \ |
| 1657 | "$P_CLI request_size=100" \ |
| 1658 | 0 \ |
| 1659 | -s "Read from client: 100 bytes read$" |
| 1660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1661 | run_test "ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 1662 | "$P_SRV" \ |
| 1663 | "$P_CLI request_size=500" \ |
| 1664 | 0 \ |
| 1665 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 1666 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 1667 | # Tests for small packets |
| 1668 | |
| 1669 | run_test "Small packet SSLv3 BlockCipher" \ |
| 1670 | "$P_SRV" \ |
| 1671 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1673 | 0 \ |
| 1674 | -s "Read from client: 1 bytes read" |
| 1675 | |
| 1676 | run_test "Small packet SSLv3 StreamCipher" \ |
| 1677 | "$P_SRV" \ |
| 1678 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 1679 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1680 | 0 \ |
| 1681 | -s "Read from client: 1 bytes read" |
| 1682 | |
| 1683 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 1684 | "$P_SRV" \ |
| 1685 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1686 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1687 | 0 \ |
| 1688 | -s "Read from client: 1 bytes read" |
| 1689 | |
| 1690 | run_test "Small packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1691 | "$P_SRV" \ |
| 1692 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1693 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1694 | trunc_hmac=1" \ |
| 1695 | 0 \ |
| 1696 | -s "Read from client: 1 bytes read" |
| 1697 | |
| 1698 | run_test "Small packet TLS 1.0 StreamCipher truncated MAC" \ |
| 1699 | "$P_SRV" \ |
| 1700 | "$P_CLI request_size=1 force_version=tls1 \ |
| 1701 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1702 | trunc_hmac=1" \ |
| 1703 | 0 \ |
| 1704 | -s "Read from client: 1 bytes read" |
| 1705 | |
| 1706 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 1707 | "$P_SRV" \ |
| 1708 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1709 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1710 | 0 \ |
| 1711 | -s "Read from client: 1 bytes read" |
| 1712 | |
| 1713 | run_test "Small packet TLS 1.1 StreamCipher" \ |
| 1714 | "$P_SRV" \ |
| 1715 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1716 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1717 | 0 \ |
| 1718 | -s "Read from client: 1 bytes read" |
| 1719 | |
| 1720 | run_test "Small packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1721 | "$P_SRV" \ |
| 1722 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1723 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1724 | trunc_hmac=1" \ |
| 1725 | 0 \ |
| 1726 | -s "Read from client: 1 bytes read" |
| 1727 | |
| 1728 | run_test "Small packet TLS 1.1 StreamCipher truncated MAC" \ |
| 1729 | "$P_SRV" \ |
| 1730 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 1731 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1732 | trunc_hmac=1" \ |
| 1733 | 0 \ |
| 1734 | -s "Read from client: 1 bytes read" |
| 1735 | |
| 1736 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 1737 | "$P_SRV" \ |
| 1738 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1739 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1740 | 0 \ |
| 1741 | -s "Read from client: 1 bytes read" |
| 1742 | |
| 1743 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 1744 | "$P_SRV" \ |
| 1745 | "$P_CLI request_size=1 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1746 | 0 \ |
| 1747 | -s "Read from client: 1 bytes read" |
| 1748 | |
| 1749 | run_test "Small packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1750 | "$P_SRV" \ |
| 1751 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1752 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1753 | trunc_hmac=1" \ |
| 1754 | 0 \ |
| 1755 | -s "Read from client: 1 bytes read" |
| 1756 | |
| 1757 | run_test "Small packet TLS 1.2 StreamCipher" \ |
| 1758 | "$P_SRV" \ |
| 1759 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1760 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1761 | 0 \ |
| 1762 | -s "Read from client: 1 bytes read" |
| 1763 | |
| 1764 | run_test "Small packet TLS 1.2 StreamCipher truncated MAC" \ |
| 1765 | "$P_SRV" \ |
| 1766 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1767 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1768 | trunc_hmac=1" \ |
| 1769 | 0 \ |
| 1770 | -s "Read from client: 1 bytes read" |
| 1771 | |
| 1772 | run_test "Small packet TLS 1.2 AEAD" \ |
| 1773 | "$P_SRV" \ |
| 1774 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1775 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1776 | 0 \ |
| 1777 | -s "Read from client: 1 bytes read" |
| 1778 | |
| 1779 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 1780 | "$P_SRV" \ |
| 1781 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 1782 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1783 | 0 \ |
| 1784 | -s "Read from client: 1 bytes read" |
| 1785 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 1786 | # Test for large packets |
| 1787 | |
| 1788 | run_test "Large packet SSLv3 BlockCipher" \ |
| 1789 | "$P_SRV" \ |
| 1790 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1792 | 0 \ |
| 1793 | -s "Read from client: 16384 bytes read" |
| 1794 | |
| 1795 | run_test "Large packet SSLv3 StreamCipher" \ |
| 1796 | "$P_SRV" \ |
| 1797 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 1798 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1799 | 0 \ |
| 1800 | -s "Read from client: 16384 bytes read" |
| 1801 | |
| 1802 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 1803 | "$P_SRV" \ |
| 1804 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1805 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1806 | 0 \ |
| 1807 | -s "Read from client: 16384 bytes read" |
| 1808 | |
| 1809 | run_test "Large packet TLS 1.0 BlockCipher truncated MAC" \ |
| 1810 | "$P_SRV" \ |
| 1811 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1812 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1813 | trunc_hmac=1" \ |
| 1814 | 0 \ |
| 1815 | -s "Read from client: 16384 bytes read" |
| 1816 | |
| 1817 | run_test "Large packet TLS 1.0 StreamCipher truncated MAC" \ |
| 1818 | "$P_SRV" \ |
| 1819 | "$P_CLI request_size=16384 force_version=tls1 \ |
| 1820 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1821 | trunc_hmac=1" \ |
| 1822 | 0 \ |
| 1823 | -s "Read from client: 16384 bytes read" |
| 1824 | |
| 1825 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 1826 | "$P_SRV" \ |
| 1827 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1828 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1829 | 0 \ |
| 1830 | -s "Read from client: 16384 bytes read" |
| 1831 | |
| 1832 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 1833 | "$P_SRV" \ |
| 1834 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1835 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1836 | 0 \ |
| 1837 | -s "Read from client: 16384 bytes read" |
| 1838 | |
| 1839 | run_test "Large packet TLS 1.1 BlockCipher truncated MAC" \ |
| 1840 | "$P_SRV" \ |
| 1841 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1842 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1843 | trunc_hmac=1" \ |
| 1844 | 0 \ |
| 1845 | -s "Read from client: 16384 bytes read" |
| 1846 | |
| 1847 | run_test "Large packet TLS 1.1 StreamCipher truncated MAC" \ |
| 1848 | "$P_SRV" \ |
| 1849 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 1850 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1851 | trunc_hmac=1" \ |
| 1852 | 0 \ |
| 1853 | -s "Read from client: 16384 bytes read" |
| 1854 | |
| 1855 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 1856 | "$P_SRV" \ |
| 1857 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1858 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 1859 | 0 \ |
| 1860 | -s "Read from client: 16384 bytes read" |
| 1861 | |
| 1862 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 1863 | "$P_SRV" \ |
| 1864 | "$P_CLI request_size=16384 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 1865 | 0 \ |
| 1866 | -s "Read from client: 16384 bytes read" |
| 1867 | |
| 1868 | run_test "Large packet TLS 1.2 BlockCipher truncated MAC" \ |
| 1869 | "$P_SRV" \ |
| 1870 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 1872 | trunc_hmac=1" \ |
| 1873 | 0 \ |
| 1874 | -s "Read from client: 16384 bytes read" |
| 1875 | |
| 1876 | run_test "Large packet TLS 1.2 StreamCipher" \ |
| 1877 | "$P_SRV" \ |
| 1878 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1879 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1880 | 0 \ |
| 1881 | -s "Read from client: 16384 bytes read" |
| 1882 | |
| 1883 | run_test "Large packet TLS 1.2 StreamCipher truncated MAC" \ |
| 1884 | "$P_SRV" \ |
| 1885 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1886 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1887 | trunc_hmac=1" \ |
| 1888 | 0 \ |
| 1889 | -s "Read from client: 16384 bytes read" |
| 1890 | |
| 1891 | run_test "Large packet TLS 1.2 AEAD" \ |
| 1892 | "$P_SRV" \ |
| 1893 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 1895 | 0 \ |
| 1896 | -s "Read from client: 16384 bytes read" |
| 1897 | |
| 1898 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 1899 | "$P_SRV" \ |
| 1900 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 1901 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 1902 | 0 \ |
| 1903 | -s "Read from client: 16384 bytes read" |
| 1904 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1905 | # Tests for DTLS HelloVerifyRequest |
| 1906 | |
| 1907 | run_test "DTLS cookie: enabled" \ |
| 1908 | "$P_SRV dtls=1 debug_level=2" \ |
| 1909 | "$P_CLI dtls=1 debug_level=2" \ |
| 1910 | 0 \ |
| 1911 | -s "cookie verification failed" \ |
| 1912 | -s "cookie verification passed" \ |
| 1913 | -S "cookie verification skipped" \ |
| 1914 | -c "received hello verify request" \ |
| 1915 | -S "SSL - The requested feature is not available" |
| 1916 | |
| 1917 | run_test "DTLS cookie: disabled" \ |
| 1918 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 1919 | "$P_CLI dtls=1 debug_level=2" \ |
| 1920 | 0 \ |
| 1921 | -S "cookie verification failed" \ |
| 1922 | -S "cookie verification passed" \ |
| 1923 | -s "cookie verification skipped" \ |
| 1924 | -C "received hello verify request" \ |
| 1925 | -S "SSL - The requested feature is not available" |
| 1926 | |
| 1927 | # wait for client having a timeout, or server sending an alert |
| 1928 | #run_test "DTLS cookie: default (failing)" \ |
| 1929 | # "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 1930 | # "$P_CLI dtls=1 debug_level=2" \ |
| 1931 | # 0 \ |
| 1932 | # -S "cookie verification failed" \ |
| 1933 | # -S "cookie verification passed" \ |
| 1934 | # -S "cookie verification skipped" \ |
| 1935 | # -C "received hello verify request" \ |
| 1936 | # -s "SSL - The requested feature is not available" |
| 1937 | |
| 1938 | requires_ipv6 |
| 1939 | run_test "DTLS cookie: enabled, IPv6" \ |
| 1940 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 1941 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 1942 | 0 \ |
| 1943 | -s "cookie verification failed" \ |
| 1944 | -s "cookie verification passed" \ |
| 1945 | -S "cookie verification skipped" \ |
| 1946 | -c "received hello verify request" \ |
| 1947 | -S "SSL - The requested feature is not available" |
| 1948 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame^] | 1949 | # Tests for receiving fragmented handshake messages with DTLS |
| 1950 | |
| 1951 | requires_gnutls |
| 1952 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 1953 | "$G_SRV -u --mtu 2048 -a" \ |
| 1954 | "$P_CLI dtls=1 debug_level=2" \ |
| 1955 | 0 \ |
| 1956 | -C "found fragmented DTLS handshake message" \ |
| 1957 | -C "error" |
| 1958 | |
| 1959 | requires_gnutls |
| 1960 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 1961 | "$G_SRV -u --mtu 512" \ |
| 1962 | "$P_CLI dtls=1 debug_level=2" \ |
| 1963 | 0 \ |
| 1964 | -c "found fragmented DTLS handshake message" \ |
| 1965 | -C "error" |
| 1966 | |
| 1967 | requires_gnutls |
| 1968 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 1969 | "$G_SRV -u --mtu 128" \ |
| 1970 | "$P_CLI dtls=1 debug_level=2" \ |
| 1971 | 0 \ |
| 1972 | -c "found fragmented DTLS handshake message" \ |
| 1973 | -C "error" |
| 1974 | |
| 1975 | requires_gnutls |
| 1976 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 1977 | "$G_SRV -u --mtu 128" \ |
| 1978 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 1979 | 0 \ |
| 1980 | -c "found fragmented DTLS handshake message" \ |
| 1981 | -C "error" |
| 1982 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1983 | # Final report |
| 1984 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1985 | echo "------------------------------------------------------------------------" |
| 1986 | |
| 1987 | if [ $FAILS = 0 ]; then |
| 1988 | echo -n "PASSED" |
| 1989 | else |
| 1990 | echo -n "FAILED" |
| 1991 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1992 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1993 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1994 | |
| 1995 | exit $FAILS |