Commit Graph

236 Commits

Author SHA1 Message Date
Matthias Sohn ff20da9b89 Enable using slf4j 2.x
Eclipse platform moved to sfl4j 2.x. Hence relax version constraint so
that both 1.7 and 2.x are allowed.

Bug: egit-5
Change-Id: Ie0b00310d8f3f2553457c8668a38978a67b8febe
2023-12-22 23:20:41 +01:00
Matthias Sohn b54592c8ee Prepare 6.9.0-SNAPSHOT builds
Change-Id: Id1d784ec4870cfb53c4b140fe0bb3fad9eef651d
2023-12-04 23:02:44 +01:00
Matthias Sohn 796fb2e5c7 Prepare 6.8.1-SNAPSHOT builds
Change-Id: I56458c5345dcd9544868c948e90c9827d25c6850
2023-11-29 16:53:24 +01:00
Matthias Sohn c43560487b JGit v6.8.0.202311291450-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Iecfe3f628cfdc437ee0d63fe52653ef952c8c494
2023-11-29 15:49:43 +01:00
Matthias Sohn 9a05ca42ba Prepare 6.8.0-SNAPSHOT builds
Change-Id: I89178175549541111cddb88da401899960c0ecac
2023-11-22 01:41:02 +01:00
Matthias Sohn 7bc697dfde JGit v6.8.0.202311212206-rc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I6a40cdef68538fa769f4525eb2ff1ed4a810f11c
2023-11-21 23:05:56 +01:00
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 6007371e3a Enable Maven reproducible builds
- configure Maven to run build reproducibly [1]
- use UTC timestamp of checked out commit as build timestamp
- add git-describe, git-commit-id, git-commit-id, git-tags,
  git-remote-origin-url to MANIFEST.MF files
- configure cyclonedx-maven-plugin to also use UTC timestamp of
  checked out commit
- for packaging build use tycho-buildtimestamp-jgit [2] to ensure
  version uses the timestamp of the last commit
- SBOMs are not reproducible by design [3] they should have a build
  timestamp matching the time when the build was executed and a serial
  number which is a unique UUID per build run. Hence exclude them from
  comparison [4].
- Use gmavenplus-plugin to format build timestamps. Maven expects
  build timestamp in ISO-8601 format, to replace the qualifier in
  versions the timestamp format must be compatible with rules for OSGi
  version numbers. Didn't find a way to read the properties set by the
  git-commit-id-maven-plugin from another plugin. Hence use JGit in a
  groovy script to get the commit time of the current HEAD and provide
  it in these two formats.

TODO: packaging build (features and p2 repository) is not yet binary
reproducible since that's not yet supported by Tycho [5], artefacts have
reproducible version numbers but file lastModified timestamps are not
yet reproducible.

Test plan for Maven build:
- build using
  mvn clean install"
- verify second build is reproducible:
  mvn -T1 clean verify artifact:compare
  verification seems not to be thread-safe, hence run it with a single
  thread using option -T1

For packaging build (still fails due to non-reproducible file
timestamps):
- build using
  mvn -f org.eclipse.jgit.packaging/pom.xml clean install
- verify second build is reproducible:
  mvn -T1 -f org.eclipse.jgit.packaging/pom.xml clean verify artifact:compare

[1] https://maven.apache.org/guides/mini/guide-reproducible-builds.html
[2] https://wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers
[3] https://github.com/CycloneDX/cyclonedx-maven-plugin/issues/84
[4] https://maven.apache.org/plugins/maven-artifact-plugin/compare-mojo.html
[5] https://github.com/eclipse-tycho/tycho/issues/233

Change-Id: I0202f55a1b6ae0edd922cfef638beb39d2ce9417
2023-11-09 00:08:42 +01:00
Matthias Sohn 0b5d4c3aad Use net.i2p.crypto.eddsa 0.3.0 from new Orbit build
consuming it directly from Maven Central.

The bundle net.i2p.crypto.eddsa 0.3.0 contains bad OSGi metadata,
earlier it was repackaged in Orbit tweaking its mandatory dependency to
sun.security.x509 to an optional dependency.

This project seems to be orphaned, probably because Java 15 added
support for eddsa with JEP339 [1].

This repackaged bundle is no longer available after Orbit was renovated
[2] to consume the vast majority of bundles directly from Maven Central
without repacking them. Hence we have to workaround this (probably
false) mandatory dependency. For that export an empty dummy package
"sun.security.x509" to satisfy OSGi.

[1] https://openjdk.org/jeps/339
[2] https://github.com/eclipse-orbit/orbit-simrel/issues/15

