-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P5
-
None
-
Affects Version/s: 1.2.0
-
Component/s: security-libs
In the init(byte[] params, String format) and getEncoded(String format) method specifications of java.security.AlgorithmParameters, it is not defined the standard names of the format, and no spec when the specified format is unknown to a provider. This could lead to misleading for provider implementation. For example, in the AES provider, the format is checked in the init(byte[] params, String format) implementation, but ignored in the getEncoded(String format) (See com/sun/crypto/provider/AESParameters.java). While for init(byte[] params, String format) implementations, IOException is thrown if the format is unsupported for ChaCha20Poly1305Parameters and IllegalArgumentException is thrown for AESParameters. For getEncoded(String format), the format is ignored for AES, and IllegalArgumentException is used in OAEPParameters and IOException is used in ChaCha20Poly1305Parameters when the format is unsupported. The behavior could be confusing for applications. It would be nice to have a description in the spec so that the implementation can follow easier.