On Thu, May 12, 2022 at 9:14 PM Rainer Jung <rainer.j...@kippdata.de> wrote:
>
> ... for me with Java 1.8.0 332 (various OpenJDK builds) on TC 9.0.63 and
> 10.0.21, platform various Linuxes and also Solaris Sparc. It does not
> fail for Java 11 and also not for Oracle Java 1.8.0 331.

The funny thing is it is the support that was already there in PEMFile
that is failing, and that code is apparently completely unchanged.

So I don't quite understand or maybe it simply never worked (I don't
know the reason why obviously) as the test was not there before.

Rémy

> Testsuite: org.apache.tomcat.util.net.jsse.TestPEMFile
> Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.947 sec
>
> Testcase: testKeyEncryptedPkcs1DesEde3Cbc took 0.59 sec
> Testcase: testKeyEncryptedPkcs8 took 0.196 sec
>          Caused an ERROR
> Cannot retrieve the PKCS8EncodedKeySpec
> java.security.spec.InvalidKeySpecException: Cannot retrieve the
> PKCS8EncodedKeySpec
>          at
> javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:258)
>          at
> org.apache.tomcat.util.net.jsse.PEMFile$Part.toPrivateKey(PEMFile.java:212)
>          at org.apache.tomcat.util.net.jsse.PEMFile.<init>(PEMFile.java:143)
>          at org.apache.tomcat.util.net.jsse.PEMFile.<init>(PEMFile.java:98)
>          at
> org.apache.tomcat.util.net.jsse.TestPEMFile.testKey(TestPEMFile.java:74)
>          at
> org.apache.tomcat.util.net.jsse.TestPEMFile.testKeyEncrypted(TestPEMFile.java:69)
>          at
> org.apache.tomcat.util.net.jsse.TestPEMFile.testKeyEncryptedPkcs8(TestPEMFile.java:64)
> Caused by: javax.crypto.BadPaddingException: Given final block not
> properly padded. Such issues can arise if a bad key is used during
> decryption.
>          at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
>          at
> com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
>          at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853)
>          at
> com.sun.crypto.provider.PBES2Core.engineDoFinal(PBES2Core.java:323)
>          at javax.crypto.Cipher.doFinal(Cipher.java:2168)
>          at
> javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:253)
>
> Testcase: testKeyPkcs1 took 0.004 sec
> Testcase: testKeyEncryptedPkcs1Aes256 took 0.035 sec
> Testcase: testKeyEncryptedPkcs1DesCbc took 0.023 sec
>
> Best regards,
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to