summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2020-09-02 08:04:07 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2020-09-02 08:04:07 +0000
commit3d6a3c51c527fad122e402d75e67499442e9892e (patch)
treef62df0f25837d6cf633e4be89369461b334da7d0 /lib/libssl
parent4f5402f837d5e1d4cb1fe9f1ff076243a2d38fbf (diff)
KNF and comment tweaks
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/ssl_sess.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c
index 3f1b987a7cc..3af4cfa79c3 100644
--- a/lib/libssl/ssl_sess.c
+++ b/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_sess.c,v 1.96 2020/09/01 19:17:36 tb Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.97 2020/09/02 08:04:06 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -561,11 +561,13 @@ ssl_get_prev_session(SSL *s, CBS *session_id, CBS *ext_block, int *alert)
/* Now sess is non-NULL and we own one of its reference counts. */
if (sess->sid_ctx_length != s->sid_ctx_length ||
- timingsafe_memcmp(sess->sid_ctx,
- s->sid_ctx, sess->sid_ctx_length) != 0) {
- /* We have the session requested by the client, but we don't
- * want to use it in this context. */
- goto err; /* treat like cache miss */
+ timingsafe_memcmp(sess->sid_ctx, s->sid_ctx,
+ sess->sid_ctx_length) != 0) {
+ /*
+ * We have the session requested by the client, but we don't
+ * want to use it in this context. Treat it like a cache miss.
+ */
+ goto err;
}
if ((s->verify_mode & SSL_VERIFY_PEER) && s->sid_ctx_length == 0) {
@@ -592,10 +594,9 @@ ssl_get_prev_session(SSL *s, CBS *session_id, CBS *ext_block, int *alert)
}
if (sess->timeout < (time(NULL) - sess->time)) {
- /* timeout */
s->session_ctx->internal->stats.sess_timeout++;
if (!ticket_decrypted) {
- /* session was from the cache, so remove it */
+ /* The session was from the cache, so remove it. */
SSL_CTX_remove_session(s->session_ctx, sess);
}
goto err;
@@ -606,6 +607,7 @@ ssl_get_prev_session(SSL *s, CBS *session_id, CBS *ext_block, int *alert)
SSL_SESSION_free(s->session);
s->session = sess;
s->verify_result = s->session->verify_result;
+
return 1;
err: