Skip to content

Commit ce939a9

Browse files
committed
Release v3.2.1
Signed-off-by: Bryan Hunt <[email protected]>
1 parent 159d8b8 commit ce939a9

22 files changed

+143
-48
lines changed

app/pkcs11/example_pkcs11_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ CK_RV pkcs11_config_load_objects(pkcs11_slot_ctx_ptr pSlot)
135135
xLabel.pValue = pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS;
136136
xLabel.ulValueLen = strlen(xLabel.pValue);
137137
xLabel.type = CKA_LABEL;
138-
pkcs11_config_key(NULL, pSlot, pObject, &xLabel);
138+
rv = pkcs11_config_key(NULL, pSlot, pObject, &xLabel);
139139
}
140140
}
141141

@@ -148,7 +148,7 @@ CK_RV pkcs11_config_load_objects(pkcs11_slot_ctx_ptr pSlot)
148148
xLabel.pValue = pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS;
149149
xLabel.ulValueLen = strlen(xLabel.pValue);
150150
xLabel.type = CKA_LABEL;
151-
pkcs11_config_key(NULL, pSlot, pObject, &xLabel);
151+
rv = pkcs11_config_key(NULL, pSlot, pObject, &xLabel);
152152
}
153153
}
154154

app/pkcs11/slot.conf.tmpl

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@
33
# These are processed in order. Configuration parameters must be comma
44
# delimited and may not contain spaces
55

6-
interface = i2c,0xB0
7-
freeslots = 1,2,3
6+
# Set a label for this slot (optional) - will default to <slot>ABC so
7+
# 0.conf will have a default label 00ABC
8+
#label = MCHP
89

9-
# Slot 0 is the primary private key
10-
object = private,device,0
10+
# Configure the device interface for an enabled HAL
11+
# hid,i2c,<address>
12+
# i2c,<address>,<bus>
13+
# spi,<select_line>,<baud>
14+
interface = hid,i2c,0x6c
15+
16+
# Configure the device type - base part number (optional)
17+
device = ATECC608A-TFLXTLS
1118

12-
# Slot 10 is the certificate data for the device's public key
13-
#object = certificate,device,10
19+
#Configure open slots for additional pkcs11 objects (optional)
20+
#freeslots = 1,2,3
1421

15-
# Slot 12 is the intermedate/signer certificate data
16-
#object = certificate,signer,12
22+
# Manually configure keys into device locations (slots/handles)
23+
24+
# Slot 0 is the primary private key
25+
#object = private,device,0
1726

1827
# Slot 15 is a public key
19-
object = public,root,15
28+
#object = public,root,15

harmony/config/pkcs11.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def instantiateComponent(calPkcs11Component):
9191
calPkcs11DebugPrint.setLabel("Enable Debug Print?")
9292
calPkcs11DebugPrint.setDefaultValue(False)
9393

94+
calPkcs11AwsFreeRTOS = calPkcs11Component.createBooleanSymbol("CAL_PKCS11_AWS_FREERTOS", None)
95+
calPkcs11AwsFreeRTOS.setLabel("Enable AWS FreeRTOS Modifications?")
96+
calPkcs11AwsFreeRTOS.setDefaultValue(False)
97+
9498
calPkcs11MaxSlots = calPkcs11Component.createIntegerSymbol('CAL_PKCS11_MAX_SLOTS', None)
9599
calPkcs11MaxSlots.setLabel('Maximum number of PKCS11 slots')
96100
calPkcs11MaxSlots.setDefaultValue(1)

harmony/templates/pkcs11_config.h.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
#define PKCS11_DEBUG_ENABLE ${CAL_PKCS11_ENABLE_DEBUG_PRINT?then(1,0)}
4444
#endif
4545

46+
<#if CAL_PKCS11_AWS_FREERTOS>
47+
#define PKCS11_LABEL_IS_SERNUM 1
48+
</#if>
49+
4650
/** Use a compiled configuration rather than loading from a filestore */
4751
#ifndef PKCS11_USE_STATIC_CONFIG
4852
#define PKCS11_USE_STATIC_CONFIG 1

lib/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ if(ATCA_PKCS11 AND (ATCA_TNGTLS_SUPPORT OR ATCA_TNGLORA_SUPPORT OR ATCA_TFLEX_SU
6565
SET(TNG_SRC ${TNG_SRC} ../app/pkcs11/trust_pkcs11_config.c)
6666
endif()
6767

68+
if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
6869
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${ATCACERT_SRC})
6970
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${CALIB_SRC})
7071
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${TALIB_SRC})
@@ -73,6 +74,7 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${HOST_SRC})
7374
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${JWT_SRC})
7475
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${PKCS11_SRC})
7576
source_group("App/Tng" FILES ${TNG_SRC})
77+
endif()
7678

