Commit Graph

125 Commits

Author SHA1 Message Date
Thomas Wolf ac0a995975 SSH: bump org.apache.sshd to 2.11.0
Update maven build, bazel build, and target platform.

Also remove a file in a ./bin directory that got committed by mistake
in commit f5f4bf0ad.

Change-Id: Ia653c71643f8fad290874d723dacdafbef25c13f
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-11-15 21:38:23 +01:00
Matthias Sohn 3a3b72cf90 Prepare 6.8.0-SNAPSHOT builds
Change-Id: Ifc81f0a96c2ced0b25926b9daa539d9cfc951925
2023-09-07 02:24:53 +02:00
Matthias Sohn bb12dd4cbd Prepare 6.7.1-SNAPSHOT builds
Change-Id: I96097ef8c6f198220f513bbc6d5f8881834a1491
2023-09-07 02:03:54 +02:00
Matthias Sohn ea02caf1e7 JGit v6.7.0.202309050840-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Ibe952d97bc178adb909cdd40f48957f5b68af699
2023-09-05 14:41:09 +02:00
Matthias Sohn c5d8936c80 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I49751232464e70b7d1dc3292a9f36b7a7015e44f
2023-08-30 17:46:26 +02:00
Matthias Sohn c54acc5822 JGit v6.7.0.202308301100-rc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I712a9f6830364ed404d03f3a145c055906273544
2023-08-30 16:57:25 +02:00
Matthias Sohn 8995a64295 Update Orbit to orbit-aggregation/release/4.29.0
Switch to bundle dependencies for hamcrest 1.3 to avoid issues with
split packages in that version.

Don't allow hamcrest 2.x yet since junit 4.13.2 still requires hamcrest
1.3.

See Orbit restructuring in
https://github.com/orgs/eclipse-orbit/discussions/49

Change-Id: I8faf519b8f2c4e4a6bd255d694d1aa28017acd85
2023-08-30 14:28:33 +02:00
Matthias Sohn 9afff3e808 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I50ff7ee31046cfc29a087c8963be3deae24b1c9c
2023-05-24 17:31:26 +02:00
Thomas Wolf 913e6cf3f6 Switch to Apache MINA sshd 2.10.0
Bump the version numbers in pom.xml and in MANIFESTs, and in the bazel
WORKSPACE file. Update the target platforms. Remove work-arounds in
org.eclipse.jgit.ssh.apache that are no longer necessary.

The release notes for Apache MINA sshd are at [1].

[1] https://github.com/apache/mina-sshd/blob/master/docs/changes/2.10.0.md

Bug: 581770
Change-Id: Id27e73e9712b7865353c9b32b5b768f6e998b05e
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-05-16 12:59:37 +02:00
Matthias Sohn 84461e8086 Update slf4j to 1.7.36 and consume it directly from Maven Central
BundleSymbolicNames changed to the names used upstream:
- slf4j.api
- slf4j.simple

Change-Id: Ibcaafae282d3a6fa013bc39d879def1b66073bca
2023-05-02 17:05:18 +02:00
Matthias Sohn f34ae6fe31 Prepare 6.6.0-SNAPSHOT builds
Change-Id: I17893f9db12bcb208866f40a06cd4f1ccbb4fe30
2023-03-01 15:40:45 +01:00
Matthias Sohn 2e28f27c26 Prepare 6.5.0-SNAPSHOT builds
Change-Id: I4238b6181e96e22e540cf34802a332f868cb6dfb
2022-11-23 19:09:33 +01:00
Thomas Wolf b39972f8a2 Update Apache Mina SSHD to 2.9.2
Release notes for 2.9.2:
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.9.2.md

Change-Id: I7809bcba1d45b76ab9dcc031f86beb2f69da3788
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2022-11-18 23:05:29 +01:00
Matthias Sohn 85182df267 Prepare 6.4.0-SNAPSHOT builds
Change-Id: I47ca5f1d0263caa0bfc7c303042360c6c5ac4dec
2022-09-14 13:56:40 +02:00
Matthias Sohn fb377b09eb Prepare 6.3.1-SNAPSHOT builds
Change-Id: I44e159eca4131880d74d3078060e7e20f9b5ce76
2022-09-12 10:09:10 +02:00
Matthias Sohn 68e8ecc91b JGit v6.3.0.202209071007-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Iea3fae9f6f6c5fb0a79f7684334a3e0059738c4f
2022-09-07 16:07:11 +02:00
Matthias Sohn f8104e25f1 JGit v6.3.0.2022009070944-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I3cc78dbcf8c7970e80bf1499751611110ec2b30b
2022-09-07 15:39:48 +02:00
Matthias Sohn 3a12709851 Prepare 6.3.0-SNAPSHOT builds
Change-Id: Ie398b651c5308ec86812bf01fcc563d3e679c828
2022-08-17 07:44:50 +02:00
Matthias Sohn 85a4809996 JGit v6.3.0.202208161710-m3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I0954d11a1f35eff196b157df3aa8386476c48a7e
2022-08-16 23:09:30 +02:00
Matthias Sohn 8137e5e746 Prepare 6.3.0-SNAPSHOT builds
Change-Id: I092fdd2c35d85bf35e3ef700aa7078e6d304d977
2022-06-07 01:02:10 +02:00
Thomas Wolf 4dd9a94ec5 [sshd] Better user feedback on authentication failure
When authentication fails, JGit produces an exception with an error
message telling the user that it could not log in (including the host
name). The causal chain has an SshException from Apache MINA sshd with
message "No more authentication methods available".

