Skip to content

Commit 90405e7

Browse files
authored
Handshake is now more resilient
Errors issued by the server for caching_sha2_password users after a fast auth OK packet has been received (e.g. bad database errors) are now reported correctly Handshake now correctly detects protocol violation errors, like double auth switches close #469 close #468
1 parent 6839555 commit 90405e7

32 files changed

+2645
-2366
lines changed

include/boost/mysql/client_errc.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ enum class client_errc : int
163163
* Use `async_start_execution` to start one.
164164
*/
165165
not_engaged_in_multi_function,
166+
167+
/**
168+
* \brief During handshake, the server sent a packet type that is not allowed in the current state
169+
* (protocol violation).
170+
*/
171+
bad_handshake_packet_type,
166172
};
167173

168174
BOOST_MYSQL_DECL

include/boost/mysql/detail/make_string_view.hpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

include/boost/mysql/impl/error_categories.ipp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ inline const char* error_to_string(client_errc error)
100100
case client_errc::not_engaged_in_multi_function:
101101
return "The operation requires the connection to be engaged in a multi-function operation. "
102102
"Use async_start_execution to start one.";
103+
case client_errc::bad_handshake_packet_type:
104+
return "During handshake, the server sent a packet type that is not allowed in the current state "
105+
"(protocol violation).";
103106
default: return "<unknown MySQL client error>";
104107
}
105108
}

include/boost/mysql/impl/internal/auth/auth.hpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

include/boost/mysql/impl/internal/auth/auth.ipp

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)