BUG/MEDIUM: ssl: fix the id length check within smp_fetch_ssl_fc_session_id()
authorDragan Dosen <ddosen@haproxy.com>
Mon, 4 May 2020 07:07:28 +0000 (09:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 May 2020 11:51:24 +0000 (13:51 +0200)
commitf35d69e7fc13aab89afcf394c5b96133d3060c1a
tree78c34d5c7168d8fe124487810d3c139f37798353
parent7032a3fd0a71426d338190ec0eeb86f5c547c3dd
BUG/MEDIUM: ssl: fix the id length check within smp_fetch_ssl_fc_session_id()

After we call SSL_SESSION_get_id(), the length of the id in bytes is
stored in "len", which was never checked. This could cause unexpected
behavior when using the "ssl_fc_session_id" or "ssl_bc_session_id"
fetchers (eg. the result can be an empty value).

The issue was introduced with commit 105599c ("BUG/MEDIUM: ssl: fix
several bad pointer aliases in a few sample fetch functions").

This patch must be backported to 2.1, 2.0, and 1.9.
src/ssl_sock.c