This is not very helpful. The user was left without any indication why
authentication failed.

Include in the exception message a log of all attempted authentications.
That way, the user can see which keys were tried, in which order and
with which signature algorithms. The log also reports authentication
attempts for gssapi-with-mic or password authentication. For
keyboard-interactive Apache MINA sshd is lacking a callback interface.

The way Apache MINA sshd loads keys from files, the file names are lost
in higher layers. Add a mechanism to record on the session for each
key fingerprint the file it was loaded from, if any. That way the
exception message can refer to keys by file name, which is easier to
understand by users than the rather cryptic key fingerprints.

Bug: 571390
Change-Id: Ic4b6ce6b99f307d5e798fcc91b16b9ffd995d224
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-05-01 08:48:44 +02:00
Matthias Sohn d0ed6016d4 Prepare 6.2.0-SNAPSHOT builds
Change-Id: Ic2dde88bee3242169d6fa50956f8938f3fc4ba8e
2022-03-03 10:49:58 +01:00
Thomas Wolf d30447e269 Switch to Apache MINA sshd 2.8.0
Update version in root pom.xml, adapt code & manifests. Bump the
dependency in the bazel build.

Update Orbit to I20220105095044 to get Apache MINA sshd 2.8.0 and
regenerate all target platforms.

Bug: 577542
Change-Id: Iefc02ceda8a9b0683f49aa8059999a5486d1f322
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-01-07 02:15:24 +01:00
Thomas Wolf 4c555f0742 sshd: backport upstream fix for SSHD-1231
SSHD-1231[1] may lead to exceptions when trying to authenticate first
with an RSA key that is rejected by the server. The upstream fix is a
one-liner but unfortunately didn't make it into Apache MINA sshd 2.8.0.

Incorporate the upstream fix in JGitPublicKeyAuthentication, and add
a test case for this.

[1] https://issues.apache.org/jira/browse/SSHD-1231

Bug: 577545
Change-Id: Ia744cd4aa569bccd937c855f3bb45c0116915bad
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-01-06 19:33:44 +01:00
Thomas Wolf 126839b8b1 Merge branch 'stable-6.0'
* stable-6.0:
  Use slf4j-simple instead of log4j for logging
  Update orbit to R20211213173813

Change-Id: I746b7fb71571020ce49f7b50fd675c9864327719
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-01-05 17:22:50 +01:00
Thomas Wolf f7662a756e Merge branch 'stable-5.13' into stable-6.0
* stable-5.13:
  Use slf4j-simple instead of log4j for logging
  Update orbit to R20211213173813

Change-Id: I219ef3901c1d908b91bf9c8f00431b22686ff7a5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-01-05 15:59:09 +01:00
Matthias Sohn 486afbc08d Use slf4j-simple instead of log4j for logging
JGit uses slf4j-api as logging API.

The libraries
- org.eclipse.jgit.http.test
- org.eclipse.jgit.pgm
- org.eclipse.jgit.ssh.apache.test
- org.eclipse.jgit.test
used the outdated log4j 1.2.15 which is EOL since years.

Since both jgit command line and also the tests don't need sophisticated
logging features replace log4j with the much simpler slf4j-simple log
implementation. The org.slf4j.binding.simple 1.7.30 archive has only
25kB instead of 429kB for log4j 1.2.15

Applications using jgit are free to choose any other log implementation
supporting slf4j API.