Change-Id: I2267e15823ebce6cf1d448e1e16a129f703e0f80
2023-10-13 21:24:11 +02:00
Matthias Sohn 4cfe27dd06 [errorprone] Suppress ByteBufferBackingArray
The byte buffers used here are created by wrapping a byte[].

See https://errorprone.info/bugpattern/ByteBufferBackingArray

Change-Id: Idbc16d5ae4ff9f64b97be07a3cdf190716da191f
2023-09-25 22:06:12 +02:00
Matthias Sohn bf92bb9bca [errorprone] Suppress MissingSummary for translation bundles
Change-Id: I4da51c7e089366b016a0cc64f768a151c24bc956
2023-09-25 22:06:12 +02:00
Matthias Sohn e908e297db Merge "OSGi: move plugin localization to subdirectory" 2023-09-12 16:39:19 -04:00
Thomas Wolf e3798df6e8 OSGi: move plugin localization to subdirectory
OSGi can have its plugin localization at an arbitrary place; there is
no need to have it in a top-level plugin.properties file. In non-OSGi
environments having the files at the root level may mean that these
files clash with each other, or, as in the referenced bug, with some
third-party plug-in's plugin.properties, which may not even have
anything to do with localization.

Move our OSGi localization to a subfolder OSGI-INF/l10n. For OSGi
environments, that's just as good, and for non-OSGi environments it
avoid clashes with other root level items on the classpath or in a fat
JAR.

For fragments, use neither plugin.properties (which would clash with the
host plug-in's plugin.properties) nor fragment.properties (which might
clash with other fragments for the same fragment host bundle). Instead
use names "relative" to the host bundle.

Bug: 582394
Change-Id: Ifbcd046d912e2cfe86c0f7259c5ca8de599d9aa1
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-12 20:27:59 +02:00
Jonathan Nieder 3bc1da30df ssh: Remove redundant null check for home.getAbsoluteFile()
File#getAbsoluteFile is non-nullable, so this check can never trigger.
Worse, getAbsoluteFile can throw an exception such as
InvalidPathException, and since this call isn't in the "try" block
that checks for that, the exception would then escape the getSession
call.

Noticed because the exception is being thrown in googlesource.com's
custom SshdSessionFactory, causing incoming ssh requests to fail
(noticed using internal tests).

Change-Id: I57f2d5e497ff678b17573f79827b6e1d9a6c9b9f
Signed-off-by: Jonathan Nieder <jrn@google.com>
2023-09-11 17:12:17 -07:00
Matthias Sohn 3a3b72cf90 Prepare 6.8.0-SNAPSHOT builds
Change-Id: Ifc81f0a96c2ced0b25926b9daa539d9cfc951925
2023-09-07 02:24:53 +02:00
Matthias Sohn 6416de9563 Merge branch 'stable-6.7'
* stable-6.7:
  Prepare 6.7.1-SNAPSHOT builds
  Switch back to wagon-ssh-external
  Fix generation of maven site
  JGit v6.7.0.202309050840-r
  Remove unused API problem filters
  [releng] Bump japicmp base version to 6.6.0.202305301015-r
  Fix list of 3rd party bundles in p2 repo
  Add missing source bundle org.osgi.service.cm.source to target platform
  Prepare 6.6.2-SNAPSHOT builds
  JGit v6.6.1.202309021850-r
  Checkout: better directory handling
  Document commit-graph options supported by JGit
  Fix warning raised for local variable hiding DfsPackFile#index
  Suppress boxing warnings in DfsPackFile
  Remove unused API problem filters
  Suppress boxing warnings in tests
  Fix warning about empty block
  Update mockito to 5.5.0
  Update byte-buddy to 1.14.7
  Prepare 6.7.0-SNAPSHOT builds
  JGit v6.7.0.202308301100-rc1

Change-Id: Ib2a1000ead5ca6cf3816e9e9496ad5d92f4dc963
2023-09-07 02:24:08 +02:00
Matthias Sohn bb12dd4cbd Prepare 6.7.1-SNAPSHOT builds
Change-Id: I96097ef8c6f198220f513bbc6d5f8881834a1491
2023-09-07 02:03:54 +02:00
Minh Thai ba1653162c Ensure home directory not null before using in Sshdsessionfactory
Home directory might not be set in DFS.

