diff options
author | Matt Caswell <matt@openssl.org> | 2022-09-15 16:03:02 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2022-10-05 15:21:37 +0100 |
commit | 1e76110b7214a4fb39dc1397cbc4771538d06f39 (patch) | |
tree | 527d121cb5878f5b8892ae5036c22f985b54ae17 /ssl/ssl_lib.c | |
parent | 9251c3c4c7695b6268fcd122e18643d61f02b5dd (diff) |
Enable the ability to query the COMP_METHOD being used in the record layer
We also convert to passing COMP_METHOD rather than SSL_COMP to the record
layer. The former is a public type while the latter is internal only - and
the only thing we need from SSL_COMP is the method.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19217)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 18a6a4865d..3facb703e7 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -4786,7 +4786,11 @@ const COMP_METHOD *SSL_get_current_compression(const SSL *s) if (sc == NULL) return NULL; - return sc->compress ? COMP_CTX_get_method(sc->compress) : NULL; + /* TODO(RECLAYER): Remove me once SSLv3/DTLS moved to write record layer */ + if (SSL_CONNECTION_IS_DTLS(sc) || sc->version == SSL3_VERSION) + return sc->compress ? COMP_CTX_get_method(sc->compress) : NULL; + + return sc->rlayer.wrlmethod->get_compression(sc->rlayer.wrl); #else return NULL; #endif @@ -4800,7 +4804,7 @@ const COMP_METHOD *SSL_get_current_expansion(const SSL *s) if (sc == NULL) return NULL; - return sc->expand ? COMP_CTX_get_method(sc->expand) : NULL; + return sc->rlayer.rrlmethod->get_compression(sc->rlayer.rrl); #else return NULL; #endif |