[Bug]: wc_Curve448PublicKeyToDer returns error when output is NULL
EugenCazacu opened this issue · comments
Contact Details
No response
Version
5.6.6
Description
Configuration: all configurations including HAVE_CURVE448 and --enable-curve448
wc_Curve448PublicKeyToDer
behaves differently from wc_Curve448PrivateKeyToDer
when output is NULL. wc_Curve448PrivateKeyToDer
returns the size needed by the output and wc_Curve448PublicKeyToDer
returns BAD_FUNC_ARG
. I would expect both functions to behave similarly and ideally return the needed buffer size on a call with output == NULL
Suggested fix: output should not be checked for NULL in the implementation (similar with wc_Curve448PrivateKeyToDer
)
Reproduction steps
call wc_Curve448PublicKeyToDer with output == NULL
Relevant log output
No response
Hi @EugenCazacu, thank you for the report. Please find a fix at #7519.
Juliusz