From aff37e5aa1f8394699ed62f89d808ee6f8da2ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 11 May 2015 18:11:57 +0200 Subject: [PATCH] Remove ecp_group_read_string() --- ChangeLog | 3 ++- include/mbedtls/ecp.h | 23 ++--------------------- library/ecp.c | 24 ------------------------ 3 files changed, 4 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b8a43811..a3c46053b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,7 @@ API Changes * Some constness fixes Removals + * Removed mbedtls_ecp_group_read_string(). Only named groups are supported. * Removed individual mdX_hmac and shaX_hmac functions (use generic md_hmac functions from md.h) * Removed the PBKDF2 module (use PKCS5). @@ -99,7 +100,7 @@ Default behavior changes * Default DHM parameters server-side upgraded from 1024 to 2048 bits. * Negotiation of truncated HMAC is now disabled by default on server too. -Reauirement changes +Requirement changes * The minimum MSVC version required is now 2010 (better C99 support). * The NET layer now unconditionnaly relies on getaddrinfo(). * Compiler is required to support C99 types such as long long and uint32_t. diff --git a/include/mbedtls/ecp.h b/include/mbedtls/ecp.h index 922d4182b..2d33c3853 100644 --- a/include/mbedtls/ecp.h +++ b/include/mbedtls/ecp.h @@ -437,25 +437,6 @@ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp int format, size_t *olen, unsigned char *buf, size_t blen ); -/** - * \brief Import an ECP group from null-terminated ASCII strings - * - * \param grp Destination group - * \param radix Input numeric base - * \param p Prime modulus of the base field - * \param b Constant term in the equation - * \param gx The generator's X coordinate - * \param gy The generator's Y coordinate - * \param n The generator's order - * - * \return 0 if successful, or a MBEDTLS_ERR_MPI_XXX error code - * - * \note Sets all fields except modp. - */ -int mbedtls_ecp_group_read_string( mbedtls_ecp_group *grp, int radix, - const char *p, const char *b, - const char *gx, const char *gy, const char *n); - /** * \brief Set a group using well-known domain parameters * @@ -466,8 +447,8 @@ int mbedtls_ecp_group_read_string( mbedtls_ecp_group *grp, int radix, * MBEDTLS_ERR_MPI_XXX if initialization failed * MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE for unkownn groups * - * \note Index should be a value of RFC 4492's enum NamdeCurve, - * possibly in the form of a MBEDTLS_ECP_DP_XXX macro. + * \note Index should be a value of RFC 4492's enum NamedCurve, + * usually in the form of a MBEDTLS_ECP_DP_XXX macro. */ int mbedtls_ecp_use_known_dp( mbedtls_ecp_group *grp, mbedtls_ecp_group_id index ); diff --git a/library/ecp.c b/library/ecp.c index d90609d85..e064c500a 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -583,30 +583,6 @@ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp return( 0 ); } -/* - * Import an ECP group from ASCII strings, case A == -3 - */ -int mbedtls_ecp_group_read_string( mbedtls_ecp_group *grp, int radix, - const char *p, const char *b, - const char *gx, const char *gy, const char *n) -{ - int ret; - - MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &grp->P, radix, p ) ); - MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &grp->B, radix, b ) ); - MBEDTLS_MPI_CHK( mbedtls_ecp_point_read_string( &grp->G, radix, gx, gy ) ); - MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &grp->N, radix, n ) ); - - grp->pbits = mbedtls_mpi_msb( &grp->P ); - grp->nbits = mbedtls_mpi_msb( &grp->N ); - -cleanup: - if( ret != 0 ) - mbedtls_ecp_group_free( grp ); - - return( ret ); -} - /* * Set a group from an ECParameters record (RFC 4492) */