Use Buffer concatenation for binary data instead of binary strings. Fixes Node.js v6.0.0 breakage. (#1001)

This commit is contained in:
Martynas Kunigėlis 2016-04-27 21:52:28 +03:00 committed by Brian C
parent 3433ed9673
commit 6fddc566f0

View File

@ -84,7 +84,7 @@ Client.prototype.connect = function(callback) {
//password request handling
con.on('authenticationMD5Password', checkPgPass(function(msg) {
var inner = Client.md5(self.password + self.user);
var outer = Client.md5(inner + msg.salt.toString('binary'));
var outer = Client.md5(Buffer.concat([new Buffer(inner), msg.salt]));
var md5password = "md5" + outer;
con.password(md5password);
}));