Search code examples
javasecuritymd5jnlpjava-web-start

What's wrong with my JNLP security?


Starting with some fairly recent version of the JRE, I'm no longer able to do MD5 hashes inside JNLP programs. It throws a java.lang.NullPointerException. If I run the same application as a "normal" (non-JNLP) application, it works fine. The stack trace looks like this:

com.sun.jnlp.JNLPClassLoader.getPermissions(Unknown Source)
java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
com.myapp.md5Hash(myapp.java:68)

Best guess is that I'm getting denied due to some security issue? Not sure why though. We've already the JNLP fixup code in place (to fix the JNLP linking issues). Ideas?

Current method called just does a MessageDigest instance of "MD5". I've also tried the DigestUtils methods. Same problem either way.


Solution

  • There does not appear to be any way around this. MD5 has now been replaced with a proprietary algorithm to do what we need (no need for panic, it's not something that requires a strong hashing method).