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