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

Skip compatibility-with-JCE test for JDK 10 #364

Merged
merged 1 commit into from
Feb 22, 2024
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 @@ -5,6 +5,7 @@
import static com.amazon.corretto.crypto.provider.test.TestUtil.NATIVE_PROVIDER;
import static com.amazon.corretto.crypto.provider.test.TestUtil.assertThrows;
import static com.amazon.corretto.crypto.provider.test.TestUtil.assumeMinimumVersion;
import static com.amazon.corretto.crypto.provider.test.TestUtil.getJavaVersion;
import static com.amazon.corretto.crypto.provider.test.TestUtil.versionCompare;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -448,11 +449,16 @@ public void testRsaPSSBadParams() throws Exception {
signature.setParameter(
new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 4096, 1)));

// Assert compatiblity with JCE on setting null parameter, BC doesn't throw.
// Assert compatibility with JCE on setting null parameter. BC doesn't throw. The test is
// skipped for JDK 10. SunRsaSign in JDK 10 doesn't support RSASSA-PSS signature algorithm, and
// it throws "java.security.NoSuchAlgorithmException: no such algorithm: RSASSA-PSS for provider
// SunRsaSign".
assertThrows(InvalidAlgorithmParameterException.class, () -> signature.setParameter(null));
assertThrows(
InvalidAlgorithmParameterException.class,
() -> Signature.getInstance("RSASSA-PSS", "SunRsaSign").setParameter(null));
if (getJavaVersion() != 10) {
assertThrows(
InvalidAlgorithmParameterException.class,
() -> Signature.getInstance("RSASSA-PSS", "SunRsaSign").setParameter(null));
}
Signature.getInstance("RSASSA-PSS", TestUtil.BC_PROVIDER).setParameter(null);

// "1" should be only valid trailer value.
Expand Down
Loading