Change-Id: I89e85cd3c76e954c3434622510975ce65dc227d4
2021-12-31 01:09:52 +01:00
Matthias Sohn 30b79cd0e8 Prepare 6.0.1-SNAPSHOT builds
Change-Id: Iddb67ed9578293b83b8147aa18dd8319426f83d1
2021-11-29 17:37:27 +01:00
Matthias Sohn 9492e84fe5 JGit v6.0.0.202111291000-r
Change-Id: I6441d9226e8131552bfafe1fb2c353f2e07e42ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-29 16:10:14 +01:00
Matthias Sohn 4453a6e042 Prepare 6.1.0-SNAPSHOT builds
Change-Id: Ied07b1298bd32672a5025cec5079440ab9b9a100
2021-11-24 19:42:27 +01:00
Matthias Sohn e3707a6cea Prepare 6.0.0-SNAPSHOT builds
Change-Id: I4e06186cf62681767962e391331cc65bafddc205
2021-11-24 18:18:12 +01:00
Matthias Sohn ad8d89b9c0 JGit v6.0.0.202111241155-rc1
Change-Id: I35dc089a00ee12f83f506fb320d23762fa030063
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-24 17:54:51 +01:00
Matthias Sohn 6807661d39 Prepare 6.0.0-SNAPSHOT builds
Change-Id: Ibfc7fb21b039fe2a7669c8dee3c10f5ade33d520
2021-11-17 21:41:28 +01:00
Matthias Sohn 400b5acae8 JGit v6.0.0.202111161950-m3
Change-Id: If6c36994be05848c567d3d664eb683d9bed26c48
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-17 01:50:01 +01:00
Thomas Wolf 057f1d9123 ssh: Handle "ProxyJump none" from SSH config file
Since OpenSSH 7.8, the ProxyJump directive accepts the value "none"[1]
to override and clear a setting that might otherwise be contributed by
another (wildcard) host entry.

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=2869

Change-Id: Ia35e82c6f8c58d5c6b8040cda7a07b220f43fc21
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-15 22:26:20 +01:00
Thomas Wolf 634302d2da sshd: add support for ssh-agent
Add a simple SSH agent connector using JNA. Include com.sum.jna and
com.sun.jna.platform in the target platform.

JNA is used to communicate through Unix domain sockets with ssh-agent,
and if on Windows, to communicate via shared memory with Pageant.

The new bundle o.e.j.ssh.apache.agent is an OSGi fragment so that
the java.util.ServiceLoader can find the provided factory without
further ado in OSGi environments.

Adapt both maven and bazel builds to include the new bundle.

Manually tested on OS X, CentOS 7, and Win10 with Pageant 0.76. Tested
by installing JGit built from this change into freshly downloaded
Eclipse 2021-12 M1, and then doing git fetches via SSH with different
~/.ssh/config settings (explicit IdentityFile, without any but a key in
the agent, with no keys and a key in the agent and IdentitiesOnly=yes
(must fail)).

Bug: 541274
Bug: 541275
Change-Id: I34e85467293707dbad1eb44d1f40fc2e70ba3622
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-03 23:46:54 +01:00
Matthias Sohn 1d280db147 Enable compiler option --release
This ensures the compiler compiles against the public, supported and
documented API for a specific VM version (here 11) [1]. This also means
that
we don't need EE descriptors in Eclipse anymore in order to ensure that
only supported APIs of the selected Java version can be used.

According to [2] if option --release is used --source and --target
options can't be used.

While we are at it also add default value for all new jdt core options
added in Eclipse 4.21.

