Skip to content

Commit 9b0bc6a

Browse files
authored
Merge pull request #8 from ARMmbed/release-1.4.0
mbed-cloud-client 1.4.0
2 parents 3137b3d + 74960cf commit 9b0bc6a

File tree

142 files changed

+4742
-2249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+4742
-2249
lines changed

CHANGELOG.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,50 @@
11
## Changelog for Mbed Cloud Client
22

3-
### Release 1.3.3 (11.06.2018)
3+
### Release 1.4.0 (13.07.2018)
4+
* Fixed a timer initialization bug under connection handler.
5+
* Linux: Updated mbed-coap to 4.5.0.
6+
* This version of Cloud Client has been tested with Mbed OS 5.9.2.
7+
8+
#### Platform Adaptation Layer (PAL)
9+
10+
* Introduced support for ARIA cipher suite introduced in mbedTLS 2.10.0.
11+
* Introduced MbedTLS configuration support for non-TRNG boards like NUCLEO-F411RE.
12+
* Hook-up point for allowing application to provide its own reboot function.
13+
* Defining `PAL_USE_APPLICATION_REBOOT` activates this feature.
14+
* You must define the function `void pal_plat_osApplicationReboot(void)` in your application to provide the required functionality.
15+
* Introduced the feature flag `PAL_USE_APPLICATION_REBOOT` for application to override generic reboot functionality, which is useful for different Linux flavors.
16+
* New asynchronous DNS API (activated in application mbed_app.json via `mbed-client-pal.pal-dns-api-version : 2`) with Mbed OS 5.9.x.
17+
18+
#### Factory configurator client
19+
20+
* Chain verification failure will result in `KCM_STATUS_CERTIFICATE_CHAIN_VERIFICATION_FAILED` error instead of `FCC_STATUS_CERTIFICATE_CHAIN_VERIFICATION_FAILED`.
21+
* Improved robustness of factory serial communication layer.
22+
* Define `KCM_MAX_NUMBER_OF_CERTITICATES_IN_CHAIN` was renamed to `KCM_MAX_NUMBER_OF_CERTIFICATES_IN_CHAIN`.
23+
24+
#### Mbed Cloud Update
25+
26+
* Improved Linux shell scripts for compatibility and robustness.
27+
* Fixed an issue in `ARM_UC_HUB_Initialize()` and `ARM_UC_HUB_Uninitialize()` to prevent these functions being called when Update client is in the wrong state.
28+
* Fixed compiler warnings.
29+
* Removed designated initialisers from C++ code.
30+
* Update results are now sent synchronously to ensure that the Update Client hub is in the correct state if several LWM2M operations are performed in rapid succession.
31+
* Added error messages for missing commands in `arm_update_activate.sh`.
32+
* Added error reporting when there is not enough space on the device to store the firmware image candidate.
33+
* Added registration for the scheduler error handler.
34+
35+
#### PAL Platform
36+
37+
* Introducing mbedTLS 2.10.0 support for ARIA cipher suite.
38+
39+
### Release 1.3.3 (08.06.2018)
440

541
#### Mbed Cloud Client
642

743
* Fixed issue: Wrong CoAP ping message. CoAP ping must be sent as an empty confirmable message.
844
* In the previous versions, the client in queue mode went to sleep while in reconnection mode. Now, it completes the connection before going to sleep.
945
* This version of Cloud Client supports Mbed OS 5.8.5 and onwards patch releases.
46+
* Improvements for connection handler, removed usage of static pointer to class. There is now possible to allocate more than one class M2MConnectionSecurityPimpl pareller.
47+
* Support for new asynchronous DNS API ("mbed-client-pal.pal-dns-api-version : 2") with Mbed OS 5.9.x.
1048

1149
#### Factory configurator client
1250

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ else()
1212
endif()
1313

1414

15-
SET(MBED_CLOUD_CLIENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mbed-cloud-client)
15+
SET(MBED_CLOUD_CLIENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mbed-cloud-client)
1616

