Skip to content

Remove DIGEST-MD5 authentication from LDAP connections - #127

Open
opravil-jan wants to merge 15 commits into
apache:masterfrom
opravil-jan:feat/remove-digest-md5
Open

opravil-jan wants to merge 15 commits into
apache:masterfrom
opravil-jan:feat/remove-digest-md5

Conversation

@opravil-jan

Copy link
Copy Markdown

Summary

This PR removes DIGEST-MD5 as an authentication method for LDAP connections.

  • DIGEST-MD5 is historic (RFC 6331, 2011).
  • Its security layer ciphers are broken or disallowed:
    • 3DES: NIST SP 800-131A Rev. 2;
    • RC4: RFC 7465;
    • DES.
  • Current servers can no longer use them:
    • OpenSSL 3 moved RC4 and DES to the legacy provider.
    • The Cyrus SASL 2.1.28 DIGEST-MD5 plugin with OpenSSL 3 fails to init 3DES, which is what the Java client picks. This is the case on Alpine, CentOS Stream 9 and openSUSE.
    • The Alpine build even reports a successful bind, then the connection breaks.

Simple authentication over StartTLS or LDAPS, or GSSAPI, are the secure alternatives.

It builds on #126 (and #125) and contains their commits; review the last commit only, or merge those first.

Changes

  • Connections:
    • The New Connection wizard and the connection properties no longer offer DIGEST-MD5. The SASL realm field, which only DIGEST-MD5 used, is removed.
    • AuthenticationMethod.SASL_DIGEST_MD5 remains, deprecated. Stored connections and LDAP URLs (X-AUTH-METHOD=DIGEST-MD5) that use it still load, and nothing is changed silently:
      • Opening such a connection fails with "DIGEST-MD5 authentication is no longer supported. Edit the connection and choose another authentication method …", without sending a bind request.
      • Its properties show no authentication method and an error, and can only be applied after another method is chosen.
  • Connection properties: an error on any tab now prevents applying the properties, and it shows as soon as the dialog opens. Before, an error only showed on the selected tab and only after a change, and a fixed error message was never cleared.
  • Not changed: the ApacheDS and OpenLDAP configuration editors (replication and syncrepl SASL settings). They edit server configurations, which may still contain DIGEST-MD5.
  • Tests:
    • The DIGEST-MD5 connection tests are removed. New tests cover the bind error and the properties dialog of a stored DIGEST-MD5 connection.
    • The SASL confidentiality-required core test uses CRAM-MD5 instead.
  • Test lab: the OpenLDAP image no longer installs the DIGEST-MD5 plugin, and the ApacheDS test server no longer enables it.
  • Help: the authentication method lists and the SASL realm rows are updated.

Testing

The Jenkins Linux stage was reproduced locally with the pinned test lab.

The full build passed apart from one UI test (27:53 min):

  • Core integration tests: 93 run, 0 failures, 1 skipped (105 before; the DIGEST-MD5 tests are removed).
  • UI tests: 417 run, 0 failures, 1 error, 8 skipped.
    • The error was in BrowserTest.testBrowseWithPagingWithScrollMode: a 40 s timeout waiting for the Read Attributes job. That test is not related to this change and passed in the four earlier full runs.
    • Two reruns of BrowserTest passed: 28 run, 0 failures each.
  • The new ConnectionViewTest.testConnectionWithDigestMd5RequiresAnotherAuthenticationMethod failed before the connection properties validation fix and passes with it.

Migration

Users with DIGEST-MD5 connections need to choose another method; Studio tells them when they open the connection or its properties.

🤖 Generated with Claude Code

opravil-jan and others added 15 commits November 25, 2026 19:01
The antlr-maven-plugin runs antlr.Tool in-process and traps its
System.exit() with a SecurityManager. Java 18+ no longer allows
installing a SecurityManager, so the OpenLDAP ACL editor does not build
on current JDKs.

