From 52432f280d1f9aa0f5835a390204f235b07e3157 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Tue, 14 May 2013 18:04:51 +0200 Subject: [PATCH 1/3] remove auth packet end verification not consistens for all MySQL versions: http://dev.mysql.com/doc/internals/en/connection-phase.html#packet-Protocol::Handshake Closes #75 --- packets.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packets.go b/packets.go index fdbc95c12..48ac9b5a8 100644 --- a/packets.go +++ b/packets.go @@ -187,10 +187,13 @@ func (mc *mysqlConn) readInitPacket() (err error) { // which is not documented but seems to work. mc.cipher = append(mc.cipher, data[pos:pos+12]...) - if data[len(data)-1] == 0 { - return - } - return errMalformPkt + // TODO: Verifiy string termination + // EOF for version >= (5.5.7 and < 5.5.10) or (>= 5.6.0 and < 5.6.2) + // \NUL otherwise + //if data[len(data)-1] == 0 { + // return + //} + //return errMalformPkt } return From 41c29368f8b980288fd45a7723a513157126ad34 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Tue, 14 May 2013 18:07:51 +0200 Subject: [PATCH 2/3] typo --- packets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packets.go b/packets.go index 48ac9b5a8..be464a04f 100644 --- a/packets.go +++ b/packets.go @@ -187,7 +187,7 @@ func (mc *mysqlConn) readInitPacket() (err error) { // which is not documented but seems to work. mc.cipher = append(mc.cipher, data[pos:pos+12]...) - // TODO: Verifiy string termination + // TODO: Verify string termination // EOF for version >= (5.5.7 and < 5.5.10) or (>= 5.6.0 and < 5.6.2) // \NUL otherwise //if data[len(data)-1] == 0 { From b8bd3dde80308aaa58c991c985eca51b27b53dc0 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Tue, 14 May 2013 18:16:11 +0200 Subject: [PATCH 3/3] todo fmt --- packets.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packets.go b/packets.go index be464a04f..d79d11174 100644 --- a/packets.go +++ b/packets.go @@ -188,8 +188,10 @@ func (mc *mysqlConn) readInitPacket() (err error) { mc.cipher = append(mc.cipher, data[pos:pos+12]...) // TODO: Verify string termination - // EOF for version >= (5.5.7 and < 5.5.10) or (>= 5.6.0 and < 5.6.2) + // EOF if version (>= 5.5.7 and < 5.5.10) or (>= 5.6.0 and < 5.6.2) // \NUL otherwise + // http://dev.mysql.com/doc/internals/en/connection-phase.html#packet-Protocol::Handshake + // //if data[len(data)-1] == 0 { // return //}