From 5ad94767ab123125cdd18ad2202832dc9ff8ae8d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 13 Apr 2018 15:50:22 -0400 Subject: [PATCH] Remove legacy SSL_CTX_sess_set_get_cb overload. Update-Note: I believe everything relying on this overload has since been updated. Change-Id: I7facf59cde56098e5e3c79470293b67abb715f4c Reviewed-on: https://boringssl-review.googlesource.com/27485 Reviewed-by: Steven Valdez Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- include/openssl/ssl.h | 10 ---------- ssl/internal.h | 2 -- ssl/ssl_session.cc | 19 +++---------------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 2922473b..31da0fd3 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -4116,16 +4116,6 @@ OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); -#if !defined(BORINGSSL_NO_CXX) -// SSL_CTX_sess_set_get_cb is a legacy C++ overload of |SSL_CTX_sess_set_get_cb| -// which supports the old callback signature. -// -// TODO(davidben): Remove this once Node is compatible with OpenSSL 1.1.0. -extern "C++" OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( - SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)); -#endif - // Private structures. // diff --git a/ssl/internal.h b/ssl/internal.h index f4dc96f1..07d099d4 100644 --- a/ssl/internal.h +++ b/ssl/internal.h @@ -2027,8 +2027,6 @@ struct SSLContext { void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess); SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, int *copy); - SSL_SESSION *(*get_session_cb_legacy)(SSL *ssl, uint8_t *data, int len, - int *copy); CRYPTO_refcount_t references; diff --git a/ssl/ssl_session.cc b/ssl/ssl_session.cc index bc2c14c1..a18ddd18 100644 --- a/ssl/ssl_session.cc +++ b/ssl/ssl_session.cc @@ -682,17 +682,10 @@ static enum ssl_hs_wait_t ssl_lookup_session( } // Fall back to the external cache, if it exists. - if (!session && (ssl->session_ctx->get_session_cb != nullptr || - ssl->session_ctx->get_session_cb_legacy != nullptr)) { + if (!session && ssl->session_ctx->get_session_cb != nullptr) { int copy = 1; - if (ssl->session_ctx->get_session_cb != nullptr) { - session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, - session_id_len, ©)); - } else { - session.reset(ssl->session_ctx->get_session_cb_legacy( - ssl, const_cast(session_id), session_id_len, ©)); - } - + session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, + session_id_len, ©)); if (!session) { return ssl_hs_ok; } @@ -1192,12 +1185,6 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, ctx->get_session_cb = cb; } -void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION *(*cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)) { - ctx->get_session_cb_legacy = cb; -} - SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, const uint8_t *id, int id_len,