Open mu578 opened 4 years ago
The missing ones are Curve25519 and Curve448. There's nothing wrong with secp192k1, is there?
Montgomery curves are omitted from mbedtls_ecp_curve_list()
and mbedtls_ecp_grp_id_list()
. The reason for that is that the library only has partial support for them, and it was designed with all or nothing in mind. Adding Montgomery curves would cause software that relies on this list to assume that ECDH and ECDSA is possible with those curves, but it isn't. We changed the list functions to list Montgomery curves some time after 2.16, but that change was too disruptive for long-time support branches.
However there's no reason why mbedtls_ecp_curve_info_from_grp_id
and mbedtls_ecp_curve_info_from_name
should be restricted to curves in the “fully supported list”. It's a bug because these functions use mbedtls_ecp_curve_list()
internally. Instead these functions should use a longer list.
mbedtls_ecp_curve_info_from_tls_id
also calls mbedtls_ecp_curve_list()
, but the library doesn't support Montgomery curves in TLS yet, so that's ok.
@gilles-peskine-arm, ok sorry my bad yes MBEDTLS_ECP_DP_CURVE25519 [indeces 8, 12]; thank you. I was just running a blind conformity test to pass any type of curves within an algorithm. Wanted to print-out the details attached within a given id; got some bad-access; I should have called mbedtls_ecp_curve_list
or mbedtls_ecp_grp_id_list
anyways rather than using a copy of the enum; we'll ignore MBEDTLS_ECP_DP_CURVE25519, MBEDTLS_ECP_DP_CURVE448
; we have proxy functions so it helps.
Description
Bug
OS
Any
mbed TLS build:
Version: 2.16.6
Expected behavior
Not NULL;
Actual behavior
NULL
Steps to reproduce