GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [improve][client] Use SHA-256 for generated reader subscription names by david-streamlio · Pull Request #26153 · apache/pulsar

Conversation

@david-streamlio

@david-streamlio david-streamlio commented Jul 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

When a reader is created without an explicit subscription name, ReaderImpl/MultiTopicsReaderImpl generate one by hashing a random UUID with SHA-1 (DigestUtils.sha1Hex). The hash is not a security control — it just produces a short random identifier — but strict security providers reject SHA-1: under BC-FIPS in approved-only mode the call throws, so creating a reader without a subscription name fails on FIPS-configured JVMs.

This is one of a set of small preparatory cleanups for FIPS-restricted deployments; a broader PIP is being drafted separately.

Modifications

Replaced DigestUtils.sha1Hex(...) with DigestUtils.sha256Hex(...) in the generated-subscription-name paths of ReaderImpl and MultiTopicsReaderImpl. The generated names keep the same shape (reader- / multiTopicsReader- prefix + 10 hex chars) and entropy (40 bits of a hash over a random UUID). The names are ephemeral, used for non-durable subscriptions, and never persisted, so nothing is observable across versions.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage. (Existing reader tests, e.g. ReaderImplTest, exercise the generated-name path.)

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@david-streamlio
[improve][client] Use SHA-256 for generated reader subscription names
5409f5d
The auto-generated reader subscription name hashed a random UUID with
SHA-1. The hash is not a security control, but SHA-1 is rejected by strict
security providers (e.g. BC-FIPS in approved-only mode), which would make
readers without an explicit subscription name fail on FIPS-configured JVMs.
The generated names are ephemeral and never persisted, so the change is not
observable across versions.
@david-streamlio
david-streamlio force-pushed the fips-qw-reader-subscription-hash branch from adbcd25 to 5409f5d Compare July 6, 2026 17:16
This was referenced Jul 6, 2026
[improve][pip] PIP-489: FIPS 140-3 compliance mode for Apache Pulsar #26155
Open
[fix][ci] Update setup-gradle action to v6.2.0 to match ASF actions allowlist #26156
Merged
@david-streamlio
Merge remote-tracking branch 'upstream/master' into fips-qw-reader-su…
2c195d3
…bscription-hash
@david-streamlio
david-streamlio requested a review from Copilot July 7, 2026 14:02
Copilot started reviewing on behalf of david-streamlio July 7, 2026 14:03
View session
Copilot AI reviewed Jul 7, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Pulsar client compatibility with FIPS-restricted JVMs by removing SHA-1 usage from autogenerated reader subscription names, which can fail under strict security providers.

Changes:

  • Switch ReaderImpl autogenerated subscription name hashing from SHA-1 to SHA-256.
  • Switch MultiTopicsReaderImpl autogenerated subscription name hashing from SHA-1 to SHA-256 (keeping the same prefix + 10-hex-char shape).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ReaderImpl.java Replace DigestUtils.sha1Hex(...) with DigestUtils.sha256Hex(...) for generated reader subscription names.
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsReaderImpl.java Replace DigestUtils.sha1Hex(...) with DigestUtils.sha256Hex(...) for generated multi-topic reader subscription names.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
merlimat
merlimat approved these changes Jul 7, 2026
View reviewed changes
@david-streamlio
david-streamlio merged commit 73d61e4 into apache:master Jul 9, 2026
43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@david-streamlio
david-streamlio deleted the fips-qw-reader-subscription-hash branch July 9, 2026 14:53
@lhotari lhotari added this to the 5.0.0-M2 milestone Jul 27, 2026
david-streamlio added a commit to david-streamlio/pulsar that referenced this pull request Aug 26, 2026
@david-streamlio
[improve][pip] PIP-489: reconcile the gap list with post-PIP-478 master
1912da5
PIP-478 has landed since this proposal was written, and it moved or closed several of the things
the Motivation section cites as current state. Reviewers who check the first claim and find it
already fixed will discount the rest, so the audit is done against master rather than left to them.

SecurityUtility is gone (apache#26322 deleted it with the rest of the PIP-337 TLS stack), and the PIP
leaned on it in six places -- the Background paragraph establishing that Pulsar is already
FIPS-capable at the JCA layer, the packaging jar-swap rationale, the EC curve allowlist, the
fipsMode validator's first assertion, the High Level Design, and the integration test. Each now
names JcaProviders, whose ResolvedBouncyCastleProvider(Provider, boolean fips) reports the flavour
as a value rather than a static predicate. Its registration-first resolution order is recorded too:
a provider an operator registered in java.security is preserved rather than shadowed by a
classpath-constructed one, which is the property a FIPS deployment depends on.

Motivation item 2 is closed. PulsarSslConfiguration, PulsarSslFactory and DefaultPulsarSslFactory
no longer exist; every listener builds from a PulsarTlsFactory, and the broker binary listener
carries engineProvider(TlsFactorySupport.engineProvider(conf.getTlsProvider())). Rewritten to what
survives -- an unset tlsProvider still resolves to the native engine, because tcnative remains an
unconditional pulsar-common dependency, so FIPS mode must pin the engine and drop the jar.

Motivation item 3 is stale in form: the declared defaults are now empty rather than the literal
Conscrypt, and unset *means* Conscrypt only through resolveWebJsseProvider, on the web listeners.
The concern survives; the citations did not.

Items 1, 4, 5 and 6 were re-verified and hold, with line numbers corrected. Item 1 gains the
version catalog's own statement of the gap (libs.versions.toml:62-63).

Adds the gap the PIP did not list: DefaultBrokerTlsFactory resolves its JSSE provider as
resolveJsseProvider(null, ...), so the broker's jsseProvider and brokerClientJsseProvider keys are
declared but ignored -- item 2's shape in a newer key. apache#26326 fixes it and adds the jcaProvider
configuration surface that design (a) assumes, so the dependency is now stated rather than implied.

Housekeeping: apache#26152 and apache#26153 are merged, not open; apache#26154 no longer claims the KeyManagerProxy
half, which PIP-478 obsoleted; and the Configuration table's four pre-PIP-478 provider rows become
two rows naming the keys fipsMode actually evaluates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@merlimat merlimat merlimat approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0-M2

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@david-streamlio @merlimat @lhotari
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.