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#24044)

(cherry picked from commit c342f4b)
  • Loading branch information
mattcaswell authored and bernd-edlinger committed Apr 22, 2024
1 parent 87721d5 commit af00b42
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 @@ -454,6 +454,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 af00b42

Please sign in to comment.