Skip to content

Commit

Permalink
Hardening around not_resumable sessions
Browse files Browse the repository at this point in the history
Make sure we can't inadvertently use a not_resumable session

Related to CVE-2024-2511

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl/openssl#24044)

(cherry picked from commit c342f4b8bd2d0b375b0e22337057c2eab47d9b96)
Signed-off-by: Liu-Ermeng <liuermeng2@huawei.com>
Signed-off-by: hhhFun <fanghaojie@huawei.com>
  • Loading branch information
mattcaswell authored and hhhFun committed Apr 13, 2024
1 parent fa8fa67 commit 2351649
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ssl/ssl_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ SSL_SESSION *lookup_sess_in_cache(SSL *s, const unsigned char *sess_id,
ret = s->session_ctx->get_session_cb(s, sess_id, sess_id_len, &copy);

if (ret != NULL) {
if (ret->not_resumable) {
/* If its not resumable then ignore this session */
if (!copy)
SSL_SESSION_free(ret);
return NULL;
}
tsan_counter(&s->session_ctx->stats.sess_cb_hit);

/*
Expand Down

0 comments on commit 2351649

Please sign in to comment.