diff --git a/lib/protocol.js b/lib/protocol.js index 56779d1..69891cb 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -164,10 +164,10 @@ var PrivateKey = { }, decodeSize: function (buf, offset) { var keyBuf = buf.slice(offset); - /* XXX: should find a way to make this faster */ - var key = sshpk.PrivateKey.formats. - rfc4253.readPartial('private', keyBuf); - return (key.toBuffer('rfc4253').length); + var ret = {}; + sshpk.PrivateKey.formats.rfc4253. + readInternal(ret, 'private', keyBuf); + return (ret.consumed); }, decode: function (buf, offset) { var size = PrivateKey.decodeSize(buf, offset); diff --git a/package.json b/package.json index ba44c76..d047d41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sshpk-agent", - "version": "1.2.0", + "version": "1.2.1", "description": "ssh-agent client for use with sshpk", "main": "lib/index.js", "scripts": {