From fe0669f52ac62abf3a25c58e737eb467d013aa31 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Fri, 27 Apr 2018 17:43:32 +0100 Subject: [PATCH] ecp: Fix binary compatibility with group ID We naturally added the new Curve448 ECP group ID in alphabetical order in the mbedtls_ecp_group_id enum. However, this causes binary incompatibility issues as previous binaries will use values for groups that now have a different meaning. For example, MBEDTLS_ECP_DP_SECP192K1, old value 10, would mean Curve448 (MBEDTLS_ECP_DP_CURVE448) and the wrong group ID used. Fix the binary compatibility issue by adding new enum entries to the end of the enum, even though this isn't so great for readbility as the list is no longer in alphabetical order. However, the list wasn't perfectly in alphabetical order before anyway. --- include/mbedtls/ecp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mbedtls/ecp.h b/include/mbedtls/ecp.h index 3ad74e602..3a407986d 100644 --- a/include/mbedtls/ecp.h +++ b/include/mbedtls/ecp.h @@ -76,10 +76,10 @@ typedef enum MBEDTLS_ECP_DP_BP384R1, /*!< Domain parameters for 384-bit Brainpool curve. */ MBEDTLS_ECP_DP_BP512R1, /*!< Domain parameters for 512-bit Brainpool curve. */ MBEDTLS_ECP_DP_CURVE25519, /*!< Domain parameters for Curve25519. */ - MBEDTLS_ECP_DP_CURVE448, /*!< Domain parameters for Curve448. */ MBEDTLS_ECP_DP_SECP192K1, /*!< Domain parameters for 192-bit "Koblitz" curve. */ MBEDTLS_ECP_DP_SECP224K1, /*!< Domain parameters for 224-bit "Koblitz" curve. */ MBEDTLS_ECP_DP_SECP256K1, /*!< Domain parameters for 256-bit "Koblitz" curve. */ + MBEDTLS_ECP_DP_CURVE448, /*!< Domain parameters for Curve448. */ } mbedtls_ecp_group_id; /**