Skip to content

Commit 8ee1d99

Browse files
committed
Release v3.7.3 (20240131)
1 parent 77cd260 commit 8ee1d99

26 files changed

Lines changed: 339 additions & 85 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.1.0)
22
project (cryptoauthlib C)
33

44
# Set the current release version
5-
set(VERSION "3.7.0")
5+
set(VERSION "3.7.3")
66
set(VERSION_MAJOR 3)
77
set(VERSION_MINOR 7)
8-
set(VERSION_PATCH 0)
8+
set(VERSION_PATCH 3)
99

1010
# Build Options
1111
option(BUILD_TESTS "Create Test Application with library" OFF)

harmony/config/cryptoauthlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
_HAL_FILES = ["atca_hal.c", "atca_hal.h"]
3636
_CORE_PATHS = ['crypto/**/*', 'crypto/*', 'jwt/*', '*']
3737
_CA_PATHS = ['atcacert/*', 'calib/*', 'host/*']
38-
_TA_PATHS = ['talib/*']
38+
_TA_PATHS = ['atcacert/*', 'talib/*']
3939
_SHA206_PATHS = ['api_206a/*']
4040
_EXCL_FILES = ['atca_utils_sizes.c']
4141

harmony/config/pkcs11.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ def instantiateComponent(calPkcs11Component):
135135
calPkcs11MaxCertsCache.setLabel('Maximum number of certificates cached')
136136
calPkcs11MaxCertsCache.setDefaultValue(5)
137137

138+
calPkcs11MaxKeyIDsCache = calPkcs11Component.createIntegerSymbol('PKCS11_MAX_KEYS_CACHED', None)
139+
calPkcs11MaxKeyIDsCache.setLabel('Maximum number of Key IDs cached')
140+
calPkcs11MaxKeyIDsCache.setDefaultValue(5)
141+
138142
calPkcs11MaxConfig = calPkcs11Component.createIntegerSymbol('CAL_PKCS11_MAX_CONFIG', None)
139143
calPkcs11MaxConfig.setLabel('Maximum number of PKCS11 Config Options')
140144
calPkcs11MaxConfig.setDefaultValue(7)

harmony/templates/pkcs11_config.h.ftl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
#define PKCS11_MAX_CERTS_CACHED ${CAL_PKCS11_MAX_CERTS_CACHED}
8080
#endif
8181

82+
/** Maximum number of Key ID's allowed to be cached*/
83+
#ifndef PKCS11_MAX_KEYS_CACHED
84+
#define PKCS11_MAX_KEYS_CACHED ${PKCS11_MAX_KEYS_CACHED}
85+
#endif
86+
8287
/** Maximum number of cryptographic objects allowed to be cached */
8388
#ifndef PKCS11_MAX_OBJECTS_ALLOWED
8489
#define PKCS11_MAX_OBJECTS_ALLOWED ${CAL_PKCS11_MAX_OBJECTS}

lib/atca_basic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,7 +3548,7 @@ ATCA_STATUS atcab_sha_hmac_init(atca_hmac_sha256_ctx_t* ctx, uint16_t key_slot)
35483548
ATCA_STATUS status = ATCA_UNIMPLEMENTED;
35493549
ATCADeviceType dev_type = atcab_get_device_type();
35503550

