On 08/03/2015 08:11 AM, Steve Dougherty wrote:
> Hi everyone / Charles,
> 
> We're running into seemingly distro-specific failures to raise a
> NullPointerException:
> 
> freenet.crypt.MessageAuthCodeTest.testVerifyDataNullInput1
> freenet.crypt.MessageAuthCodeTest.testVerifyNullInput1
> freenet.crypt.MessageAuthCodeTest.testVerifyNullInput2
...
> We have yet to find a reason for this difference. These pass on Debian -
> both Wheezy and sid - but fail on Arch and Fedora 22. Debian has Java
> 1.6 / 1.8, Arch has Java 1.7, and Fedora has 1.8. Arch, Fedora, and
> Debian all have JUnit 4.12 / Hamcrest 1.3.
> 
> Any suggestions for what to look into next?

Turns out in April 2015 [0] a patch changed the behavior to return false
on null input instead of throw. It's still certainly within the Javadoc
[1] so I don't think we can call it a bug.

This means different JVMs will either throw or not throw on null input
to MessageDigest.isEqual(), used by these functions, depending on
whether they include that patch.

Any suggestions on how to deal with this? Do we have the Freenet wrapper
ensure it throws? Returns false?

- Steve

[0] http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/10929#l8.15
[1]
http://docs.oracle.com/javase/7/docs/api/java/security/MessageDigest.html#isEqual(byte[],%20byte[])

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to