From ba920ae44ae3602e3a80dacf266dfb7f6a475505 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 21 Nov 2025 08:31:42 +0100 Subject: [PATCH] Fix --- .../com/sun/crypto/provider/Cipher/HPKE/KAT9180.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/jdk/com/sun/crypto/provider/Cipher/HPKE/KAT9180.java b/test/jdk/com/sun/crypto/provider/Cipher/HPKE/KAT9180.java index f4717f57883db..024d5f977a795 100644 --- a/test/jdk/com/sun/crypto/provider/Cipher/HPKE/KAT9180.java +++ b/test/jdk/com/sun/crypto/provider/Cipher/HPKE/KAT9180.java @@ -38,11 +38,14 @@ import javax.crypto.Cipher; import javax.crypto.spec.HPKEParameterSpec; import javax.crypto.spec.SecretKeySpec; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.HexFormat; +import jtreg.SkippedException; + /// This test is based on Appendix A (Test Vectors) of /// [RFC 9180](https://datatracker.ietf.org/doc/html/rfc9180#name-test-vectors) /// The test data is available as a JSON file at: @@ -67,7 +70,14 @@ private static class RFC_9180_KAT { public static void main(String[] args) throws Exception { var h = HexFormat.of(); - Path archivePath = ArtifactResolver.fetchOne(RFC_9180_KAT.class); + Path archivePath = null; + try { + archivePath = ArtifactResolver.fetchOne(RFC_9180_KAT.class); + } catch (IOException e) { + if (e.getMessage().contains("Cannot find the artifact")) { + throw new SkippedException("RFC_9180_KAT test vectors are not available."); + } + } System.out.println("Data path: " + archivePath); var c1 = Cipher.getInstance("HPKE"); var c2 = Cipher.getInstance("HPKE");