Skip to content

Use SHA-256 for runtime telemetry package checksums#18846

Open
iblancasa wants to merge 2 commits into
open-telemetry:mainfrom
iblancasa:18845
Open

Use SHA-256 for runtime telemetry package checksums#18846
iblancasa wants to merge 2 commits into
open-telemetry:mainfrom
iblancasa:18845

Conversation

@iblancasa
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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));
/** Returns the SHA1 hash of this file, e.g. {@code 30d16ec2aef6d8094c5e2dce1d95034ca8b6cb42}. */
String computeSha1() {
return sha1Checksum;
/** Returns the SHA-256 hash of this file. */
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));
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

2 participants