You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/11/04 16:54:11 UTC

[trafficserver] branch 9.0.x updated: Updated API header and ssl_session_reuse for new TSSslSessionInsert changes

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 782d9e4  Updated API header and ssl_session_reuse for new TSSslSessionInsert changes
782d9e4 is described below

commit 782d9e4d923300006a55c4b2d7dd4e9d9bae2277
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu Oct 24 15:16:06 2019 -0700

    Updated API header and ssl_session_reuse for new TSSslSessionInsert changes
    
    (cherry picked from commit ed2a8befdf4333cd5473baae99807850f1be2392)
---
 include/ts/ts.h                                               | 2 +-
 iocore/net/SSLSessionCache.cc                                 | 2 +-
 iocore/net/SSLSessionCache.h                                  | 2 +-
 plugins/experimental/ssl_session_reuse/src/session_process.cc | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/ts/ts.h b/include/ts/ts.h
index a0887de..60828f9 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1262,7 +1262,7 @@ TSReturnCode TSVConnProtocolEnable(TSVConn connp, const char *protocol_name);
 tsapi int TSVConnIsSsl(TSVConn sslp);
 tsapi TSSslSession TSSslSessionGet(const TSSslSessionID *session_id);
 tsapi int TSSslSessionGetBuffer(const TSSslSessionID *session_id, char *buffer, int *len_ptr);
-tsapi TSReturnCode TSSslSessionInsert(const TSSslSessionID *session_id, TSSslSession add_session);
+tsapi TSReturnCode TSSslSessionInsert(const TSSslSessionID *session_id, TSSslSession add_session, TSSslConnection ssl_conn);
 tsapi TSReturnCode TSSslSessionRemove(const TSSslSessionID *session_id);
 
 /* --------------------------------------------------------------------------
diff --git a/iocore/net/SSLSessionCache.cc b/iocore/net/SSLSessionCache.cc
index 611b4c8..17fb174 100644
--- a/iocore/net/SSLSessionCache.cc
+++ b/iocore/net/SSLSessionCache.cc
@@ -168,7 +168,7 @@ SSLSessionBucket::insertSession(const SSLSessionID &id, SSL_SESSION *sess, SSL *
   ink_release_assert(static_cast<size_t>(buf_exdata->block_size()) >= len_exdata);
   ssl_session_cache_exdata *exdata = reinterpret_cast<ssl_session_cache_exdata *>(buf_exdata->data());
   // This could be moved to a function in charge of populating exdata
-  exdata->curve = SSLGetCurveNID(ssl);
+  exdata->curve = (ssl == nullptr) ? 0 : SSLGetCurveNID(ssl);
 
   ats_scoped_obj<SSLSession> ssl_session(new SSLSession(id, buf, len, buf_exdata));
 
diff --git a/iocore/net/SSLSessionCache.h b/iocore/net/SSLSessionCache.h
index 7968b46..44ba12d 100644
--- a/iocore/net/SSLSessionCache.h
+++ b/iocore/net/SSLSessionCache.h
@@ -33,7 +33,7 @@
 #define SSL_MAX_SESSION_SIZE 256
 
 struct ssl_session_cache_exdata {
-  ssl_curve_id curve;
+  ssl_curve_id curve = 0;
 };
 
 struct SSLSessionID : public TSSslSessionID {
diff --git a/plugins/experimental/ssl_session_reuse/src/session_process.cc b/plugins/experimental/ssl_session_reuse/src/session_process.cc
index 3f69e18..be6e029 100644
--- a/plugins/experimental/ssl_session_reuse/src/session_process.cc
+++ b/plugins/experimental/ssl_session_reuse/src/session_process.cc
@@ -249,7 +249,7 @@ add_session(char *session_id, int session_id_len, const std::string &encrypted_s
   if (sid.len > sizeof(sid.bytes)) {
     sid.len = sizeof(sid.bytes);
   }
-  TSSslSessionInsert(&sid, reinterpret_cast<TSSslSession>(sess));
+  TSSslSessionInsert(&sid, reinterpret_cast<TSSslSession>(sess), nullptr);
   // Free the sesison object created by d2i_SSL_SESSION
   // We should make an API that just takes the ASN buffer
   SSL_SESSION_free(sess);