row editing
This commit is contained in:
@@ -422,6 +422,13 @@ final class MySQLWireConnection {
|
||||
)
|
||||
}
|
||||
let plugin = (try? c.nulString()) ?? "mysql_native_password"
|
||||
|
||||
NSLog(
|
||||
"DBSyn MySQL authentication: plugin=%@ saltLength=%d tlsRequired=%@",
|
||||
plugin,
|
||||
salt.count,
|
||||
requireTLS ? "YES" : "NO"
|
||||
)
|
||||
if requireTLS {
|
||||
let clientSSL = 0x00000800
|
||||
guard capabilities & clientSSL != 0 else {
|
||||
@@ -443,6 +450,13 @@ final class MySQLWireConnection {
|
||||
body += Array(plugin.utf8) + [0]
|
||||
try send(body)
|
||||
var reply = try readPacket()
|
||||
|
||||
NSLog(
|
||||
"DBSyn MySQL initial authentication response: type=0x%02X length=%d",
|
||||
Int(reply.first ?? 0),
|
||||
reply.count
|
||||
)
|
||||
|
||||
try checkError(reply)
|
||||
var currentPlugin = plugin
|
||||
var currentSalt = Array(salt)
|
||||
@@ -461,6 +475,12 @@ final class MySQLWireConnection {
|
||||
guard currentPlugin == "caching_sha2_password", reply.count >= 2 else {
|
||||
throw MySQLWireError(message: "Unsupported authentication continuation")
|
||||
}
|
||||
NSLog(
|
||||
"DBSyn MySQL authentication continuation: code=0x%02X TLS=%@",
|
||||
Int(reply[1]),
|
||||
tlsActive ? "YES" : "NO"
|
||||
)
|
||||
|
||||
switch reply[1] {
|
||||
case 0x03: // Fast authentication accepted; wait for OK.
|
||||
reply = try readPacket()
|
||||
@@ -496,6 +516,12 @@ final class MySQLWireConnection {
|
||||
throw MySQLWireError(message: "Unsupported caching_sha2_password response: \(reply[1])")
|
||||
}
|
||||
}
|
||||
NSLog(
|
||||
"DBSyn MySQL final authentication response: type=0x%02X length=%d",
|
||||
Int(reply.first ?? 0),
|
||||
reply.count
|
||||
)
|
||||
|
||||
try checkError(reply)
|
||||
guard reply.first == 0x00 else { throw MySQLWireError(message: "Authentication did not complete") }
|
||||
if !database.isEmpty { _ = try query("USE `\(database.replacingOccurrences(of: "`", with: "``"))`") }
|
||||
|
||||
Reference in New Issue
Block a user