Skip to content

Use SHA-256 for runtime telemetry package checksums#18846

Merged
trask merged 9 commits into
open-telemetry:mainfrom
iblancasa:18845
Jun 2, 2026
Merged

Use SHA-256 for runtime telemetry package checksums#18846
trask merged 9 commits into
open-telemetry:mainfrom
iblancasa:18845

Conversation

@iblancasa

Copy link
Copy Markdown
Contributor

Fixes #18845

This change updates runtime telemetry package checksums from SHA-1 to SHA-256. Some FIPS-enabled environments disallow SHA-1 for this use. Using SHA-256 makes runtime telemetry package checksum generation compatible with stricter cryptographic policies.

Changes:

  • package.checksum_algorithm changes from SHA1 to SHA-256
  • package.checksum changes from a SHA-1 digest to a SHA-256 digest
  • checksum format changes from 40 lowercase hex characters to 64 lowercase hex characters

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Copilot AI review requested due to automatic review settings May 25, 2026 11:47
@iblancasa iblancasa requested a review from a team as a code owner May 25, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR upgrades runtime telemetry package checksums from SHA-1 to SHA-256 across the jar analysis pipeline and its tests.

Changes:

  • Switch checksum computation in JarDetails from SHA-1 to SHA-256 and adjust formatting to 64 hex chars.
  • Update JarAnalyzer emitted attributes to report algorithm "SHA-256" and use the new SHA-256 checksum method.
  • Update related tests to validate SHA-256 output shape (64 lowercase hex characters).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
instrumentation/runtime-telemetry/testing/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarDetailsTest.java Updates assertions to validate SHA-256 checksum format.
instrumentation/runtime-telemetry/testing/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzerTest.java Updates expected checksum algorithm and checksum format to SHA-256/64-hex.
instrumentation/runtime-telemetry/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzerInstallerTest.java Updates expected log attributes and checksum regex to SHA-256/64-hex.
instrumentation/runtime-telemetry/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarDetails.java Implements SHA-256 digest computation and exposes computeSha256().
instrumentation/runtime-telemetry/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzer.java Emits SHA-256 checksum and algorithm attribute.

Comment on lines +210 to +213
byte[] buffer = new byte[8192];
while (dis.read(buffer) != -1) {}
byte[] digest = md.digest();
return String.format(Locale.ROOT, "%040x", new BigInteger(1, digest));
return String.format(Locale.ROOT, "%064x", new BigInteger(1, digest));
@laurit

laurit commented May 26, 2026

Copy link
Copy Markdown
Contributor

@jack-berg do you know whether anybody uses it and whether changing the hash algorithm would cause issues?

@trask

trask commented May 28, 2026

Copy link
Copy Markdown
Member

@jack-berg do you know whether anybody uses it and whether changing the hash algorithm would cause issues?

I'm not sure if people are using it, but I believe the change is allowed by our VERSIONING.md policy since it's behind an experimental configuration flag (otel.instrumentation.runtime-telemetry.experimental.package-emitter.enabled).

@jack-berg

Copy link
Copy Markdown
Member

I support changing.

iblancasa added 2 commits June 1, 2026 16:16
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@laurit laurit added this to the v2.29.0 milestone Jun 2, 2026
iblancasa added 2 commits June 2, 2026 15:37
Signed-off-by: Israel Blancas <iblancasa@gmail.com>

@breedx-splk breedx-splk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think 15 years is a long enough deprecation period. 🤣

@trask trask merged commit cfc967f into open-telemetry:main Jun 2, 2026
95 checks passed
vikinghawk pushed a commit to vikinghawk/opentelemetry-java-instrumentation that referenced this pull request Jun 2, 2026
…8846)

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.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.

Runtime telemetry package checksums should avoid SHA-1 for FIPS compatibility

6 participants