Added new build option for Microchip CryptoAuthLib (--enable-cryptoauthlib). Build fixes with WOLFSSL_ATECC508A enabled.

This commit is contained in:
David Garske
2018-09-11 15:46:46 -07:00
parent ba9f21bad6
commit d67cb9e875
4 changed files with 23 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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