JDK-6446284 : PBEWithMD5AndDES SecretKeyFactory not available
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2006-07-04
  • Updated: 2011-02-16
  • Resolved: 2006-07-13
Description
FULL PRODUCT VERSION :
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-beta2-b86, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux powerpig 2.6.15-gentoo-r7 #11 SMP PREEMPT Sun Jun 25 09:52:42 CEST 2006 x86_64 AMD Turion(tm) 64 Mobile Technology MT-30 AuthenticAMD GNU/Linux

A DESCRIPTION OF THE PROBLEM :
SecretKeyFactory.getInstance("PBEWithMD5AndDES");

results in:

java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available

It worked in jdk1.6.0-beta-1 . However this wasn't a selection so I was not 
able to tell this. Nothing really - this has always worked, and have also worked in the mustang releases except this last beta2 release.

I ran this small program on my Gentoo-Linux AMD64 (using mustang for amd64 
linux), and got the exception. This exception doesn't happen on earlier 
releases.

REGRESSION.  Last worked in version mustang

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.security.NoSuchAlgorithmException;

import javax.crypto.SecretKeyFactory;


public class JSE6SecretKeyFactoryTest {

	/**
	 * @param args
	 * @throws NoSuchAlgorithmException
	 */
	public static void main(String[] args) throws NoSuchAlgorithmException {
		SecretKeyFactory.getInstance("PBEWithMD5AndDES");
	}

}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code above should not produce any output
ACTUAL -
Exception in thread "main" java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available
	at javax.crypto.SecretKeyFactory.<init>(DashoA13*..)
	at javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
	at tests.JSE6SecretKeyFactoryTest.main(JSE6SecretKeyFactoryTest.java:16)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available
	at javax.crypto.SecretKeyFactory.<init>(DashoA13*..)
	at javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
	at tests.JSE6SecretKeyFactoryTest.main(JSE6SecretKeyFactoryTest.java:16)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.security.NoSuchAlgorithmException;

import javax.crypto.SecretKeyFactory;


public class JSE6SecretKeyFactoryTest {

	/**
	 * @param args
	 * @throws NoSuchAlgorithmException
	 */
	public static void main(String[] args) throws NoSuchAlgorithmException {
		SecretKeyFactory.getInstance("PBEWithMD5AndDES");
	}

}

---------- END SOURCE ----------

Release Regression From : mustang
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION Received from SDN Comments: ===begin=== Hi there, I could reproduce this. Here, the problem was Vista && symbolic links && Eclipse && different drives for Windows (C:) and User home (D:). If the jre you choosed in your run configuration is on drive D: and you have a symbolic link to this drive on C:, a NoSuchAlgorithmException occurs. If the Eclipse jre-configuration points to the symbolic link (C:), it works. ===end=== Is this due to Eclipse 3.1 also?
28-04-2009

EVALUATION Closing as a dup of 6331571.
13-07-2006

EVALUATION Like Max, I am also unable to duplicate this, and we haven't touched this area at all since beta1. Please ask the customer to check: You haven't installed JCE 1.2.2 or a previous SunJCE provider jar? Are you adding any other JCE providers to the environment? Did you deregister the SunJCE provider in the lib/security/java.security file, or otherwise remove it using the Security.removeProvider() method? Are you playing with the bootclasspath, or adding the SunJCE provider to a regular classpath? Are you changing any of the classpaths around? (Perhaps using Eclipse?) If none of the above, please remove all the bits and reinstall, and if it still persists, let us know. Thanks.
10-07-2006