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