diff --git a/lib/ssh.js b/lib/ssh.js index 6480203a8..26d35f072 100644 --- a/lib/ssh.js +++ b/lib/ssh.js @@ -202,7 +202,7 @@ ssh.getPublicKeyFingerprint = function(key, options) { function _addBigIntegerToBuffer(buffer, val) { var hexVal = val.toString(16); // ensure 2s complement +ve - if(hexVal[0] >= '8') { + if(hexVal[0] >= '8' && (hexVal.length % 2 === 0)) { hexVal = '00' + hexVal; } var bytes = forge.util.hexToBytes(hexVal);