Run antlr.Tool with exec-maven-plugin in a separate JVM instead and add
the generated sources with build-helper in pom-first.xml. The
exec-maven-plugin version is now managed in the root POM (3.7.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eclipse 4.41 requires Java 21, so the build and the product now target
Java 21 (maven.compiler.release, osgi.requiredJavaVersion).

Build:
- Tycho 2.3.0 -> 5.0.4 (needs Maven 3.9.9+), parent POM 48 -> 52.
- pom-first.xml of the target platform uses 'pom' packaging, because
  Tycho 5 resolves an eclipse-target-definition before the local p2
  repository it refers to has been built. The generated .target is
  attached with build-helper, so it is still installed.

Target platform:
- Eclipse 4.41, SWTBot 4.3.0, Orbit 4.41, Babel R0.20.0.
- Drop what Eclipse 4.41 no longer ships: javax.xml,
  javax.xml.stream, jdt.launching.macosx, org.eclipse.osgi.services,
  source features, explicit EMF/ECF product features and missing
  Babel fragments.
- dom4j from Orbit (org.dom4j 2.2.0) instead of the ServiceMix bundle,
  whose javax.xml.stream [1.0,2) import no longer resolves cleanly.
- slf4j-api 1.7.36 is published locally (LDAP API and ApacheDS import
  [1.7,1.8), Eclipse ships 2.x); slf4j-nop only satisfies
  org.slf4j.impl while the target is resolved.
- commons-logging 1.2 is published locally for httpclient.

Libraries: commons-codec 1.23.0, collections4 4.6.0, io 2.22.0,
lang3 3.22.0, pool2 2.13.1, text 1.15.0, httpclient 4.5.14,
httpcore 4.4.16, BouncyCastle 1.87 (jdk18on + bcutil), Caffeine 2.9.3,
MINA 2.1.15, slf4j 1.7.36, JUnit 5.14.4 / Platform 1.14.4,
hamcrest 3.0.0, skin 1.0.3.

LDAP API stays on 2.1.0 and MINA on 2.1.x: ApacheDS 2.0.0.AM26 uses
SslFilter.DISABLE_ENCRYPTION_ONCE (removed in MINA 2.2) and LDAP API
2.1.1+ requires MINA 2.2. ApacheDS 2.0.0.AM27 cannot be used because
several of its bundles miss an Import-Package for
org.apache.directory.api.ldap.model.schema.registries.

Code: replace the removed IPageLayout.ID_RES_NAV and
setShowFastViewBars APIs.

BREAKING CHANGE: building and running Directory Studio requires Java 21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POI 3.9 -> 6.0.0 for the XLS export. POI 5+ needs commons-math3,
  SparseBitSet and log4j-api, which are embedded next to it, and
  commons-io, commons-codec and commons-collections4 packages, which
  are imported. ExportXlsRunnable uses CellType instead of the removed
  CELL_TYPE_* constants. The embedded jar names now come from the
  version properties.
- xerces 2.11.0 -> 2.12.2 (embedded in ldapbrowser.core).
- FOP and xmlgraphics-commons 2.9 -> 2.12, xalan 2.7.2 -> 2.7.3 plus
  its serializer, which is a separate artifact since 2.7.3, and
  ant-apache-regexp 1.10.14 -> 1.10.18 for the help and user guide
  generation.

odftoolkit stays on 0.8.8 / 0.7: odfdom 0.13 pulls about 20 additional
jars and should be a separate change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build requires Java 21, so the GitHub workflows now build with
JDK 21 and 25 (the JDK 11 workflow is removed, the JDK 17 one becomes
JDK 25) and the Jenkins stages run on Java 21 only.

Update actions/checkout to v7.0.1, actions/setup-java to v6.3.0,
actions/upload-artifact to v7.0.2, github/codeql-action to v4.39.5 and
ossf/scorecard-action to v2.6.0, keeping each workflow's existing
pinning style (SHA in the build and Scorecard workflows, version tags
in CodeQL). CodeQL now sets up JDK 21 explicitly instead of relying on
the runner's default JDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit 9f40267 (German translation improvements) replaced the
hard-coded view and category name "LDAP Servers" with
%View_ServersView_name, which is "Servers" in plugin.properties. That
renamed the view and its Show View category in the English UI, and
the UI tests no longer found the "LDAP Servers" view.

Set the English view name back to "LDAP Servers" and use the existing
View_Category_name key for the category. The German names are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The product now contains two slf4j.api bundles: 1.7.36 for the LDAP API
and ApacheDS, and 2.x from the Eclipse platform. The template editor
and the OpenLDAP ACL editor imported org.slf4j without a version, so
they could be wired to slf4j 2.x and bypass the slf4j-eclipselog
binding. Use the same range as the LDAP API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two problems in the dependencies update site (p2repositories/dependencies),
which mirrors the local target platform repository:

- org.dom4j comes from Eclipse Orbit and was missing from the update
  site, so installing the LDAP Browser into an Eclipse IDE failed on
  the org.dom4j import. Mirror that one IU from Orbit as well.
- slf4j-nop, needed only to resolve the target platform, was published,
  so p2 could pick it as the org.slf4j.impl provider and drop all LDAP
  API logging. Publish it into a separate resolution-only repository
  that is not mirrored.

Also define the versions that were written twice (dom4j, ServiceMix
ANTLR, JUnit, the Orbit URL) once as properties, and note in the rcp
feature that its slf4j.api version must match org.slf4j.bundleversion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tycho 5 needs Maven 3.9.9 or newer, but not 3.10: Maven 3.10.x
(Resolver 2.0) fails to resolve the bundles' dependencies with
"Invalid Collect Request: null". The build environments have neither:
the Jenkins image apachedirectory/maven-build:jdk-21 ships Maven 3.9.6
and GitHub's Ubuntu runners ship Maven 3.10.1.

Add the Maven Wrapper (only-script, with the distribution's SHA-256
checksum) and use it in Jenkins, the CodeQL workflow, build.sh,
build.bat and the build instructions. The testlab instructions now
use the jdk-21 image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Eclipse 4.41 labels the menu item "Preferences..." and titles the
  new wizard dialog "New" (the page title is "Select a wizard").
- Since ea38b9c a new (empty) DN value is edited in multi-select mode:
  a list with Add and Remove buttons instead of a combo with Browse.
  The DN editor bot gets an Add button and a list accessor; the entry
  editor and alias entry tests use them for new values. Existing
  values still use the single-DN dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SWTBot UI tests were never run by the GitHub workflows, and the
Jenkins pipeline stops before them because of failing core
integration tests against OpenLDAP/389ds.

Run the main build with -Denable-ui-tests under xvfb-run with metacity.
The tests need a window manager: without one, no shell is active
after a dialog closes. On failure, upload the surefire reports and the
UI test screenshots. Both workflows now use the Maven Wrapper. The
README explains how to run the UI tests locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Java DIGEST-MD5 client picks the 3DES cipher for auth-conf, and the
Cyrus SASL DIGEST-MD5 plugin that the 389ds test image installs from
openSUSE fails with "failed to init cipher '3des'" (RC4 and DES work).
Exclude 389ds from the three tests that request auth-conf until 3DES
works again in that plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apachedirectory/maven-build:jdk-21 is published for arm64 only, so it
cannot run on the amd64 agents, and it has no window manager for the UI
tests. The pipeline now builds tools/testlab/build-image (Temurin 21,
GTK, Xvfb, metacity, dbus, krb5-user) and runs the build like the
GitHub workflows: xvfb-run, dbus-run-session and metacity. HOME and
user.home point to /tmp/home, because the Jenkins user has no home
directory in the image.

The 389ds container installs the DIGEST-MD5 and GSSAPI SASL plugins at
start. Since openSUSE rotated its signing key in 2026, zypper skipped
every repository, the plugins were missing and the SASL tests against
389ds failed. Import the current key first, and use --replacefiles,
because the current packages conflict with OpenSSL 1.1 in the 2.2 image.
389ds stays on 2.2: 2.4 and later answer operations below a referral
entry with noSuchObject instead of a referral.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test lab pulled floating images and installed openSUSE Tumbleweed
packages into a 2022 389ds image at every start, so upstream changes
broke the Jenkins pipeline. Each server is now built from a Dockerfile
in tools/testlab that pins its base image by version and digest, and
Dependabot proposes updates.

- OpenLDAP 1.5.0 -> osixia/openldap 2.6.15: adds the CRAM-MD5,
  DIGEST-MD5 and GSSAPI SASL plugins, a self-signed certificate, the
  test credentials, {SSHA} password hashing and the OpenSSL 3 legacy
  provider for the DIGEST-MD5 RC4 and DES layers. The test config uses
  OpenSSL cipher syntax.
- 389ds 2.2 -> quay.io/389ds/dirsrv:c9s (2.6.1), which ships the SASL
  plugins. Its update-through-referral tests exclude 389ds until
  389ds/389-ds-base#8196 is fixed.
- Kerby and the build image are pinned by digest.
- DIGEST-MD5 auth-conf with 3DES fails with the Cyrus SASL plugins of
  both images, so those tests exclude them; the GSSAPI auth-conf UI
  tests require ssf 56, which the Heimdal-based plugin reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The OpenLDAP test image enabled the OpenSSL 3 legacy provider so that
the Cyrus DIGEST-MD5 plugin could use RC4 and DES. These ciphers are
broken, as is the 3DES the Java client otherwise picks and the plugin
cannot init, and DIGEST-MD5 itself is historic (RFC 6331). The test
images no longer enable the legacy provider. The DIGEST-MD5 auth-conf
tests now exclude OpenLDAP as well, and the UI tests with no server
left are disabled with the reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIGEST-MD5 is historic (RFC 6331) and its security layer ciphers 3DES,
RC4 and DES are broken or disallowed. Current servers can no longer use
them: OpenSSL 3 has RC4 and DES only in its legacy provider, and the
Cyrus SASL DIGEST-MD5 plugin fails to init 3DES, which the Java client
picks.

The connection wizard and properties no longer offer DIGEST-MD5 or the
SASL realm field. AuthenticationMethod.SASL_DIGEST_MD5 stays, deprecated,
so stored connections and LDAP URLs still load. Binding with it fails
with a message to choose another method, and its properties can only be
applied after another method is chosen. The connection properties now
show an error of any tab when they open and clear it once it is fixed.

The ApacheDS and OpenLDAP configuration editors keep DIGEST-MD5, since
server configurations may still use it.

BREAKING CHANGE: DIGEST-MD5 connections no longer bind; users need to
choose another authentication method, such as Simple authentication
with StartTLS or LDAPS, or GSSAPI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant