-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b32
-
sparc
-
solaris_2.6
-
Verified
Name: ktR10099 Date: 11/18/2003
There is no wording in the spec, that javax.crypto.Mac.getProvider() can't
return null. Current implementation throws NPE, while trying to retrieve
null provider. Please find below example, demonstrating the bug:
----------------------------------------------------------------
import javax.crypto.*;
import java.security.*;
public class test137 {
public static void main(String[] args) {
MyMac mm = new MyMac(null, null, null);
System.out.println("Mac created");
System.out.println("Provider : " + mm.getProvider());
System.out.println("Finished");
}
}
class MyMac extends Mac {
public MyMac(MacSpi macSpi, Provider provider,String algorithm) {
super(macSpi, provider, algorithm);
}
}
------------------------output of test137-------------------------
java full version "1.5.0-beta-b28"
Mac created
Exception in thread "main" java.lang.NullPointerException
at javax.crypto.Mac.a(DashoA6275)
at javax.crypto.Mac.getProvider(DashoA6275)
at test137.main(test137.java:8)
------------------------------------------------------------------
======================================================================
There is no wording in the spec, that javax.crypto.Mac.getProvider() can't
return null. Current implementation throws NPE, while trying to retrieve
null provider. Please find below example, demonstrating the bug:
----------------------------------------------------------------
import javax.crypto.*;
import java.security.*;
public class test137 {
public static void main(String[] args) {
MyMac mm = new MyMac(null, null, null);
System.out.println("Mac created");
System.out.println("Provider : " + mm.getProvider());
System.out.println("Finished");
}
}
class MyMac extends Mac {
public MyMac(MacSpi macSpi, Provider provider,String algorithm) {
super(macSpi, provider, algorithm);
}
}
------------------------output of test137-------------------------
java full version "1.5.0-beta-b28"
Mac created
Exception in thread "main" java.lang.NullPointerException
at javax.crypto.Mac.a(DashoA6275)
at javax.crypto.Mac.getProvider(DashoA6275)
at test137.main(test137.java:8)
------------------------------------------------------------------
======================================================================