From 2b161c33bef53b2ac43bfbe7dffe2a8489e6d086 Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Thu, 1 Nov 2018 16:18:20 +0200 Subject: [PATCH] Fix compilation issue Fix compilation error when both `MBEDTLS_ECP_RESTARTABLE` and the alternative definition of ECDH function are defined. --- library/ecdh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/ecdh.c b/library/ecdh.c index 9fad8e10b..b7e25dcc9 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -198,7 +198,7 @@ int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen, if( ctx == NULL || ctx->grp.pbits == 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); -#if defined(MBEDTLS_ECP_RESTARTABLE) +#if defined(MBEDTLS_ECP_RESTARTABLE) && !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) if( ctx->restart_enabled ) rs_ctx = &ctx->rs; #endif @@ -293,7 +293,7 @@ int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen, if( ctx == NULL || ctx->grp.pbits == 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); -#if defined(MBEDTLS_ECP_RESTARTABLE) +#if defined(MBEDTLS_ECP_RESTARTABLE) && !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) if( ctx->restart_enabled ) rs_ctx = &ctx->rs; #endif @@ -349,7 +349,7 @@ int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen, if( ctx == NULL || ctx->grp.pbits == 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); -#if defined(MBEDTLS_ECP_RESTARTABLE) +#if defined(MBEDTLS_ECP_RESTARTABLE) && !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) if( ctx->restart_enabled ) rs_ctx = &ctx->rs; #endif