Add basic tests for session resumption

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-20 11:43:46 +01:00
parent eaadc508fb
commit f7c52014ec
2 changed files with 30 additions and 3 deletions

View File

@ -1690,6 +1690,7 @@ static int ssl_write_server_hello( ssl_context *ssl )
ssl->f_get_cache != NULL && ssl->f_get_cache != NULL &&
ssl->f_get_cache( ssl->p_get_cache, ssl->session_negotiate ) == 0 ) ssl->f_get_cache( ssl->p_get_cache, ssl->session_negotiate ) == 0 )
{ {
SSL_DEBUG_MSG( 3, ( "session successfully restored from cache" ) );
ssl->handshake->resume = 1; ssl->handshake->resume = 1;
} }

View File

@ -86,7 +86,33 @@ killall -q openssl ssl_server ssl_server2
run_test "Truncated HMAC" \ run_test "Truncated HMAC" \
"debug_level=5" \ "debug_level=5" \
"debug_level=5 trunc_hmac=1 \ "trunc_hmac=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
0 \ 0 \
-s "dumping 'computed mac' (10 bytes)$" -s "dumping 'computed mac' (10 bytes)"
run_test "Session resume using tickets" \
"debug_level=4 tickets=1" \
"debug_level=4 reconnect=1 tickets=1" \
0 \
-S "session successfully restored from cache" \
-s "session successfully restored from ticket" \
-s "a session has been resumed" \
-c "a session has been resumed"
run_test "Session resume using cache #1" \
"debug_level=4 tickets=0" \
"debug_level=4 reconnect=1 tickets=1" \
0 \
-s "session successfully restored from cache" \
-S "session successfully restored from ticket" \
-s "a session has been resumed" \
-c "a session has been resumed"
run_test "Session resume using cache #2" \
"debug_level=4 tickets=1" \
"debug_level=4 reconnect=1 tickets=0" \
0 \
-s "session successfully restored from cache" \
-S "session successfully restored from ticket" \
-s "a session has been resumed" \
-c "a session has been resumed"