diff --git a/lib/srp.js b/lib/srp.js index 6060870..4d6fdf6 100644 --- a/lib/srp.js +++ b/lib/srp.js @@ -308,8 +308,8 @@ function getM1(params, u_buf, s_buf, A_buf, B_buf, K_buf) { assertIsNBuffer(B_buf, params, "B"); assertIsBuffer(K_buf, params, "K"); - var hN = crypto.createHash(params.hash).update(params.N.toBuffer()).digest(); - var hG = crypto.createHash(params.hash).update(params.g.toBuffer()).digest(); + var hN = crypto.createHash(params.hash).update(params.N.toBuffer(true)).digest(); + var hG = crypto.createHash(params.hash).update(params.g.toBuffer(true)).digest(); for (var i = 0; i < hN.length; i++) hN[i] ^= hG[i]; @@ -428,7 +428,6 @@ Server.prototype = { throw new Error("incomplete protocol"); if (!equal(this._private.M1_buf, clientM1_buf)) throw new Error("client did not use the same password"); - // return this._private.M2_buf; }, computeK: function computeK() { if (this._private.K_buf === undefined)