known_hosts parsing does not ignore malformed base64 strings since 0.36.0 (#922)

This commit is contained in:
kegelh
2024-01-26 13:36:29 +01:00
committed by GitHub
parent f94444bc53
commit 03f8b2224d
2 changed files with 12 additions and 4 deletions

View File

@@ -292,8 +292,8 @@ public class OpenSSHKnownHosts
try {
byte[] keyBytes = Base64.getDecoder().decode(sKey);
key = new Buffer.PlainBuffer(keyBytes).readPublicKey();
} catch (IOException ioe) {
log.warn("Error decoding Base64 key bytes", ioe);
} catch (IOException | IllegalArgumentException exception) {
log.warn("Error decoding Base64 key bytes", exception);
return new BadHostEntry(line);
}
} else if (isBits(sType)) {