From d1510b7281d1126f7a702350a786defa469fdbbb Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 4 Nov 2026 12:30:14 +0100 Subject: [PATCH] Added one more test for fips issue --- test/reproducers/1991003/CheckAlgorithms.java | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 test/reproducers/1991003/CheckAlgorithms.java diff --git a/test/reproducers/1991003/CheckAlgorithms.java b/test/reproducers/1991003/CheckAlgorithms.java new file mode 100644 index 0000000..cab70f7 --- /dev/null +++ b/test/reproducers/1991003/CheckAlgorithms.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.KeyFactory; +import java.security.KeyStore; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.Security; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; + +/* + * @test + * @bug 1991003 + * @summary testing the creation of algorithms + * @run main CheckAlgorithms + */ + +public class CheckAlgorithms { + + public static void main(String[] args) throws Throwable { + System.out.println("Java: " + System.getProperty("java.runtime.version")); + System.out.println("Provider: " + Security.getProviders()[0].getName()); + SSLEngine engine = SSLContext.getDefault().createSSLEngine(); + engine.setUseClientMode(true); + engine.setEnabledProtocols(new String[]{"TLSv1.3"}); + engine.beginHandshake(); + engine.wrap(ByteBuffer.allocate(0),ByteBuffer.allocate(engine.getSession().getPacketBufferSize())); + System.out.println("ClientHello succeeded"); + } +}