-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b27
-
Not verified
getParameters has three conflicting problems.
First, the getParameters() description is very specific:
- if setParameters is set, the method returns those parameters
- if not initialized, returns some data
- otherwise it returns null
Second, setParameters takes an AlgorithmParametersSpec, but
getParameters returns an AlgorithmParameter.
There are cases, EdDSA for one, setParameters() is used for additional Signature operation details, not directly related to properties defined by the algorithm used. getParameters() is expecting the algorithm-specific parameters to be returned when they are unrelated to the operation, and in EdDSA's case is not a part of the public API.
The third problem is the SPI throws UnsupportedOperatationException for the underlying getParameters() method, but the getParameters() method itself never defined a thrown exception. The method has been defined since 1.4.
The fix with the least risk for compatibility is to return null when getParameters() is not supported by the algorithm. null is already a defined as a valid return value. It was decided that throwing UnsupportedOperationException was too risky as it maybe incompatible with existing applications.
First, the getParameters() description is very specific:
- if setParameters is set, the method returns those parameters
- if not initialized, returns some data
- otherwise it returns null
Second, setParameters takes an AlgorithmParametersSpec, but
getParameters returns an AlgorithmParameter.
There are cases, EdDSA for one, setParameters() is used for additional Signature operation details, not directly related to properties defined by the algorithm used. getParameters() is expecting the algorithm-specific parameters to be returned when they are unrelated to the operation, and in EdDSA's case is not a part of the public API.
The third problem is the SPI throws UnsupportedOperatationException for the underlying getParameters() method, but the getParameters() method itself never defined a thrown exception. The method has been defined since 1.4.
The fix with the least risk for compatibility is to return null when getParameters() is not supported by the algorithm. null is already a defined as a valid return value. It was decided that throwing UnsupportedOperationException was too risky as it maybe incompatible with existing applications.
- csr for
-
JDK-8243425 Signature and SignatureSpi get parameter methods may return null when unsupported
- Closed
- relates to
-
JDK-8199231 JEP 339: Edwards-Curve Digital Signature Algorithm (EdDSA)
- Closed
There are no Sub-Tasks for this issue.