Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes broken test due to unsupported EC using JDK-17 #1711

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.HashMap;
import java.util.Map;

import org.junit.Before;

import org.opensearch.common.settings.Settings;

import org.apache.http.HttpHeaders;
Expand All @@ -43,8 +43,6 @@
import org.opensearch.security.util.FakeRestRequest;
import com.google.common.io.BaseEncoding;

import static org.junit.Assume.assumeFalse;

public class HTTPJwtAuthenticatorTest {

final static byte[] secretKey = new byte[1024];
Expand All @@ -53,15 +51,6 @@ public class HTTPJwtAuthenticatorTest {
new SecureRandom().nextBytes(secretKey);
}

/*
This test fails during Java 17 build due to a known bug: https://bugs.openjdk.java.net/browse/JDK-8251547
TODO: This method should be removed once a fix is implemented
*/
@Before
public void isJavaVersionBelow17(){
assumeFalse(System.getProperty("java.version").startsWith("17"));
}

@Test
public void testNoKey() throws Exception {

Expand Down Expand Up @@ -485,7 +474,7 @@ public void testRS256() throws Exception {
public void testES512() throws Exception {

KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
keyGen.initialize(571);
keyGen.initialize(521);
KeyPair pair = keyGen.generateKeyPair();
PrivateKey priv = pair.getPrivate();
PublicKey pub = pair.getPublic();
Expand Down