Skip to content

Commit

Permalink
Make SSL_clear_options pass new options to record layer
Browse files Browse the repository at this point in the history
Signed-off-by: lan1120 <lanming@huawei.com>

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #23045)

(cherry picked from commit e8e95f2)
  • Loading branch information
lan1120 authored and mattcaswell committed Dec 20, 2023
1 parent b379538 commit 1eb5074
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -6023,6 +6023,7 @@ uint64_t SSL_set_options(SSL *s, uint64_t op)

/* Ignore return value */
sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options);
sc->rlayer.wrlmethod->set_options(sc->rlayer.wrl, options);

return sc->options;
}
Expand All @@ -6035,6 +6036,7 @@ uint64_t SSL_CTX_clear_options(SSL_CTX *ctx, uint64_t op)
uint64_t SSL_clear_options(SSL *s, uint64_t op)
{
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
OSSL_PARAM options[2], *opts = options;

#ifndef OPENSSL_NO_QUIC
if (IS_QUIC(s))
Expand All @@ -6044,7 +6046,17 @@ uint64_t SSL_clear_options(SSL *s, uint64_t op)
if (sc == NULL)
return 0;

return sc->options &= ~op;
sc->options &= ~op;

*opts++ = OSSL_PARAM_construct_uint64(OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS,
&sc->options);
*opts = OSSL_PARAM_construct_end();

/* Ignore return value */
sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options);
sc->rlayer.wrlmethod->set_options(sc->rlayer.wrl, options);

return sc->options;
}

STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s)
Expand Down

0 comments on commit 1eb5074

Please sign in to comment.