-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.0
-
jce1.2.2beta
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2109784 | 1.4.0 | Valerie Peng | P4 | Resolved | Fixed | beta3 |
Name: bsC130419 Date: 09/05/2001
java version "1.4.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)
http://java.sun.com/j2se/1.4/docs/api/javax/crypto/CipherSpi.html#engineUpdate(byte[],int, int) says:
Returns: the new buffer with the result, or null if the underlying cipher is a
block cipher and the input data is too short to result in a new block.
But if I return null in engineUpdate(byte[], int, int) in my subclass (DES
algorithm implementation) that inherits from javax.crypto.CipherSpi if there no
data to return, the JCE, especialy javax.crypto.Cipher#update(byte[], int, int)
throws a java.lang.NullPointerException.
I think there is a lack in the javadoc
http://java.sun.com/j2se/1.4/docs/api/javax/crypto/CipherSpi.html#engineUpdate(byte[],int, int).
The techwriters should write better:
Returns: the new buffer with the result, or new byte[0] if the underlying cipher
is a block cipher and the input data is too short to result in a new block.
All in all it will be a good thing if Sun make the several checks that are done
in JCE more public, because it is very bad to do reverse engineering to learn
the behaivior of JCE-API. I think that are not so secret things that no one
should know.
(Review ID: 131420)
======================================================================
- backported by
-
JDK-2109784 NullPointerException in byte[] javax.crypto.Cipher#update(byte[], int, int)
- Resolved