3551-
if (atcab_is_ca_device(dev_type))
3551+
if (atcab_is_ca_device(dev_type) || atcab_is_ca2_device(dev_type))
35523552
{
35533553
#if CALIB_SHA_HMAC_EN
35543554
status = calib_sha_hmac_init(g_atcab_device_ptr, ctx, key_slot);
@@ -3579,7 +3579,7 @@ ATCA_STATUS atcab_sha_hmac_update(atca_hmac_sha256_ctx_t* ctx, const uint8_t* da
35793579
ATCA_STATUS status = ATCA_UNIMPLEMENTED;
35803580
ATCADeviceType dev_type = atcab_get_device_type();
35813581

3582-
if (atcab_is_ca_device(dev_type))
3582+
if (atcab_is_ca_device(dev_type) || atcab_is_ca2_device(dev_type))
35833583
{
35843584
#if CALIB_SHA_HMAC_EN
35853585
status = calib_sha_hmac_update(g_atcab_device_ptr, ctx, data, data_size);
@@ -3613,7 +3613,7 @@ ATCA_STATUS atcab_sha_hmac_finish(atca_hmac_sha256_ctx_t* ctx, uint8_t* digest,
36133613
ATCA_STATUS status = ATCA_UNIMPLEMENTED;
36143614
ATCADeviceType dev_type = atcab_get_device_type();
36153615

3616-
if (atcab_is_ca_device(dev_type))
3616+
if (atcab_is_ca_device(dev_type) || atcab_is_ca2_device(dev_type))
36173617
{
36183618
#if CALIB_SHA_HMAC_EN
36193619
status = calib_sha_hmac_finish(g_atcab_device_ptr, ctx, digest, target);
@@ -3650,7 +3650,7 @@ ATCA_STATUS atcab_sha_hmac_ext(ATCADevice device, const uint8_t* data, size_t da
36503650
ATCA_STATUS status = ATCA_UNIMPLEMENTED;
36513651
ATCADeviceType dev_type = atcab_get_device_type_ext(device);
36523652

3653-
if (atcab_is_ca_device(dev_type))
3653+
if (atcab_is_ca_device(dev_type) || atcab_is_ca2_device(dev_type))
36543654
{
36553655
#if CALIB_SHA_HMAC_EN
36563656
status = calib_sha_hmac(device, data, data_size, key_slot, digest, target);

lib/atca_config_check.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@
124124
#define ATCACERT_EN (DEFAULT_ENABLED)
125125
#endif
126126

127+
#ifndef ATCA_NO_HEAP
128+
#define ATCA_HEAP
129+
#endif
130+
127131
/**** AES command ****/
128132

129133
/** \def ATCAB_AES

lib/atca_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
#define ATCA_VERSION_H
3131

3232
// Version format yyyymmdd
33-
#define ATCA_LIBRARY_VERSION_DATE "20231222"
33+
#define ATCA_LIBRARY_VERSION_DATE "20240131"
3434
#define ATCA_LIBRARY_VERSION_MAJOR 3
3535
#define ATCA_LIBRARY_VERSION_MINOR 7
36-
#define ATCA_LIBRARY_VERSION_BUILD 2
36+
#define ATCA_LIBRARY_VERSION_BUILD 3
3737

3838
#endif /* ATCA_VERSION_H */

lib/atcacert/atcacert_client.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
#include "atcacert_der.h"
3434
#include "atcacert_pem.h"
3535
#include "cryptoauthlib.h"
36+
37+
#if ATCA_CA_SUPPORT
3638
#include "calib/calib_basic.h"
39+
#endif
3740

3841
#if ATCACERT_COMPCERT_EN
3942

@@ -146,10 +149,12 @@ ATCA_STATUS atcacert_read_cert_ext(ATCADevice device,
146149
size_t* cert_size)
147150
{
148151
ATCA_STATUS ret = ATCACERT_E_BAD_PARAMS;
152+
#if ATCACERT_COMPCERT_EN
149153
atcacert_device_loc_t device_locs[16];
150154
size_t device_locs_count = 0;
151155
size_t i = 0;
152156
atcacert_build_state_t build_state;
157+
#endif
153158

154159
if (cert_def == NULL || cert_size == NULL)
155160
{
@@ -245,9 +250,11 @@ ATCA_STATUS atcacert_write_cert_ext(ATCADevice device,
245250
size_t cert_size)
246251
{
247252
ATCA_STATUS ret = 0;
253+
#if ATCACERT_COMPCERT_EN
248254
atcacert_device_loc_t device_locs[16];
249255
size_t device_locs_count = 0;
250256
size_t i = 0;
257+
#endif
251258

252259
if (cert_def == NULL || cert == NULL)
253260
{
@@ -511,9 +518,11 @@ ATCA_STATUS atcacert_read_cert_size_ext(ATCADevice device,
511518
const atcacert_def_t* cert_def,
512519
size_t* cert_size)
513520
{
521+
ATCA_STATUS ret = ATCACERT_E_SUCCESS;
522+
#if ATCACERT_COMPCERT_EN
514523
uint8_t buffer[75];
515524
size_t buflen = sizeof(buffer);
516-
ATCA_STATUS ret = ATCACERT_E_SUCCESS;
525+
#endif
517526

518527
if ((NULL == cert_def) || (NULL == cert_size))
519528
{

lib/atcacert/atcacert_def.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ ATCA_STATUS atcacert_get_expire_date(const atcacert_def_t* cert_def,
11311131
return status;
11321132
}
11331133

1134+
#if ATCACERT_COMPCERT_EN
11341135
static void uint8_to_hex(uint8_t num, uint8_t* hex_str)
11351136
{
11361137
uint8_t nibble = (num >> 4) & 0x0Fu;
@@ -1154,7 +1155,6 @@ static void uint8_to_hex(uint8_t num, uint8_t* hex_str)
11541155
}
11551156
}
11561157

1157-
#if ATCACERT_COMPCERT_EN
11581158
ATCA_STATUS atcacert_set_signer_id(const atcacert_def_t* cert_def,
11591159
uint8_t* cert,
11601160
size_t cert_size,
@@ -1172,7 +1172,6 @@ ATCA_STATUS atcacert_set_signer_id(const atcacert_def_t* cert_def,
11721172

11731173
return atcacert_set_cert_element(cert_def, &cert_def->std_cert_elements[STDCERT_SIGNER_ID], cert, cert_size, hex_str, 4);
11741174
}
1175-
#endif
11761175

11771176
static ATCA_STATUS hex_to_uint8(const uint8_t hex_str[2], uint8_t* num)
11781177
{
@@ -1215,7 +1214,6 @@ static ATCA_STATUS hex_to_uint8(const uint8_t hex_str[2], uint8_t* num)
12151214
return ATCACERT_E_SUCCESS;
12161215
}
12171216

1218-
#if ATCACERT_COMPCERT_EN
12191217
ATCA_STATUS atcacert_get_signer_id(const atcacert_def_t* cert_def,
12201218
const uint8_t* cert,
12211219
size_t cert_size,

lib/calib/calib_sha.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,25 +489,30 @@ ATCA_STATUS calib_sha_hmac_update(ATCADevice device, atca_hmac_sha256_ctx_t* ctx
489489
*/
490490
ATCA_STATUS calib_sha_hmac_finish(ATCADevice device, atca_hmac_sha256_ctx_t *ctx, uint8_t* digest, uint8_t target)
491491
{
492-
uint8_t mode = SHA_MODE_HMAC_END;
492+
uint8_t mode;
493493
uint16_t digest_size = 32;
494+
ATCADeviceType dev_type = device->mIface.mIfaceCFG->devtype;
494495

495496
if (device == NULL)
496497
{
497498
return ATCA_TRACE(ATCA_BAD_PARAM, "NULL pointer received");
498499
}
499500

500-
if (ATECC608A == device->mIface.mIfaceCFG->devtype)
501+
switch (dev_type)
501502
{
502-
mode = SHA_MODE_608_HMAC_END;
503-
}
504-
if (atcab_is_ca2_device(device->mIface.mIfaceCFG->devtype))
505-
{
506-
mode = SHA_MODE_ECC204_HMAC_END;
507-
}
508-
if (target != SHA_MODE_TARGET_TEMPKEY)
509-
{
510-
return ATCA_TRACE(ATCA_BAD_PARAM, "Invalid target received");
503+
case ATECC608:
504+
mode = SHA_MODE_608_HMAC_END;
505+
break;
506+
#if ATCA_CA2_SUPPORT
507+
case ECC204:
508+
/* fallthrough */
509+
case TA010:
510+
mode = SHA_MODE_ECC204_HMAC_END;
511+
break;
512+
#endif
513+
default:
514+
mode = SHA_MODE_HMAC_END;
515+
break;
511516
}
512517

513518
mode |= target;

0 commit comments

Comments
 (0)