-
Bug
-
Resolution: Fixed
-
P3
-
None
-
None
-
b91
-
solaris
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142817 | emb-9 | Anthony Scarpino | P3 | Resolved | Fixed | team |
When running the jdk/test/com/oracle/security/ucrypto/TestRSA.java with Preferred Provider configured on Solaris it will fail with:
javax.crypto.BadPaddingException: Message is larger than modulus
at sun.security.rsa.RSACore.parseMsg(RSACore.java:216)
at sun.security.rsa.RSACore.crtCrypt(RSACore.java:166)
at sun.security.rsa.RSACore.rsa(RSACore.java:122)
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:363)
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:390)
at javax.crypto.Cipher.doFinal(Cipher.java:2172)
at TestRSA.testEncryption(TestRSA.java:315)
at TestRSA.testCipher(TestRSA.java:252)
at TestRSA.doTest(TestRSA.java:217)
at UcryptoTest.main(UcryptoTest.java:60)
at TestRSA.main(TestRSA.java:210)
The default setting for Preferred Provider's is to direct RSA ops SunRsaSign instead of Ucrypto and SunPKCS11. The failure occurs when SunRsaSign.KeyFactory using predefined RSA values produces a key. That key does not work with SunRsaSign or OracleUcrypto Cipher op. If SunPKCS11's KeyFactory creates the key using the same redefined values, and running Cipher ops by SunRsaSign or OracleUcrypto, the test passes. (Note OracleUcrypto does not have a KeyFactory).
javax.crypto.BadPaddingException: Message is larger than modulus
at sun.security.rsa.RSACore.parseMsg(RSACore.java:216)
at sun.security.rsa.RSACore.crtCrypt(RSACore.java:166)
at sun.security.rsa.RSACore.rsa(RSACore.java:122)
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:363)
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:390)
at javax.crypto.Cipher.doFinal(Cipher.java:2172)
at TestRSA.testEncryption(TestRSA.java:315)
at TestRSA.testCipher(TestRSA.java:252)
at TestRSA.doTest(TestRSA.java:217)
at UcryptoTest.main(UcryptoTest.java:60)
at TestRSA.main(TestRSA.java:210)
The default setting for Preferred Provider's is to direct RSA ops SunRsaSign instead of Ucrypto and SunPKCS11. The failure occurs when SunRsaSign.KeyFactory using predefined RSA values produces a key. That key does not work with SunRsaSign or OracleUcrypto Cipher op. If SunPKCS11's KeyFactory creates the key using the same redefined values, and running Cipher ops by SunRsaSign or OracleUcrypto, the test passes. (Note OracleUcrypto does not have a KeyFactory).
- backported by
-
JDK-8142817 TestRSA.java: 'message larger than modulus' using SunRsaSign KeyFactory
-
- Resolved
-
- relates to
-
JDK-8139860 Add ucrypto/TestRSA.java to ProblemList: Message is larger than modulus
-
- Closed
-