summaryrefslogtreecommitdiff
path: root/test/tls13ccstest.c
diff options
context:
space:
mode:
authorBenjamin Kaduk <bkaduk@akamai.com>2018-02-28 14:49:59 -0600
committerBenjamin Kaduk <kaduk@mit.edu>2018-02-28 21:47:09 -0600
commitc39e4048b538ec76313c264e860cfb5cd677a9ac (patch)
tree015f67d475a23ee0ec42c4fa8f18c37171bf65dd /test/tls13ccstest.c
parentd91f45688c2d0bfcc5b3b57fb20cc80b010eef0b (diff)
downloadopenssl-new-c39e4048b538ec76313c264e860cfb5cd677a9ac.tar.gz
Do not set a nonzero default max_early_data
When early data support was first added, this seemed like a good idea, as it would allow applications to just add SSL_read_early_data() calls as needed and have things "Just Work". However, for applications that do not use TLS 1.3 early data, there is a negative side effect. Having a nonzero max_early_data in a SSL_CTX (and thus, SSL objects derived from it) means that when generating a session ticket, tls_construct_stoc_early_data() will indicate to the client that the server supports early data. This is true, in that the implementation of TLS 1.3 (i.e., OpenSSL) does support early data, but does not necessarily indicate that the server application supports early data, when the default value is nonzero. In this case a well-intentioned client would send early data along with its resumption attempt, which would then be ignored by the server application, a waste of network bandwidth. Since, in order to successfully use TLS 1.3 early data, the application must introduce calls to SSL_read_early_data(), it is not much additional burden to require that the application also calls SSL_{CTX_,}set_max_early_data() in order to enable the feature; doing so closes this scenario where early data packets would be sent on the wire but ignored. Update SSL_read_early_data.pod accordingly, and make s_server and our test programs into applications that are compliant with the new requirements on applications that use early data. Fixes #4725 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5483)
Diffstat (limited to 'test/tls13ccstest.c')
-rw-r--r--test/tls13ccstest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/tls13ccstest.c b/test/tls13ccstest.c
index c95010fb7b..afea0ea58d 100644
--- a/test/tls13ccstest.c
+++ b/test/tls13ccstest.c
@@ -255,7 +255,11 @@ static int test_tls13ccs(int tst)
chsessidlen = 0;
if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
- &sctx, &cctx, cert, privkey)))
+ &sctx, &cctx, cert, privkey))
+ || !TEST_true(SSL_CTX_set_max_early_data(sctx,
+ SSL3_RT_MAX_PLAIN_LENGTH))
+ || !TEST_true(SSL_CTX_set_max_early_data(cctx,
+ SSL3_RT_MAX_PLAIN_LENGTH)))
goto err;
/*