From 6a2fb618960a6bb228d886b5faab81794c21013c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 24 May 2021 22:25:04 +0200 Subject: [PATCH] Rename library/ecp_alt.h to ecp_internal_alt.h library/ecp_alt.h (declaring individual functions of the ECP module that can be substituted, included when building the library with MBEDTLS_ECP_INTERNAL_ALT enabled) clashes with ecp_alt.h (not provided, declaring types of the ECP module when the whole implementation is substituted, included when building the library with MBEDTLS_ECP_ALT enabled). Depending on the search path during build, this can make MBEDTLS_ECP_ALT unusable. Rename library/ecp_alt.h to follow the naming convention of other alt headers: MBEDTLS_XXX_ALT corresponds to xxx_alt.h. Signed-off-by: Gilles Peskine --- ChangeLog | 2 +- docs/3.0-migration-guide.md | 2 +- library/ecp.c | 2 +- library/{ecp_alt.h => ecp_internal_alt.h} | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename library/{ecp_alt.h => ecp_internal_alt.h} (99%) diff --git a/ChangeLog b/ChangeLog index dc6e4515d2..ddaf3fd9f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,7 +22,7 @@ API changes Various helpers and definitions available for use in alt implementations have been moved out of the include/ directory and into the library/ directory. The files concerned are ecp_internal.h and rsa_internal.h - which have also been renamed to ecp_alt.h and rsa_alt_helpers.h + which have also been renamed to ecp_internal_alt.h and rsa_alt_helpers.h respectively. * Move internal headers. Header files that were only meant for the library's internal use and diff --git a/docs/3.0-migration-guide.md b/docs/3.0-migration-guide.md index 2d031c6a4a..a4a59b8895 100644 --- a/docs/3.0-migration-guide.md +++ b/docs/3.0-migration-guide.md @@ -59,7 +59,7 @@ were documented as internal, despite being in the public include directory. If you're providing alt implementations of ECP or RSA, you'll need to add our `library` directory to your include path when building your alt implementations, and note that `ecp_internal.h` and `rsa_internal.h` have been -renamed to `ecp_alt.h` and `rsa_alt_helpers.h` respectively. +renamed to `ecp_internal_alt.h` and `rsa_alt_helpers.h` respectively. If you're a library user and used to rely on having access to a structure or function that's now in a private header, please reach out on the mailing list diff --git a/library/ecp.c b/library/ecp.c index f450056c06..044bbe1d10 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -99,7 +99,7 @@ #define mbedtls_free free #endif -#include "ecp_alt.h" +#include "ecp_internal_alt.h" #if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG) #if defined(MBEDTLS_HMAC_DRBG_C) diff --git a/library/ecp_alt.h b/library/ecp_internal_alt.h similarity index 99% rename from library/ecp_alt.h rename to library/ecp_internal_alt.h index 6b1b29f701..9b157eaa3b 100644 --- a/library/ecp_alt.h +++ b/library/ecp_internal_alt.h @@ -1,5 +1,5 @@ /** - * \file ecp_alt.h + * \file ecp_internal_alt.h * * \brief Function declarations for alternative implementation of elliptic curve * point arithmetic. @@ -293,5 +293,5 @@ int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp, #endif /* MBEDTLS_ECP_INTERNAL_ALT */ -#endif /* ecp_alt.h */ +#endif /* ecp_internal_alt.h */