david-streamlio opened a new pull request, #26152:
URL: https://github.com/apache/pulsar/pull/26152

   ### Motivation
   
   `FileUtils.calculateMd5sum` backs two non-security change-detection 
mechanisms: the NAR extraction directory checksum (`NarUnpacker`) and the 
connector/function archive identity used for hot-reload 
(`ConnectorUtils`/`FunctionUtils`). MD5 is fine for change detection, but 
strict security providers reject it outright — under BC-FIPS in approved-only 
mode, `MessageDigest.getInstance("md5")` throws, which breaks NAR extraction 
(and therefore broker/worker startup with connectors) on FIPS-configured JVMs.
   
   This is one of a set of small preparatory cleanups for FIPS-restricted 
deployments; a broader PIP covering TLS provider wiring, packaging, and 
message-crypto algorithm migration is being drafted separately.
   
   ### Modifications
   
   - `FileUtils`: replaced `calculateMd5sum` with `calculateSha256sum` 
(SHA-256, larger read buffer); javadoc documents that the checksum is change 
detection, not a security control.
   - `NarUnpacker`: uses the SHA-256 checksum for the extraction directory and 
lock-file names; local variable renamed accordingly.
   - `ConnectorUtils`/`FunctionUtils`: `computeArchiveMd5Hex` → 
`computeArchiveChecksumHex` (SHA-256).
   - `Connector`/`FunctionArchive`: field/accessor renames 
(`getArchiveChecksumHex`), javadoc updated.
   
   The archive checksum is only compared in-memory against values computed by 
the same JVM, so the algorithm change is not observable there. The NAR 
extraction directory name changes, causing a one-time re-extraction after 
upgrade; stale checksum-named directories from older versions are left behind 
in the extraction dir, matching existing behavior when NAR content changes.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests: `NarUnpackerTest` 
(extraction/locking against the new checksum naming), 
`ConnectorUtilsReloadTest` and `FunctionUtilsReloadTest` (archive-identity 
change detection).
   
   ### 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
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to