mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-27 11:52:34 -04:00
BUG/MINOR: ssl-hello: make use of the null-terminated servername
In ssl_sock_switchctx_cbk(), the servername is copied into the trash
and null-terminated, but later in the call to strncpy() it's still used
as-is, so anything that follows it will be copied as well, which is not
really expected. Let's make the servername point to the trash after
sanitizing it, like ssl_sock_switchcbk_wolfSSL_cbk() does.
This can be backported to 2.6 since it was introduced with commit
a996763619 ("BUG/MINOR: ssl: Store client SNI in SSL context in case
of ClientHello error").
This commit is contained in:
parent
2653936510
commit
c41c731f5e
1 changed files with 1 additions and 0 deletions
|
|
@ -448,6 +448,7 @@ sni_lookup:
|
|||
for (i = 0; i < trash.size && i < servername_len; i++)
|
||||
trash.area[i] = tolower((unsigned char)servername[i]);
|
||||
trash.area[i] = 0;
|
||||
servername = trash.area;
|
||||
|
||||
HA_RWLOCK_RDLOCK(SNI_LOCK, &s->sni_lock);
|
||||
sni_ctx = ssl_sock_choose_sni_ctx(s, conn, trash.area, has_rsa_sig, has_ecdsa_sig);
|
||||
|
|
|
|||
Loading…
Reference in a new issue