From d2085f5a17adea8a502fd289f173b9ab07139454 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 11 Feb 2019 18:43:55 +0100 Subject: [PATCH] Document that curve lists can include partially-supported curves Document that a curve returned by mbedtls_ecp_curve_list() or mbedtls_ecp_grp_id_list() may lack support for ECDH or ECDSA. Add a corresponding changelog entry, under "API Changes" because we have changed the behavior: formerly, these functions skipped ECDH-only curves, although this was not documented. --- include/mbedtls/ecp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/mbedtls/ecp.h b/include/mbedtls/ecp.h index 6aa677ad0..d04cc49b6 100644 --- a/include/mbedtls/ecp.h +++ b/include/mbedtls/ecp.h @@ -437,6 +437,12 @@ mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp ); * mbedtls_ecp_curve_info() for all supported curves in order * of preference. * + * \note This function returns information about all curves + * supported by the library. Some curves may not be + * supported for all algorithms. Call mbedtls_ecdh_can_do() + * or mbedtls_ecdsa_can_do() to check if a curve is + * supported for ECDH or ECDSA. + * * \return A statically allocated array. The last entry is 0. */ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void ); @@ -446,6 +452,12 @@ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void ); * identifiers of all supported curves in the order of * preference. * + * \note This function returns information about all curves + * supported by the library. Some curves may not be + * supported for all algorithms. Call mbedtls_ecdh_can_do() + * or mbedtls_ecdsa_can_do() to check if a curve is + * supported for ECDH or ECDSA. + * * \return A statically allocated array, * terminated with MBEDTLS_ECP_DP_NONE. */