Remove length restriction in key reader. (#595)

This commit is contained in:
David Kocher
2020-06-05 11:35:27 +02:00
committed by GitHub
parent ff85e832af
commit c4fef33d8f
2 changed files with 91 additions and 3 deletions

View File

@@ -321,9 +321,6 @@ public class PuTTYKeyFile extends BaseFileKeyProvider {
private byte[] read() throws IOException {
int len = di.readInt();
if (len <= 0 || len > 513) {
throw new IOException(String.format("Invalid length %d", len));
}
byte[] r = new byte[len];
di.readFully(r);
return r;