From ee83710a0a225c4d39cc4d7a59413369c0a4e6f8 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 16 Jun 2017 16:17:01 -0700 Subject: [PATCH] Fix for building only curve small and ed disabled. Fix for client assuming supported curves is enabled with curve. --- examples/client/client.c | 4 ++-- wolfssl/wolfcrypt/fe_operations.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index eab3d10ce..f958d6ab8 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1559,7 +1559,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("DisableExtendedMasterSecret failed"); } #endif -#ifdef HAVE_CURVE25519 +#if defined(HAVE_CURVE25519) && defined(HAVE_SUPPORTED_CURVES) if (useX25519) { if (wolfSSL_CTX_UseSupportedCurve(ctx, WOLFSSL_ECC_X25519) != SSL_SUCCESS) { @@ -1570,7 +1570,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("unable to support secp256r1"); } } -#endif +#endif /* HAVE_CURVE25519 && HAVE_SUPPORTED_CURVES */ if (benchmark) { ((func_args*)args)->return_code = diff --git a/wolfssl/wolfcrypt/fe_operations.h b/wolfssl/wolfcrypt/fe_operations.h index a331d57fd..0118f471f 100644 --- a/wolfssl/wolfcrypt/fe_operations.h +++ b/wolfssl/wolfcrypt/fe_operations.h @@ -89,10 +89,13 @@ WOLFSSL_LOCAL void fe_mul121666(fe,fe); WOLFSSL_LOCAL void fe_cmov(fe,const fe, int); WOLFSSL_LOCAL void fe_pow22523(fe,const fe); +#if defined(HAVE___UINT128_T) /* 64 type needed for SHA512 */ WOLFSSL_LOCAL uint64_t load_3(const unsigned char *in); WOLFSSL_LOCAL uint64_t load_4(const unsigned char *in); -#endif /* !CURVE25519_SMALL */ +#endif + +#endif /* !CURVE25519_SMALL || !ED25519_SMALL */ /* Use less memory and only 32bit types or less, but is slower Based on Daniel Beer's public domain work. */