summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-05-14 12:32:43 +0000
committerGerrit Code Review <support@gerrithub.io>2024-05-14 12:32:43 +0000
commit7dd522403a51577312b5cfa65f0c5566a49a94eb (patch)
treed0ea899ccca251e702143cbc593d952a97141298
parenta7d0cf38d6d6b6bea5a700d02b4854d687b865ad (diff)
parent28c3ae1728866bcdb2fb88b61683e3132c7f8ff5 (diff)
downloadjgit-7dd522403a51577312b5cfa65f0c5566a49a94eb.tar.gz
jgit-7dd522403a51577312b5cfa65f0c5566a49a94eb.zip
Merge "sshd: fix IdentiesOnly if SSH agent is enabled and has keys"
-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;
}