javax.crypto.spec.SecretKeyFactory equals(Object o) does not check the object type. As such, if an object of a class other than SecretKeyFactory is passed, a ClasscastException will occur instead of returning null.
A patch that solves this issue can be found here: http://developer.classpath.org/pipermail/classpath-patches/attachments/20060630/4dba50c0/Crypto-SecretKeySpec.bin This patch first checks if the object passed is an instance of SecretKeySpec. If the object is not an instance, then false is returned, else the rest of the comparions proceed.
could you provide a Mauve testlet to show the bug and validate the fix please.
Created attachment 11837 [details] Mauve testlet to PR28212 This testlet is in relation to PR28212. This test verifies the bug in which if an object type other than SecretKeySpec is passed in the equals method will incorrectly throw a ClassCastException instead of returning false. This testlet should be placed in gnu/testlet/javax/crypto/spec The patch within the bug report will correct this issue and allow the testlet to correctly pass. http://developer.classpath.org/pipermail/classpath-patches/attachments/20060630/4dba50c0/Crypto-SecretKeySpec.bin
Fix checked in.