Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Ignore whole-file checksum in VerifyCACerts
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergillespie committed Feb 24, 2022
1 parent f05a9fc commit 0e22bd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,16 @@ public static void main(String[] args) throws Exception {
md = MessageDigest.getInstance("SHA-256");

byte[] data = Files.readAllBytes(Path.of(CACERTS));
/* Ignore whole-file checksum as the checksum of the cacerts
* file changes with each build, due to the way we merge upstream
* OpenJDK certs and Amazon Linux certs at build time.
String checksum = HEX.formatHex(md.digest(data));
if (!checksum.equals(CHECKSUM)) {
atLeastOneFailed = true;
System.err.println("ERROR: wrong checksum\n" + checksum);
System.err.println("Expected checksum\n" + CHECKSUM);
}
*/

KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new ByteArrayInputStream(data), "changeit".toCharArray());
Expand Down

0 comments on commit 0e22bd7

Please sign in to comment.