diff --git a/configure.ac b/configure.ac index a544cd7e8..e5d49c8e2 100644 --- a/configure.ac +++ b/configure.ac @@ -788,6 +788,20 @@ fi AM_CONDITIONAL([BUILD_PKCALLBACKS], [ test "x$ENABLED_PKCALLBACKS" = "xyes" ]) +AC_ARG_ENABLE([cryptoauthlib], + [AS_HELP_STRING([--enable-cryptoauthlib],[Enable CryptoAuthLib (default: disabled)])], + [ ENABLED_CRYPTOAUTHLIB=$enableval ], + [ ENABLED_CRYPTOAUTHLIB=no ] + ) + +if test "$ENABLED_CRYPTOAUTHLIB" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ATECC508A" +fi + +AM_CONDITIONAL([BUILD_CRYPTOAUTHLIB], [ test "x$ENABLED_CRYPTOAUTHLIB" = "xyes" ]) + + # sniffer doesn't work in maxstrength mode if test "$ENABLED_SNIFFER" = "yes" && test "$ENABLED_MAXSTRENGTH" = "yes" then diff --git a/tests/api.c b/tests/api.c index c565bdda6..4d13402a1 100644 --- a/tests/api.c +++ b/tests/api.c @@ -14266,7 +14266,8 @@ static int test_wc_ecc_pointFns (void) { int ret = 0; -#if defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT) && !defined(WC_NO_RNG) +#if defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT) && \ + !defined(WC_NO_RNG) && !defined(WOLFSSL_ATECC508A) ecc_key key; WC_RNG rng; ecc_point* point = NULL; @@ -14440,7 +14441,8 @@ static int test_wc_ecc_shared_secret_ssh (void) { int ret = 0; -#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && !defined(WC_NO_RNG) +#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && \ + !defined(WC_NO_RNG) && !defined(WOLFSSL_ATECC508A) ecc_key key, key2; WC_RNG rng; int keySz = KEY32; diff --git a/wolfcrypt/src/include.am b/wolfcrypt/src/include.am index a68dae838..83a1b7b90 100644 --- a/wolfcrypt/src/include.am +++ b/wolfcrypt/src/include.am @@ -52,7 +52,6 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \ wolfcrypt/src/port/arm/armv8-aes.c \ wolfcrypt/src/port/arm/armv8-sha256.c \ wolfcrypt/src/port/nxp/ksdk_port.c \ - wolfcrypt/src/port/atmel/atmel.c \ wolfcrypt/src/port/atmel/README.md \ wolfcrypt/src/port/xilinx/xil-sha3.c \ wolfcrypt/src/port/xilinx/xil-aesgcm.c \ @@ -96,3 +95,7 @@ src_libwolfssl_la_SOURCES += wolfcrypt/src/port/intel/quickassist_mem.c EXTRA_DIST += wolfcrypt/src/port/intel/README.md endif + +if BUILD_CRYPTOAUTHLIB +src_libwolfssl_la_SOURCES += wolfcrypt/src/port/atmel/atmel.c +endif diff --git a/wolfssl/wolfcrypt/port/atmel/atmel.h b/wolfssl/wolfcrypt/port/atmel/atmel.h index a65697893..8372742f0 100644 --- a/wolfssl/wolfcrypt/port/atmel/atmel.h +++ b/wolfssl/wolfcrypt/port/atmel/atmel.h @@ -70,6 +70,7 @@ extern t_atcert atcert; void atmel_init(void); void atmel_finish(void); int atmel_get_random_number(uint32_t count, uint8_t* rand_out); +int atmel_get_random_block(unsigned char* output, unsigned int sz); long atmel_get_curr_time_and_date(long* tm); #ifdef WOLFSSL_ATECC508A