-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
5.0
-
other
-
other
According to the spec, javax.crypto.Cipher.getInstance() should throw
BadPaddingException if an invalid padding is requested:
> public static final Cipher getInstance(String transformation)
> throws NoSuchAlgorithmException,
> NoSuchPaddingException
...
> Throws:
> NoSuchAlgorithmException - if the specified transformation is not
> available in the default provider package or any of the other
> provider packages that were searched.
> NoSuchPaddingException - if transformation contains a padding
> scheme that is not available.
However, using the attached example which requests a clearly bogus
padding scheme ("DES/CBC/BadPaddingSpecified"), we see a
NoSuchAlgorithmException being thrown.
> jrd@dickdale:6224620% uname -a
> Linux dickdale 2.6.5-7.108-default #1 Wed Aug 25 13:34:40 UTC 2004 i686 i686 i386 GNU/Linux
> jrd@dickdale:6224620% java -version
> java version "1.6.0-ea"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b22)
> Java HotSpot(TM) Client VM (build 1.6.0-ea-b22, mixed mode)
> jrd@dickdale:6224620% java PaddingTest
> Test failed: Unexpected exception java.security.NoSuchAlgorithmException: Cannot find any provider supporting DES/CBC/BadPaddingSpecified
###@###.### 2005-2-04 17:15:50 GMT
BadPaddingException if an invalid padding is requested:
> public static final Cipher getInstance(String transformation)
> throws NoSuchAlgorithmException,
> NoSuchPaddingException
...
> Throws:
> NoSuchAlgorithmException - if the specified transformation is not
> available in the default provider package or any of the other
> provider packages that were searched.
> NoSuchPaddingException - if transformation contains a padding
> scheme that is not available.
However, using the attached example which requests a clearly bogus
padding scheme ("DES/CBC/BadPaddingSpecified"), we see a
NoSuchAlgorithmException being thrown.
> jrd@dickdale:6224620% uname -a
> Linux dickdale 2.6.5-7.108-default #1 Wed Aug 25 13:34:40 UTC 2004 i686 i686 i386 GNU/Linux
> jrd@dickdale:6224620% java -version
> java version "1.6.0-ea"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b22)
> Java HotSpot(TM) Client VM (build 1.6.0-ea-b22, mixed mode)
> jrd@dickdale:6224620% java PaddingTest
> Test failed: Unexpected exception java.security.NoSuchAlgorithmException: Cannot find any provider supporting DES/CBC/BadPaddingSpecified
###@###.### 2005-2-04 17:15:50 GMT