fommil/openssh-java — pull request #5 by apivovarov (2014-03-03 09:16:21+00:00)
Title: fix readAsnInteger for integers which are 128 bytes and longer

if block of bytes is [2, -127, -127, ... ] then
2 - means that it's integer
-127 - means that lenght is more than 0x80. read next byte(s) to get actual length (bytesToRead = -127 & 0x7f = 1)
next byte is -127 - means that lenght is 129 integer from byte[] {0,0,0,-127}
but old code return length=-127 becaues it does not put three leading 0 in byte[] representing length - new BigInteger(new byte[]{-127})
correct value should be integer from byte[]{0,0,0,-127} - which is 129 - new BigInteger(new byte[] {0,0,0,-127})