7779
if (ATCA_MBEDTLS)
7880
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/CMakeLists-mbedtls.txt.in ${CMAKE_BINARY_DIR}/${DEPENDENCY_DIR}/mbedtls_downloader/CMakeLists.txt)
@@ -89,7 +91,9 @@ include_directories(mbedtls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
8991

9092

9193
file(GLOB MBEDTLS_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "mbedtls/*.c")
94+
if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
9295
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${MBEDTLS_SRC})
96+
endif()
9397
endif(ATCA_MBEDTLS)
9498

9599
if (ATCA_WOLFSSL)
@@ -116,12 +120,16 @@ include_directories(wolfssl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
116120

117121

118122
file(GLOB WOLFSSL_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "wolfssl/*.c")
123+
if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
119124
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${WOLFSSL_SRC})
125+
endif()
120126
endif(ATCA_WOLFSSL)
121127

122128
if (ATCA_OPENSSL)
123129
file(GLOB OPENSSL_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "openssl/*.c")
130+
if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
124131
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${OPENSSL_SRC})
132+
endif()
125133
find_package(OpenSSL REQUIRED)
126134
endif(ATCA_OPENSSL)
127135

@@ -239,7 +247,6 @@ if(ATCA_BUILD_SHARED_LIBS)
239247
add_definitions(-DATCA_BUILD_SHARED_LIBS)
240248
endif(ATCA_BUILD_SHARED_LIBS)
241249

242-
#source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${CRYPTOAUTH_SRC})
243250
add_library(cryptoauth ${CRYPTOAUTH_SRC} ${ATCACERT_DEF_SRC})
244251

245252
set_property(TARGET cryptoauth PROPERTY C_STANDARD 99)

lib/atca_basic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ATCA_STATUS atcab_init_ext(ATCADevice* device, ATCAIfaceCfg *cfg)
7878
// If a device has already been initialized, release it
7979
if (*device)
8080
{
81-
atcab_release();
81+
atcab_release_ext(device);
8282
}
8383

8484
#ifdef ATCA_NO_HEAP
@@ -165,12 +165,12 @@ ATCA_STATUS atcab_init_device(ATCADevice ca_device)
165165
ATCA_STATUS atcab_release_ext(ATCADevice* device)
166166
{
167167
#ifdef ATCA_NO_HEAP
168-
ATCA_STATUS status = releaseATCADevice(_gDevice);
168+
ATCA_STATUS status = releaseATCADevice(*device);
169169
if (status != ATCA_SUCCESS)
170170
{
171171
return status;
172172
}
173-
_gDevice = NULL;
173+
*device = NULL;
174174
#else
175175
deleteATCADevice(device);
176176
#endif

lib/atca_compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define ATCA_UINT64_BE_TO_HOST(x) __builtin_bswap64(x)
5252
#endif
5353

54-
#ifdef (WIN32)
54+
#ifdef WIN32
5555
#define SHARED_LIB_EXPORT __declspec(dllexport)
5656
#define SHARED_LIB_IMPORT __declspec(dllimport)
5757
#else

lib/calib/calib_aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
ATCA_STATUS calib_aes(ATCADevice device, uint8_t mode, uint16_t key_id, const uint8_t* aes_in, uint8_t* aes_out)
5050
{
5151
ATCAPacket packet;
52-
ATCACommand ca_cmd = _gDevice->mCommands;
52+
ATCACommand ca_cmd = device->mCommands;
5353
ATCA_STATUS status = ATCA_GEN_FAIL;
5454

5555
do

lib/calib/calib_basic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ ATCA_STATUS calib_get_zone_size(ATCADevice device, uint8_t zone, uint16_t slot,
254254
default: status = ATCA_BAD_PARAM; break;
255255
}
256256
}
257-
else if (_gDevice->mIface->mIfaceCFG->devtype == ATSHA206A)
257+
else if (device->mIface->mIfaceCFG->devtype == ATSHA206A)
258258
{
259259
switch (zone)
260260
{

lib/calib/calib_basic.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
*
1212
@{ */
1313

14+
#ifdef __cplusplus
15+
extern "C" {
16+
#endif
17+
1418
ATCA_STATUS calib_wakeup(ATCADevice device);
1519
ATCA_STATUS calib_idle(ATCADevice device);
1620
ATCA_STATUS calib_sleep(ATCADevice device);
@@ -183,6 +187,10 @@ ATCA_STATUS calib_write_enc(ATCADevice device, uint16_t key_id, uint8_t block, c
183187

184188
ATCA_STATUS calib_write_config_counter(ATCADevice device, uint16_t counter_id, uint32_t counter_value);
185189

190+
#ifdef __cplusplus
191+
}
192+
#endif
193+
186194
/** @} */
187195

188196
#endif

0 commit comments

Comments
 (0)