[1] https://docs.oracle.com/en/java/javase/11/tools/javac.html
[2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release

Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:13:01 +02:00
Matthias Sohn f81a3fc91a Bump minimum required Java version to 11
Bug: 569917
Change-Id: Ifdcdb022a3f29321b4d10da1cc34acca68ed7b03
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:12:12 +02:00
Matthias Sohn a19494b735 Merge branch 'master' into next
* master: (38 commits)
  Revert "DFS block cache: Refactor to enable parallel index loading"
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  Update spotbugs-maven-plugin to 4.3.0
  Update ant to 1.10.11 also in pom.xml
  DFS block cache: add additional stats to DfsReaderIoStats
  Update Orbit to S20210817231813
  [gpg] Better GPG home directory determination
  FS: cleanup use of final modifier
  Ensure FS#searchPath only selects executable files
  RevWalk: getMergedInto's result is wrong on the second call
  DFS block cache: Refactor to enable parallel index loading
  [test] Create keystore with the keytool of the running JDK
  [gpg] Update to Bouncy Castle 1.69
  [test] Create keystore with the keytool of the running JDK
  [sshd] Minor code clean-up
  Support commit.template config property
  ...

Change-Id: I9f99e9a513a23c0c0d252334e79c351512d7355e
2021-09-13 23:53:34 +02:00
Matthias Sohn 81cd70d5d0 Prepare 5.13.1-SNAPSHOT builds
Change-Id: Ib2f689d8d13eab022da5b5e83d6d6bebc1bb81d3
2021-09-08 20:24:36 +02:00
Matthias Sohn b3d51a399e JGit v5.13.0.202109080827-r
Change-Id: If3b2d4256712cc7e577c23e75c0d4ad940870e72
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-08 14:27:06 +02:00
Matthias Sohn efdc03e164 Prepare 5.13.0-SNAPSHOT builds
Change-Id: I2a1d7ab24d5ca718348f4ce3cda351553e48cd1f
2021-09-01 20:00:56 +02:00
Matthias Sohn 4949a295df JGit v5.13.0.202109011149-rc1
Change-Id: Id8d0970102f18e61a2fc7cf941267c9089d71c1a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-01 16:49:12 +02:00
Matthias Sohn 574e899051 Prepare 5.13.0-SNAPSHOT builds
Change-Id: I6db044fdd57b60adbc2dd078c4af8cb54bb331c3
2021-08-25 22:33:09 +02:00
Matthias Sohn a38ea8ede7 JGit v5.13.0.202108250949-m3
Change-Id: Icc079b28327f5a02256f9a06837c2be6352ea6e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-08-25 15:49:20 +02:00
Matthias Sohn ca969ecc61 Relax version range for hamcrest and assertj
We currently cannot use hamcrest 2.2 and assertj 3.20.2 (which requires
hamcrest 2.2) in egit tests since other Eclipse dependencies (e.g.
swtbot) require hamcrest 1.1.

Hence relax version range for these components in jgit so that jgit
tests also work when using the egit target platform.

Change-Id: I521e2ec4491bd8d790609b8a66a8f14511a865a1
2021-07-19 12:32:26 +02:00
Matthias Sohn e0ba98edd2 Update orbit to I20210711110031
and update
- assertj to 3.20.2.v20210706-1104
- hamcrest to 2.2.0.v20210711-0821
  - classes which were in org.hamcrest.core 1.3 and org.hamcrest.library
    1.3 were all moved to org.hamcrest in 2.2
  - the annotation org.hamcrest.Factory was removed and is no longer
    needed
  - junit 4.13 requires hamcrest-core and hamcrest-library 1.3 therefore
    keep them in the target platform

CQ: 23501
Change-Id: Ife871c0343b611be9203aed7f86577e85bbf5c95
2021-07-16 23:47:29 +02:00
Thomas Wolf 27a1fa1872 [sshd] Implement SSH config KexAlgorithms
Make the used KEX algorithms configurable via the ssh config. Also
implement adding algorithms not in the default set: since sshd 2.6.0
deprecated SHA1-based algorithms, it is possible that the default set
has not all available algorithms, so adding algorithms makes sense.

This enables users who have to use a git server that only supports
old SHA1-based key exchange methods to enable those methods in the
ssh config:

  KexAlgorithms +diffie-hellman-group1-sha1

There are two more SHA1 algorithms that are not enabled by default:
diffie-hellman-group14-sha1 and diffie-hellman-group-exchange-sha1.
KeyAlgorithms accepts a comma-separated list of algorithm names.

Since adding algorithms is now supported, adapt the handling of
signature algorithms, too. Make sure that definitions for the KEX
exchange signature (HostKeyAlgorithms) don't conflict with the
definition for signatures for pubkey auth (PubkeyAcceptedAlgorithms).

HostKeyAlgorithms updates the signature factories set on the session
to include the default factories plus any that might have been added
via the SSH config. Move the handling of PubkeyAcceptedAlgorithms
from the client to the JGitPubkeyAuthentication, where it can be done
only if pubkey auth is attempted at all and where it can store its
adapted list of factories locally.

Bug: 574636
Change-Id: Ia5d5f174bbc8e5b41e10ec2c25216d861174e7c3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-16 08:45:23 +02:00
Thomas Wolf 66c9c7bf87 Update target platform to I20210626190330
Update
- com.google.gson to 2.8.7.v20210624-1215
- javaewah to 1.1.12.v20210622-2206
- org.apache.sshd.osgi to 2.7.0.v20210623-0618
- org.apache.sshd.sftp to 2.7.0.v20210623-0618
- org.tukaani.xz to 1.9.0.v20210624-1259
- Apache MINA sshd to 2.7.0
  - Remove work-arounds for problems resolved upstream since 2.6.0, and
    adapt to upstream API changes.
- update DEPENDENCIES.

CQ: 23469
CQ: 23470
CQ: 23496
CQ: 23497
CQ: 23498
Bug: 574220
Change-Id: I898b216c3492f8488fbf25fa4b49f1250f86f3c8
Also-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-07-06 13:22:38 +02:00
Matthias Sohn 1cbfea9ece Prepare 5.13.0-SNAPSHOT builds
Change-Id: Ie9cfc1eeb0eda7b2bbe744a22a7e4cfe6d59bc37
2021-06-14 01:49:05 +02:00