ECDH: Prevent direct access in non-legacy mode
Some sample programs access structure fields directly. Making these work is
desirable in the long term, but these are not essential for the core
functionality in non-legacy mode.
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index e7d29c3..dd4303b 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -862,7 +862,7 @@
}
#endif
-#if defined(MBEDTLS_ECDH_C)
+#if defined(MBEDTLS_ECDH_C) && defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
if( todo.ecdh )
{
mbedtls_ecdh_context ecdh;