1717
add_definitions(-DMBED_CONF_NANOSTACK_EVENTLOOP_EXCLUDE_HIGHRES_TIMER)
1818
add_definitions(-DMBED_CONF_NANOSTACK_EVENTLOOP_USE_PLATFORM_TICK_TIMER)
@@ -127,6 +127,8 @@ ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/atomic-queue)
127127
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/atomic-queue/atomic-queue)
128128
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/common)
129129
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/common/update-client-common)
130+
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/resume-engine)
131+
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/resume-engine/resume-engine)
130132
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/control-center)
131133
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/control-center/update-client-control-center)
132134
ADD_GLOBALDIR(${UPDATE_SOURCE_DIR}/modules/device-identity)
@@ -163,6 +165,7 @@ FILE(GLOB MBED_CLOUD_CLIENT_SRC
163165
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.c"
164166
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp"
165167
"${MBED_CLIENT_SOURCE_DIR}/source/*.cpp"
168+
"${MBED_CLIENT_SOURCE_DIR}/source/*.c"
166169
"${MBED_CLIENT_SOURCE_DIR}/mbed-client-c/source/*.c"
167170
"${MBED_CLIENT_SOURCE_DIR}/mbed-client-classic/source/*.cpp"
168171
"${MBED_CLIENT_SOURCE_DIR}/mbed-client-mbed-tls/source/*.cpp"
@@ -206,10 +209,12 @@ if ((${OS_BRAND} MATCHES "Linux"))
206209
"${UPDATE_SOURCE_DIR}/source/*.c"
207210
"${UPDATE_SOURCE_DIR}/modules/atomic-queue/source/*.c"
208211
"${UPDATE_SOURCE_DIR}/modules/common/source/*.c"
212+
"${UPDATE_SOURCE_DIR}/modules/resume-engine/source/*.c"
209213
"${UPDATE_SOURCE_DIR}/modules/control-center/source/*.c"
210214
"${UPDATE_SOURCE_DIR}/modules/device-identity/source/*.c"
211215
"${UPDATE_SOURCE_DIR}/modules/firmware-manager/source/*.c"
212216
"${UPDATE_SOURCE_DIR}/modules/lwm2m-mbed/source/*.cpp"
217+
"${UPDATE_SOURCE_DIR}/modules/lwm2m-mbed/source/*.c"
213218
"${UPDATE_SOURCE_DIR}/modules/manifest-manager/source/*.c"
214219
"${UPDATE_SOURCE_DIR}/modules/source-http/source/*.c"
215220
"${UPDATE_SOURCE_DIR}/modules/source-http-socket/source/*.c"

factory-configurator-client/factory-configurator-client/factory-configurator-client/fcc_status.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ extern "C" {
6060
FCC_STATUS_OUTPUT_INFO_ERROR, //!< The process failed in output info creation.
6161
FCC_STATUS_WARNING_CREATE_ERROR, //!< The process failed in output info creation.
6262
FCC_STATUS_UTC_OFFSET_WRONG_FORMAT, //!< Current UTC is wrong.
63-
FCC_STATUS_CERTIFICATE_PUBLIC_KEY_CORRELATION_ERROR, //!< Certificate's public key failed do not matches to corresponding private key
64-
FCC_STATUS_CERTIFICATE_CHAIN_VERIFICATION_FAILED, //!< One of the certificates in the chain does not match its predecessor
63+
FCC_STATUS_CERTIFICATE_PUBLIC_KEY_CORRELATION_ERROR, //!< Certificate's public key failed do not matches to corresponding private key
6564
FCC_STATUS_BUNDLE_INVALID_KEEP_ALIVE_SESSION_STATUS,//!< The message status is invalid.
6665
FCC_STATUS_TOO_MANY_CSR_REQUESTS, //!< The message contained more than CSR_MAX_NUMBER_OF_CSRS CSR requests
6766
FCC_MAX_STATUS = 0x7fffffff

factory-configurator-client/factory-configurator-client/source/fcc_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ fcc_status_e fcc_convert_kcm_to_fcc_status(kcm_status_e kcm_result)
104104
break;
105105
case KCM_STATUS_SELF_GENERATED_CERTIFICATE_VERIFICATION_ERROR:
106106
fcc_status = FCC_STATUS_CERTIFICATE_PUBLIC_KEY_CORRELATION_ERROR;
107+
break;
107108
case KCM_STATUS_FILE_EXIST:
108-
case (KCM_STATUS_KEY_EXIST):
109+
case KCM_STATUS_KEY_EXIST:
109110
fcc_status = FCC_STATUS_KCM_FILE_EXIST_ERROR;
110111
break;
111112
case KCM_CRYPTO_STATUS_UNSUPPORTED_HASH_MODE:

factory-configurator-client/factory-configurator-client/source/fcc_verification.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,18 +729,17 @@ static fcc_status_e verify_firmware_update_certificate(void)
729729
uint8_t *parameter_name = (uint8_t*)g_fcc_update_authentication_certificate_name;
730730
size_t size_of_parameter_name = strlen(g_fcc_update_authentication_certificate_name);
731731
palX509Handle_t x509_cert_handle = NULLPTR;
732-
kcm_cert_chain_context_int_s *cert_chain;
732+
kcm_cert_chain_context_int_s *cert_chain = NULL;
733733
kcm_cert_chain_handle chain_handle;
734734
size_t chain_len = 0;
735735

736736
SA_PV_LOG_TRACE_FUNC_ENTER_NO_ARGS();
737737

738738
// Open device certificate as chain.
739739
kcm_status = kcm_cert_chain_open(&chain_handle, parameter_name, size_of_parameter_name, &chain_len);
740-
cert_chain = (kcm_cert_chain_context_int_s *)chain_handle;
741740

742741
// If item does not exist or is empty -set warning
743-
if (kcm_status == KCM_STATUS_ITEM_NOT_FOUND || kcm_status == KCM_STATUS_ITEM_IS_EMPTY) {
742+
if (kcm_status == KCM_STATUS_ITEM_NOT_FOUND ) {
744743
fcc_output_status = fcc_store_warning_info((const uint8_t*)parameter_name, size_of_parameter_name, g_fcc_item_not_set_warning_str);
745744
SA_PV_ERR_RECOVERABLE_GOTO_IF((fcc_output_status != FCC_STATUS_SUCCESS),
746745
fcc_status = FCC_STATUS_WARNING_CREATE_ERROR,
@@ -749,9 +748,12 @@ static fcc_status_e verify_firmware_update_certificate(void)
749748
g_fcc_item_not_set_warning_str);
750749
fcc_status = FCC_STATUS_SUCCESS;
751750
} else {
751+
752752
//If get kcm data returned error, exit with error
753753
SA_PV_ERR_RECOVERABLE_GOTO_IF((kcm_status != KCM_STATUS_SUCCESS), fcc_status = fcc_convert_kcm_to_fcc_status(kcm_status), exit, "Failed to get update certificate data");
754754

755+
cert_chain = (kcm_cert_chain_context_int_s *)chain_handle;
756+
755757
// Verify expiration of all certificates in firmware chain
756758
// ADAM: Maybe change to function that gets verify_certificate_expiration as callback function (seems unnecessary for now...)
757759
while (cert_chain->current_cert_index < cert_chain->num_of_certificates_in_chain) {
@@ -773,7 +775,10 @@ static fcc_status_e verify_firmware_update_certificate(void)
773775
}
774776

775777
exit:
776-
kcm_cert_chain_close(chain_handle);
778+
//Close the chain in case it was created
779+
if ( cert_chain != NULL) {
780+
kcm_cert_chain_close(chain_handle);
781+
}
777782
if (x509_cert_handle != NULLPTR) {
778783
cs_close_handle_x509_cert(&x509_cert_handle);
779784
}

factory-configurator-client/fcc-bundle-handler/source/fcc_bundle_certificate_chain_utils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// ----------------------------------------------------------------------------
16-
16+
#ifndef USE_TINY_CBOR
1717
#include "fcc_bundle_handler.h"
1818
#include "cn-cbor.h"
1919
#include "pv_error_handling.h"
@@ -22,6 +22,7 @@
2222
#include "fcc_output_info_handler.h"
2323
#include "fcc_malloc.h"
2424
#include "fcc_time_profiling.h"
25+
#include "fcc_utils.h"
2526

2627

2728
/** Processes certificate chain list.
@@ -59,7 +60,6 @@ fcc_status_e fcc_bundle_process_certificate_chains(const cn_cbor *cert_chains_li
5960

6061
certificate_data = NULL;
6162

62-
//fcc_bundle_clean_and_free_data_param(&certificate_chain);
6363

6464
//Get certificate chain CBOR struct at index cert_chain_index
6565
cert_chain_cb = cn_cbor_index(cert_chains_list_cb, cert_chain_index);
@@ -92,9 +92,8 @@ fcc_status_e fcc_bundle_process_certificate_chains(const cn_cbor *cert_chains_li
9292
certificate_chain.private_key_name_len);
9393
SA_PV_ERR_RECOVERABLE_GOTO_IF((kcm_result != KCM_STATUS_SUCCESS), fcc_status = FCC_STATUS_CERTIFICATE_PUBLIC_KEY_CORRELATION_ERROR, exit, "Failed to verify leaf certificate against given private key (%" PRIu32 ") ", cert_chain_index);
9494
}
95-
kcm_result = kcm_cert_chain_add_next(cert_chain_handle, certificate_data, certificate_data_size);
96-
SA_PV_ERR_RECOVERABLE_GOTO_IF((kcm_result == KCM_STATUS_CERTIFICATE_CHAIN_VERIFICATION_FAILED), fcc_status = FCC_STATUS_CERTIFICATE_CHAIN_VERIFICATION_FAILED, exit, "Failed to add certificate chain at index (%" PRIu32 "): PK does not match signature", cert_chain_index);
97-
SA_PV_ERR_RECOVERABLE_GOTO_IF((kcm_result != KCM_STATUS_SUCCESS), fcc_status = FCC_STATUS_KCM_ERROR, exit, "Failed to add certificate chain at index (%" PRIu32 ") ", cert_chain_index);
95+
kcm_result = kcm_cert_chain_add_next(cert_chain_handle, certificate_data, certificate_data_size);
96+
SA_PV_ERR_RECOVERABLE_GOTO_IF((kcm_result != KCM_STATUS_SUCCESS), fcc_status = fcc_convert_kcm_to_fcc_status(kcm_result), exit, "Failed to add certificate chain at index (%" PRIu32 ") ", cert_chain_index);
9897
}
9998
// close chain
10099
kcm_result = kcm_cert_chain_close(cert_chain_handle);
@@ -125,3 +124,4 @@ fcc_status_e fcc_bundle_process_certificate_chains(const cn_cbor *cert_chains_li
125124

126125
return fcc_status;
127126
}
127+
#endif

factory-configurator-client/fcc-bundle-handler/source/fcc_bundle_certificate_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// ----------------------------------------------------------------------------
16-
16+
#ifndef USE_TINY_CBOR
1717
#include "fcc_bundle_handler.h"
1818
#include "cn-cbor.h"
1919
#include "pv_error_handling.h"
@@ -98,3 +98,4 @@ fcc_status_e fcc_bundle_process_certificates(const cn_cbor *certs_list_cb)
9898
SA_PV_LOG_TRACE_FUNC_EXIT_NO_ARGS();
9999
return fcc_status;
100100
}
101+
#endif

factory-configurator-client/fcc-bundle-handler/source/fcc_bundle_common_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// ----------------------------------------------------------------------------
16-
16+
#ifndef USE_TINY_CBOR
1717
#include "fcc_bundle_handler.h"
1818
#include "cn-cbor.h"
1919
#include "pv_error_handling.h"
@@ -312,3 +312,4 @@ fcc_status_e fcc_bundle_factory_disable( void )
312312
}
313313
return fcc_status;
314314
}
315+
#endif

factory-configurator-client/fcc-bundle-handler/source/fcc_bundle_config_params_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// ----------------------------------------------------------------------------
16-
16+
#ifndef USE_TINY_CBOR
1717
#include "fcc_bundle_handler.h"
1818
#include "cn-cbor.h"
1919
#include "pv_error_handling.h"
@@ -101,3 +101,4 @@ fcc_status_e fcc_bundle_process_config_params(const cn_cbor *config_params_list_
101101

102102
return fcc_status;
103103
}
104+
#endif

factory-configurator-client/fcc-bundle-handler/source/fcc_bundle_csr_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// ----------------------------------------------------------------------------
16-
16+
#ifndef USE_TINY_CBOR
1717
#include "fcc_bundle_utils.h"
1818
#include "fcc_bundle_handler.h"
1919
#include "fcc_malloc.h"
@@ -336,3 +336,4 @@ fcc_status_e fcc_bundle_process_csrs(const cn_cbor *csrs_list_cb, cn_cbor *respo
336336

337337
return fcc_status;
338338
}
339+
#endif

0 commit comments

Comments
 (0)