summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2020-09-01 17:45:17 +0000
committertb <>2020-09-01 17:45:17 +0000
commitd5f3a9753f359d5bbcbb51693103784c79f5f40e (patch)
tree976e89842b41f73866353342b9295199c9b4db75
parentffbcd0732f74e90e2d18b4addc2b7b9f0c6d79de (diff)
downloadopenbsd-d5f3a9753f359d5bbcbb51693103784c79f5f40e.tar.gz
openbsd-d5f3a9753f359d5bbcbb51693103784c79f5f40e.tar.bz2
openbsd-d5f3a9753f359d5bbcbb51693103784c79f5f40e.zip
The bumping of sess_cb_hit stats can wait until handling of
get_session_cb is completed.
-rw-r--r--src/lib/libssl/ssl_sess.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c
index be00c8a6ad..d46c85411b 100644
--- a/src/lib/libssl/ssl_sess.c
+++ b/src/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_sess.c,v 1.94 2020/09/01 17:30:45 tb Exp $ */ 1/* $OpenBSD: ssl_sess.c,v 1.95 2020/09/01 17:45:17 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -452,9 +452,6 @@ ssl_session_from_callback(SSL *s, CBS *session_id)
452 if ((sess = s->session_ctx->internal->get_session_cb(s, 452 if ((sess = s->session_ctx->internal->get_session_cb(s,
453 CBS_data(session_id), CBS_len(session_id), &copy)) == NULL) 453 CBS_data(session_id), CBS_len(session_id), &copy)) == NULL)
454 return NULL; 454 return NULL;
455
456 s->session_ctx->internal->stats.sess_cb_hit++;
457
458 /* 455 /*
459 * The copy handler may have set copy == 0 to indicate that the session 456 * The copy handler may have set copy == 0 to indicate that the session
460 * structures are shared between threads and that it handles the 457 * structures are shared between threads and that it handles the
@@ -464,6 +461,8 @@ ssl_session_from_callback(SSL *s, CBS *session_id)
464 if (copy) 461 if (copy)
465 CRYPTO_add(&sess->references, 1, CRYPTO_LOCK_SSL_SESSION); 462 CRYPTO_add(&sess->references, 1, CRYPTO_LOCK_SSL_SESSION);
466 463
464 s->session_ctx->internal->stats.sess_cb_hit++;
465
467 /* Add the externally cached session to the internal cache as well. */ 466 /* Add the externally cached session to the internal cache as well. */
468 if (!(s->session_ctx->internal->session_cache_mode & 467 if (!(s->session_ctx->internal->session_cache_mode &
469 SSL_SESS_CACHE_NO_INTERNAL_STORE)) { 468 SSL_SESS_CACHE_NO_INTERNAL_STORE)) {