summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-06-06 17:19:32 +0100
committerMatt Caswell <matt@openssl.org>2017-06-16 10:57:59 +0100
commit0de6d66d36dc5f6d46247c63da71b73d7e8e018c (patch)
treed92e55f710efb5c43ade2b2c7bdcf03317e9dccb /test
parentca0413ae14f8fc9cc840b8acaadd150ea290285f (diff)
Move ciphersuite selection before session resumption in TLSv1.3
This does things as per the recommendation in the TLSv1.3 spec. It also means that the server will always choose its preferred ciphersuite. Previously the server would only select ciphersuites compatible with the session. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3623)
Diffstat (limited to 'test')
-rw-r--r--test/sslapitest.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 6162625d06..13ba727c5d 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -1850,16 +1850,15 @@ static int test_ciphersuite_change(void)
/*
* Check attempting to resume a SHA-256 session with no SHA-256 ciphersuites
- * fails.
+ * succeeds but does not resume.
*/
if (!TEST_true(SSL_CTX_set_cipher_list(cctx, "TLS13-AES-256-GCM-SHA384"))
|| !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
NULL, NULL))
|| !TEST_true(SSL_set_session(clientssl, clntsess))
- || !TEST_false(create_ssl_connection(serverssl, clientssl,
+ || !TEST_true(create_ssl_connection(serverssl, clientssl,
SSL_ERROR_SSL))
- || !TEST_int_eq(ERR_GET_REASON(ERR_get_error()),
- SSL_R_NO_SHARED_CIPHER))
+ || !TEST_false(SSL_session_reused(clientssl)))
goto end;
SSL_SESSION_free(clntsess);
@@ -1887,6 +1886,8 @@ static int test_ciphersuite_change(void)
if (!TEST_true(SSL_CTX_set_cipher_list(cctx,
"TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384"))
+ || !TEST_true(SSL_CTX_set_cipher_list(sctx,
+ "TLS13-AES-256-GCM-SHA384"))
|| !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
NULL, NULL))
|| !TEST_true(SSL_set_session(clientssl, clntsess))