summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorLingmo Zhu <zlm2006@gmail.com>2017-07-25 18:00:44 +0800
committerMatt Caswell <matt@openssl.org>2017-08-03 10:23:07 +0100
commit15b3fd6f647f340d83cfffbd9a34097883ec9271 (patch)
tree6919e607fd1a238ec1cc02b8a3488fd73a2ddc30 /ssl
parent85d9b9f7169644ee74c294c3adf8b60a90e103e4 (diff)
Remove the obsolete misleading comment and code related to it.
The comment "The following should not return 1, otherwise, things are very strange" is from the very first commit of OpenSSL. The really meaning of the comment is if the identical session can be found from internal cache after calling get_session_cb but not found before calling get_session_cb, it is just strange. The value 1 was originated from the old doc of SSLeay, reversed from the actual return value of SSL_CTX_add_session(). Anyway either return value of SSL_CTX_add_session() should not interrupt the session resumption process. So the checking of return value of SSL_CTX_add_session() is not necessary. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4014) (cherry picked from commit e29bb83479cc567b4bb414dc55148ec06a30a115)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_sess.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 92ba599566..8fd5f396aa 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -531,11 +531,14 @@ int ssl_get_prev_session(SSL *s, const PACKET *ext, const PACKET *session_id)
(s->session_ctx->session_cache_mode &
SSL_SESS_CACHE_NO_INTERNAL_STORE)) {
/*
- * The following should not return 1, otherwise, things are
- * very strange
+ * Either return value of SSL_CTX_add_session should not
+ * interrupt the session resumption process. The return
+ * value is intentionally ignored.
*/
- if (SSL_CTX_add_session(s->session_ctx, ret))
- goto err;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-result"
+ SSL_CTX_add_session(s->session_ctx, ret);
+#pragma GCC diagnostic pop
}
}
}