}
s->mode = ctx->mode;
s->max_cert_list = ctx->max_cert_list;
- s->max_early_data = ctx->max_early_data;
- s->recv_max_early_data = ctx->recv_max_early_data;
+
+ if (!IS_QUIC_CTX(ctx)) {
+ s->max_early_data = ctx->max_early_data;
+ s->recv_max_early_data = ctx->recv_max_early_data;
+ }
+
s->num_tickets = ctx->num_tickets;
s->pha_enabled = ctx->pha_enabled;
X509_VERIFY_PARAM_inherit(s->param, ctx->param);
s->quiet_shutdown = ctx->quiet_shutdown;
- if (!IS_QUIC_SSL(ssl))
+ if (!IS_QUIC_CTX(ctx))
s->ext.max_fragment_len_mode = ctx->ext.max_fragment_len_mode;
s->max_send_fragment = ctx->max_send_fragment;
s->key_update = SSL_KEY_UPDATE_NONE;
- s->allow_early_data_cb = ctx->allow_early_data_cb;
- s->allow_early_data_cb_data = ctx->allow_early_data_cb_data;
+ if (!IS_QUIC_CTX(ctx)) {
+ s->allow_early_data_cb = ctx->allow_early_data_cb;
+ s->allow_early_data_cb_data = ctx->allow_early_data_cb_data;
+ }
if (!method->ssl_init(ssl))
goto sslerr;
int ret;
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
- /* TODO(QUIC): This will need special handling for QUIC */
if (sc == NULL)
return 0;
{
const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s);
- /* TODO(QUIC): This will need special handling for QUIC */
if (sc == NULL)
return 0;
{
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
- if (sc == NULL)
+ if (sc == NULL || IS_QUIC_SSL(s))
return 0;
sc->max_early_data = max_early_data;
{
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
- if (sc == NULL)
+ if (sc == NULL || IS_QUIC_SSL(s))
return 0;
sc->recv_max_early_data = recv_max_early_data;
{
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
- if (sc == NULL)
+ if (sc == NULL || IS_QUIC_SSL(s))
return;
sc->allow_early_data_cb = cb;
int testresult = 0;
SSL_CTX *ctx = NULL;
SSL *ssl = NULL;
+ char buf[16];
+ size_t len;
if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, OSSL_QUIC_client_method())))
goto err;
if (!TEST_uint64_t_eq(SSL_CTX_get_options(ctx), UINT64_MAX))
goto err;
+ /* Set options on CTX which should not be inherited (tested below). */
+ SSL_CTX_set_read_ahead(ctx, 1);
+ SSL_CTX_set_max_early_data(ctx, 1);
+ SSL_CTX_set_recv_max_early_data(ctx, 1);
+
if (!TEST_ptr(ssl = SSL_new(ctx)))
goto err;
goto err;
/* Readahead */
+ if (!TEST_false(SSL_get_read_ahead(ssl)))
+ goto err;
+
SSL_set_read_ahead(ssl, 1);
if (!TEST_false(SSL_get_read_ahead(ssl)))
goto err;
|| !TEST_false(SSL_set_tlsext_max_fragment_length(ssl, TLSEXT_max_fragment_length_512)))
goto err;
+ /* Max early data */
+ if (!TEST_false(SSL_get_recv_max_early_data(ssl))
+ || !TEST_false(SSL_get_max_early_data(ssl))
+ || !TEST_false(SSL_set_recv_max_early_data(ssl, 1))
+ || !TEST_false(SSL_set_max_early_data(ssl, 1)))
+ goto err;
+
+ /* Read/Write */
+ if (!TEST_false(SSL_read_early_data(ssl, buf, sizeof(buf), &len))
+ || !TEST_false(SSL_write_early_data(ssl, buf, sizeof(buf), &len)))
+ goto err;
+
testresult = 1;
err:
SSL_free(ssl);