Change-Id: I3528685838065dc291826fc73a37126af7bf47ce
2023-09-06 07:13:05 -07: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 de7b5b7b26 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I936d2d9106a1e3b7a98ec89fec8ae8a92ec765f2
2023-08-03 00:05:50 +02:00
Matthias Sohn 1d26471c16 JGit v6.7.0.202308011830-m2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I255a979e9f48f60a251ef7b74ced3f720f012706
2023-08-02 00:30:01 +02:00
Han-Wen Nienhuys ba8f3cb1f2 Fix errorprone warning about precedence
The condition looks suspicious, as in case of

  (hasElement==null && hasNext())

the check will generate a NPE

Change-Id: I267f9df6746393d72f5102bd5271441422550968
2023-08-01 14:48:51 +02:00
Thomas Wolf 23758d7a61 ssh: PKCS#11 support
Support PKCS#11 HSMs (like YubiKey PIV) for SSH authentication.

Use the SunPKCS11 provider as described at [1]. This provider
dynamically loads the library from the PKCS11Provider SSH configuration
and creates a Java KeyStore with that provider. A Java CallbackHandler
is needed to feed PIN prompts from the KeyStore into the JGit
CredentialsProvider framework. Because the JGit CredentialsProvider may
be specific to a SSH session but the PKCS11Provider may be used by
several sessions, the CallbackHandler needs to be configurable per
session.

PIN prompts respect the NumberOfPasswordPrompts SSH configuration. As
long as the library asks only for a PIN, we use the KeyPasswordProvider
to prompt for it. This gives automatic integration in Eclipse with the
Eclipse secure storage, so a user has even the option to store the PIN
there. (Eclipse will then ask for the secure storage master password on
first access, so the usefulness of this is debatable.)

By default the provider uses the first PKCS#11 token (slot list index
zero). This can be overridden by a non-standard PKCS11SlotListIndex
ssh configuration entry. (For OpenSSH interoperability, also set
"IgnoreUnknown PKCS11SlotListIndex" in the SSH config file then.)

Once loaded, the provider and its shared library and the keys
contained remain available until the application exits.

Manually tested using SoftHSM. See file manual_tests.txt. Kudos to
Christopher Lamb for additional manual testing with a real YubiKey,
also on Windows.[2]

[1] https://docs.oracle.com/en/java/javase/11/security/pkcs11-reference-guide1.html
[2] https://www.eclipse.org/forums/index.php/t/1113295/

Change-Id: I544c97e1e24d05e28a9f0e803fd4b9151a76ed11
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-07-17 04:52:30 -04:00
Antoine Musso 7b955048eb Fix all Javadoc warnings and fail on them
This fixes all the javadoc warnings, stops ignoring doclint 'missing'
category and fails the build on javadoc warnings for public and
protected classes and class members.

Since javadoc doesn't allow access specifiers when specifying doclint
configuration we cannot set `-Xdoclint:all,-missing/private`
hence there is no simple way to skip private elements from doclint.
Therefore we check javadoc using the Eclipse Java compiler
(which is used by default) and javadoc configuration in
`.settings/org.eclipse.jdt.core.prefs` files.
This allows more fine grained configuration.

We can reconsider this when javadoc starts supporting access specifiers
in the doclint configuration.

Below are detailled explanations for most modifications.

@inheritDoc
===========
doclint complains about explicits `{@inheritDoc}` when the parent does
not have any documentation. As far as I can tell, javadoc defaults to
inherit comments and should only be used when one wants to append extra
documentation from the parent. Given the parent has no documentation,
remove those usages which doclint complains about.

In some case I have moved up the documentation from the concrete class
up to the abstract class.

Remove `{@inheritDoc}` on overriden methods which don't add additional
documentation since javadoc defaults to inherit javadoc of overridden
methods.

@value to @link
===============
In PackConfig, DEFAULT_SEARCH_FOR_REUSE_TIMEOUT and similar are forged
from Integer.MAX_VALUE and are thus not considered constants (I guess
cause the value would depends on the platform). Replace it with a link
to `Integer.MAX_VALUE`.

In `StringUtils.toBoolean`, @value was used to refer to the
`stringValue` parameter. I have replaced it with `{@code stringValue}`.

{@link <url>} to <a>
====================
@link does not support being given an external URL. Replaces them with
HTML `<a>`.

@since: being invalid
=====================

org.eclipse.jgit/src/org/eclipse/jgit/util/Equality.java has an invalid
tag `@since: ` due to the extra `:`. Javadoc does not complain about it
with version 11.0.18+10 but does with 11.0.19.7. It is invalid
regardless.

invalid HTML syntax
===================

- javadoc doesn't allow <br/>, <p/> and </p> anymore, use <br> and <p>
instead
- replace <tt>code</tt> by {@code code}
- <table> tags don't allow summary attribute, specify caption as
<caption>caption</caption> to fix this

doclint visibility issue
========================

