1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix for CONC-587:

Since alerts may happen after handshake (for example with described
test in CONC-587 using TLSv1.3 protocol or by renegotiation) the
tls error message needs to be retrieved if error is a protocol error
(SSL_ERROR_SSL) and/or if errno was not set.
This commit is contained in:
Georg Richter
2022-04-20 18:48:54 +02:00
parent b973c75c27
commit 3ce51b0b3e
2 changed files with 24 additions and 4 deletions

View File

@@ -202,10 +202,16 @@ restart:
if (len == packet_error || len == 0)
{
end_server(mysql);
my_set_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
CR_NET_PACKET_TOO_LARGE:
CR_SERVER_LOST,
SQLSTATE_UNKNOWN, 0, errno);
#ifdef HAVE_TLS
/* don't overwrite possible tls protocol errors */
if (net->last_errno != CR_SSL_CONNECTION_ERROR)
#endif
{
my_set_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
CR_NET_PACKET_TOO_LARGE:
CR_SERVER_LOST,
SQLSTATE_UNKNOWN, 0, errno);
}
return(packet_error);
}
if (net->read_pos[0] == 255)