summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.apache/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.ssh.apache/src/org')
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java
index b0b1028daa..6aace4753a 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java
@@ -17,6 +17,7 @@ import static org.eclipse.jgit.transport.SshConstants.PUBKEY_ACCEPTED_ALGORITHMS
import java.io.File;
import java.io.IOException;
+import java.io.StreamCorruptedException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
@@ -355,20 +356,20 @@ public class JGitPublicKeyAuthentication extends UserAuthPublicKey {
// only warn about non-existing files in case the key file is
// not derived
if (!isDerived) {
- log.warn("{}", //$NON-NLS-1$
+ log.warn(LOG_FORMAT,
format(SshdText.get().cannotReadPublicKey, keyFile));
}
- } catch (InvalidPathException | IOException e) {
- log.warn("{}", //$NON-NLS-1$
- format(SshdText.get().cannotReadPublicKey, keyFile), e);
- } catch (GeneralSecurityException e) {
+ } catch (GeneralSecurityException | StreamCorruptedException e) {
// ignore in case this is not a derived key path, as in most
// cases this specifies a private key
if (isDerived) {
- log.warn("{}", //$NON-NLS-1$
+ log.warn(LOG_FORMAT,
format(SshdText.get().cannotReadPublicKey, keyFile),
e);
}
+ } catch (InvalidPathException | IOException e) {
+ log.warn(LOG_FORMAT,
+ format(SshdText.get().cannotReadPublicKey, keyFile), e);
}
return null;
}