In the private abstract classes `BaseDirCacheEditor` and
`BasePackConnection` links to other methods in the abstract class are
inherited in the public subclasses but doclint gets confused and
considers them unreachable. The HTML documentation for the sub classes
shows the relative links in the sub classes, so it is all correct. It
must be a bug somewhere in javadoc.
Mute those warnings with: @SuppressWarnings("doclint:missing")

Misc
====
Replace `<` and `>` with HTML encoded entities (`&lt; and `&gt;`).
In `SshConstants` I went enclosing a serie of -> arrows in @literal.

Additional tags
===============
Configure maven-javad0c-plugin to allow the following additional tags
defined in https://openjdk.org/jeps/8068562:
- apiNote
- implSpec
- implNote

Missing javadoc
===============
Add missing @params and descriptions

Change-Id: I840056389aa59135cfb360da0d5e40463ce35bd0
Also-By: Matthias Sohn <matthias.sohn@sap.com>
2023-06-16 01:08:13 +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 228e4de484 Merge branch 'stable-6.5'
* stable-6.5:
  Rerun flaky tests 3 times
  Prepare 6.5.1-SNAPSHOT builds
  JGit v6.5.0.202303070854-r
  Ignore generated org.eclipse.jgit.benchmarks/dependency-reduced-pom.xml
  [sshd] Fix calculation of timeout in AbstractClientProxyConnector
  Silence API error raised for removed BranchRebaseMode#PRESERVE

Change-Id: Ie615980c81371ee26b2395e67e026bbd17422fbd
2023-03-07 16:41:19 +01:00
Matthias Sohn 8dcb02140d Prepare 6.5.1-SNAPSHOT builds
Change-Id: Idd9977ac08a339906e33beb73f57f8f6885ad86f
2023-03-07 16:39:19 +01:00
Matthias Sohn c72dd241f4 JGit v6.5.0.202303070854-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I8da37ead0bd527bc4990ed5f8d5d4fb4f4d5cf01
2023-03-07 14:54:32 +01:00
Stephan Wahlbrink 47ecb0096e [sshd] Fix calculation of timeout in AbstractClientProxyConnector
The previous implementation mixed nano seconds (elapsed) and milli
seconds (remaining) without conversion.

Change-Id: I9e1654afa47fa32c94808af3b2dd0418a372fb00
2023-03-06 23:45:18 +01:00
Matthias Sohn f34ae6fe31 Prepare 6.6.0-SNAPSHOT builds
Change-Id: I17893f9db12bcb208866f40a06cd4f1ccbb4fe30
2023-03-01 15:40:45 +01:00
Matthias Sohn 69671a7026 Prepare 6.5.0-SNAPSHOT builds
Change-Id: I313e3deed8fa00df0406b3d7b73e5b643dc25a05
2023-03-01 15:30:29 +01:00
Matthias Sohn f43560a760 JGit v6.5.0.202302281825-rc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I1eb2e87b70c2da1dc81468cdc7ecf7dbd21d4190
2023-03-01 00:23:58 +01:00
Matthias Sohn b4fc53e2d1 Prepare 6.5.0-SNAPSHOT builds
Change-Id: Ie95ce8fcc2a570505d23d5a1642e33c041212260
2023-03-01 00:10:18 +01:00
Matthias Sohn 2ca587b36e JGit v6.5.0.202302221508-m3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I00bf91823e2fe6503d52ae23bc1854f0b1d66dbd
2023-02-22 21:09:10 +01:00
Matthias Sohn 63326d1036 Prepare 6.5.0-SNAPSHOT builds
Change-Id: Id0c7e51293d53b1eeec081cbbdf6e27d77123200
2023-02-01 23:23:08 +01:00
Matthias Sohn 8b78e6fdcd JGit v6.5.0.202302011120-m2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I231d3f9b8a59e374477d3a33964061acb2c25ce4
2023-02-01 17:22:23 +01:00
Matthias Sohn f46f30cdc2 Prepare 6.5.0-SNAPSHOT builds
Change-Id: I6fbda9ad8e054a664cb79c3a32baded12ad6802f
2023-01-11 20:44:18 +01:00
Matthias Sohn a549ef002f JGit v6.5.0.202301111425-m1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I4e81d5c61d66f748e0c5bc86d95f579b5990e9f4
2023-01-11 20:24:40 +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
Thomas Wolf cbf0d9a76c [sshd] Guard against numerical overflow
Check the key length before adding; the addition might overflow.

Change-Id: Icde7c92a5bb267fdd869d5a1c0842967ab1a7fd9
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-10-01 20:45:34 +02: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