ATECC: Option to disable I2C transport key

This commit is contained in:
Martin Akman
2020-01-04 10:23:03 +10:00
parent 809472febc
commit 6c1e0ff049
2 changed files with 9 additions and 0 deletions

View File

@ -347,7 +347,11 @@ int atmel_ecc_create_pms(int slotId, const uint8_t* peerKey, uint8_t* pms)
ATECC_GET_ENC_KEY(read_key, sizeof(read_key)); ATECC_GET_ENC_KEY(read_key, sizeof(read_key));
/* send the encrypted version of the ECDH command */ /* send the encrypted version of the ECDH command */
#if defined(ATECC_USE_TRANSPORT_KEY) && ATECC_USE_TRANSPORT_KEY
ret = atcab_ecdh_enc(slotId, peerKey, pms, read_key, slotIdEnc); ret = atcab_ecdh_enc(slotId, peerKey, pms, read_key, slotIdEnc);
#else
ret = atcab_ecdh(slotId, peerKey, pms);
#endif
ret = atmel_ecc_translate_err(ret); ret = atmel_ecc_translate_err(ret);
/* free the ECDHE slot */ /* free the ECDHE slot */

View File

@ -60,6 +60,11 @@
#define ATECC_SLOT_ENC_PARENT (0x7) #define ATECC_SLOT_ENC_PARENT (0x7)
#endif #endif
/* Use a I2C transport key */
#ifndef ATECC_USE_TRANSPORT_KEY
#define ATECC_USE_TRANSPORT_KEY 1
#endif
/* ATECC_KEY_SIZE required for ecc.h */ /* ATECC_KEY_SIZE required for ecc.h */
#include <wolfssl/wolfcrypt/ecc.h> #include <wolfssl/wolfcrypt/ecc.h>