diff options
author | Matt Caswell <matt@openssl.org> | 2015-04-10 16:49:33 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-04-14 14:58:49 +0100 |
commit | 5e0a80c1c9b2b06c2d203ad89778ce1b98e0b5ad (patch) | |
tree | b994284ef7d303eaf4d174a2426082a6bf1d1cb9 /ssl/ssl_sess.c | |
parent | 5e9f0eebcfa25a55177d9a7025713262367bec14 (diff) |
Fix ssl_get_prev_session overrun
If OpenSSL is configured with no-tlsext then ssl_get_prev_session can read
past the end of the ClientHello message if the session_id length in the
ClientHello is invalid. This should not cause any security issues since the
underlying buffer is 16k in size. It should never be possible to overrun by
that many bytes.
This is probably made redundant by the previous commit - but you can never be
too careful.
With thanks to Qinghao Tang for reporting this issue.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index a213ea90df..3d0f95090d 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -442,6 +442,11 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, if (len > SSL_MAX_SSL_SESSION_ID_LENGTH) goto err; + if (session_id + len > limit) { + fatal = 1; + goto err; + } + if (len == 0) try_session_cache = 0; |