Skip to content

Commit 3ad0680

Browse files
sehropebrianc
authored andcommitted
Fix reference to md5 helper in test
Fixes reference to md5 helper and removes reference to js client as the md5 function is now provided by utils.
1 parent beba66f commit 3ad0680

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/integration/connection/test-helper.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
var net = require('net')
33
var helper = require(__dirname + '/../test-helper')
44
var Connection = require(__dirname + '/../../../lib/connection')
5+
var utils = require(__dirname + '/../../../lib/utils')
56
var connect = function (callback) {
67
var username = helper.args.user
78
var database = helper.args.database
@@ -20,10 +21,8 @@ var connect = function (callback) {
2021
con.password(helper.args.password)
2122
})
2223
con.once('authenticationMD5Password', function (msg) {
23-
// need js client even if native client is included
24-
var client = require(__dirname + '/../../../lib/client')
25-
var inner = client.md5(helper.args.password + helper.args.user)
26-
var outer = client.md5(inner + msg.salt.toString('binary'))
24+
var inner = utils.md5(helper.args.password + helper.args.user)
25+
var outer = utils.md5(Buffer.concat([Buffer.from(inner), msg.salt]))
2726
con.password('md5' + outer)
2827
})
2928
con.once('readyForQuery', function () {

0 commit comments

Comments
 (0)