Skip to content

Commit cdacedb

Browse files
author
Jenia Kogan
authored
Merge pull request #100 from PelionIoT/release-4.13.1
mbed-cloud-client 4.13.1
2 parents c6e135b + 58c9df1 commit cdacedb

File tree

6 files changed

+93
-25
lines changed

6 files changed

+93
-25
lines changed

CHANGELOG.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## Changelog for Izuma Device Management Client
22

3+
### Release 4.13.1 (16.02.2023)
4+
5+
- Improved error logging for certificate enrollment misconfiguration.
6+
- Fixed a failure in FOTA for developer flow in PSA mode. The mechanism of going through a storage reset if the compiled credential file differs from the stored credentials did not work well with PSA.
7+
Read a certificate instead of a private key that we can't read in PSA mode.
8+
- Only synchronous DNS is currently supported.
9+
- [Linux] Change the default DNS to synchronous, by setting `PAL_DNS_API_VERSION` flag to 0.
10+
- [Zephyr] Change the default DNS to synchronous, by setting `DNS API` selection to `POSIX`.
11+
**Note: For Linux devices with version >= 4.11.0, or Zephyr device with version >= 4.9.0 you should override the default DNS setting to synchronous in the application level.**
12+
13+
#### Known issues
14+
15+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
16+
317
### Release 4.13.0 (21.11.2022)
418

519
- Izuma branding changes.
@@ -15,7 +29,13 @@
1529
* If a socket error is encountered, the next try will be done with the original CoaP port `5684`.
1630
* After 2nd failure, we alternate back to the custom port.
1731
* NOTE! Only port 443 can be used as an alternative customer port with Izuma Networks.
32+
33+
#### Known issues
1834

35+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
36+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level:
37+
- For Linux devices, set the `PAL_DNS_API_VERSION` flag to 0.
38+
- For Zephyr devices, set the `DNS API` selection to POSIX.
1939

2040
### Release 4.12.0 (01.03.2022)
2141

@@ -24,9 +44,23 @@
2444
- Introduce a new `LWM2M_COMPLIANT` flag that enables connection to any LwM2M compliant bootstrap and device management services. Disabled by default.
2545
- Introduce a new `DISABLE_SERVER_CERT_VERIFY` flag that disables the server certificate verification during the TLS handshake. Disabled by default.
2646

47+
#### Known issues
48+
49+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
50+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level:
51+
- For Linux devices, set the `PAL_DNS_API_VERSION` flag to 0.
52+
- For Zephyr devices, set the `DNS API` selection to POSIX.
53+
2754
### Release 4.11.2 (01.12.2021)
2855

29-
Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is enabled but trace-level is set below INFO. This fixes a regression introduced in 4.11.0 release.
56+
- Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is enabled but trace-level is set below INFO. This fixes a regression introduced in 4.11.0 release.
57+
58+
#### Known issues
59+
60+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
61+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level:
62+
- For Linux devices, set the `PAL_DNS_API_VERSION` flag to 0.
63+
- For Zephyr devices, set the `DNS API` selection to POSIX.
3064

3165
### Release 4.11.1 (11.10.2021)
3266

@@ -35,6 +69,13 @@ Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is
3569
- [Remote logging] Fixed internal flash configuration to perform a full storage erase before using it.
3670
- Fixed compiler warnings.
3771

72+
#### Known issues
73+
74+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
75+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level:
76+
- For Linux devices, set the `PAL_DNS_API_VERSION` flag to 0.
77+
- For Zephyr devices, set the `DNS API` selection to POSIX.
78+
3879
### Release 4.11.0 (17.09.2021)
3980

4081
### Device Management Client
@@ -78,6 +119,13 @@ Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is
78119

79120
[Linux] Enabled `PAL_DNS_API_VERSION` 3 by default for Linux configurations.
80121

122+
#### Known issues
123+
124+
- [Linux/Zephyr] Asynchronous DNS does not work well, and the device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
125+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level:
126+
- For Linux devices, set the `PAL_DNS_API_VERSION` flag to 0.
127+
- For Zephyr devices, set the `DNS API` selection to POSIX.
128+
81129
### Release 4.10.0 (07.07.2021)
82130

83131
### Device Management Client
@@ -124,6 +172,11 @@ Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is
124172
- Of a component image on an Mbed OS devices.
125173
- Fix: Removed the candidate image file from its original path in Linux after FOTA completion.
126174

175+
#### Known issues
176+
177+
- [Zephyr] Asynchronous DNS does not work well. The device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
178+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level by setting the DNS API selection to POSIX in the application's configuration settings.
179+
127180
### Release 4.9.1 (17.06.2021)
128181

129182
### Device Management Client
@@ -132,6 +185,11 @@ Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is
132185
### Platform Adaptation Layer (PAL)
133186
- [Zephyr] Fixed a memory leak on DNS handling.
134187

188+
#### Known issues
189+
190+
- [Zephyr] Asynchronous DNS does not work well. The device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
191+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level by setting the DNS API selection to POSIX in the application's configuration settings.
192+
135193
### Release 4.9.0 (21.05.2021)
136194

137195
### Device Management Client
@@ -168,6 +226,11 @@ Fixed a potential dead-lock situation in sn_nsdl.c CoAP tracing when tracing is
168226
- Added new PAL_DNS_API_VERSION 3. It's an asynchronous DNS API that can return multiple DNS results.
169227
- This feature is currently implemented only for Linux platform and is disabled by default. You can enable it by defining PAL_DNS_API_VERSION=3. In future releases, this feature will be enabled by default for Linux.
170228

229+
#### Known issues
230+
231+
- [Zephyr] Asynchronous DNS does not work well. The device fails to reconnect to the cloud if some of the pods are restarted. In such a scenario, the device needs to be restarted.
232+
To address this issue, the default DNS settings should be overridden to synchronous DNS in the application level by setting the DNS API selection to POSIX in the application's configuration settings.
233+
171234
### Release 4.8.0 (19.04.2021)
172235

173236
#### Device Management Client

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include "fcc_utils.h"
2222
#include "cs_der_keys_and_csrs.h"
2323

24-
typedef struct fcc_deloveper_mode_item_params {
24+
typedef struct fcc_developer_mode_item_params {
2525
const char *item_name;
2626
kcm_item_type_e item_kcm_type;
2727
const uint8_t *item_data;
2828
const uint32_t item_data_size;
29-
} fcc_deloveper_mode_item_params_s;
29+
} fcc_developer_mode_item_params_s;
3030

3131
//bootstrap endpoint name
3232
extern const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[];
@@ -69,7 +69,7 @@ fcc_status_e fcc_developer_flow(void)
6969
#else
7070
static const uint32_t is_bootstrap_mode = 1;
7171
#endif
72-
const fcc_deloveper_mode_item_params_s fcc_deloveper_mode_item_params_table[] = {
72+
const fcc_developer_mode_item_params_s fcc_developer_mode_item_params_table[] = {
7373

7474
//param name //param kcm type //param data //param data_size
7575
//Device general info
@@ -110,8 +110,8 @@ fcc_status_e fcc_developer_flow(void)
110110
{ NULL, KCM_LAST_ITEM, NULL, 0},
111111
};
112112

113-
const fcc_deloveper_mode_item_params_s* mandatory_items_iter = &fcc_deloveper_mode_item_params_table[0];
114-
uint8_t kcm_item_buffer[KCM_EC_SECP256R1_MAX_PRIV_KEY_DER_SIZE];
113+
const fcc_developer_mode_item_params_s* mandatory_items_iter = &fcc_developer_mode_item_params_table[0];
114+
uint8_t kcm_item_buffer[1024];
115115
size_t act_kcm_item_buffer_size;
116116

117117

@@ -129,18 +129,22 @@ fcc_status_e fcc_developer_flow(void)
129129
// item already exists - this means that storage already contains developer mode prov items.
130130
SA_PV_LOG_INFO("Developer mode prov items already exist on the storage.");
131131

132-
// Read the BS device private key and check if it's equal to the pre-compiled key.
133-
kcm_item_get_data((const uint8_t*)g_fcc_bootstrap_device_private_key_name,
134-
strlen(g_fcc_bootstrap_device_private_key_name),
135-
KCM_PRIVATE_KEY_ITEM,
136-
kcm_item_buffer,
137-
sizeof(kcm_item_buffer),
138-
&act_kcm_item_buffer_size);
139-
140-
if (act_kcm_item_buffer_size == MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY_SIZE) {
141-
// The size of the stored key is equal to the compiled key
142-
if (memcmp(kcm_item_buffer, MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY, MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY_SIZE) == 0) {
143-
// The content of the keys are equal
132+
// Read the BS device certificate and check if it's equal to the pre-compiled cert.
133+
// We can't check private key since it won't work for PSA
134+
kcm_status = kcm_item_get_data((const uint8_t*)g_fcc_bootstrap_device_certificate_name,
135+
strlen(g_fcc_bootstrap_device_certificate_name),
136+
KCM_CERTIFICATE_ITEM,
137+
kcm_item_buffer,
138+
sizeof(kcm_item_buffer),
139+
&act_kcm_item_buffer_size);
140+
141+
SA_PV_ERR_RECOVERABLE_RETURN_IF((kcm_status != KCM_STATUS_SUCCESS), fcc_convert_kcm_to_fcc_status(kcm_status), "Get of the BS cert failed %d", kcm_status);
142+
143+
144+
if (act_kcm_item_buffer_size == MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE_SIZE ) {
145+
// The size of the stored cert is equal to the compiled cert
146+
if (memcmp(kcm_item_buffer, MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE, MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE_SIZE) == 0) {
147+
// The content of the certs are equal
144148
// No need to override the items, just exit the function with "an item exists" status.
145149
SA_PV_LOG_INFO("The stored items are equal to the compiled items.");
146150
return FCC_STATUS_KCM_FILE_EXIST_ERROR;

mbed-client-pal/Configs/pal_config/Linux/Linux_default.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@
184184
#define PAL_NET_DNS_SUPPORT 1
185185
#endif
186186

187-
#if (PAL_NET_DNS_SUPPORT == 1) && !(defined(PAL_DNS_API_VERSION))
188-
#define PAL_DNS_API_VERSION 3 //!< asyncronous DNS API that can return multiple DNS results.
189-
#endif
190-
191187
// Define this to use static memory buffer for mbedtls, instead of standard mbedtls memory system (default is using heap).
192188
//#undef PAL_USE_STATIC_MEMBUF_FOR_MBEDTLS
193189

mbed-client/mbed-client/m2mversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
/** PDMC_PATCH_VERSION
3131
* Pelion Device Management Client patch version
3232
*/
33-
#define PDMC_PATCH_VERSION 0
33+
#define PDMC_PATCH_VERSION 1
3434

3535
#endif // M2MVERSION_H

mbed-client/source/m2mnsdlinterface.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2719,13 +2719,16 @@ bool M2MNsdlInterface::validate_security_object()
27192719
return false;
27202720
}
27212721
break;
2722-
#ifndef MBED_CLIENT_DISABLE_EST_FEATURE
27232722
case M2MSecurity::EST:
2723+
#ifndef MBED_CLIENT_DISABLE_EST_FEATURE
27242724
// Only server public key should be populated for lwm2m, client keys will be generated
27252725
if (!is_bs_server && (!server_key_size || chain_size || pkey_size)) {
27262726
return false;
27272727
}
27282728
break;
2729+
#else
2730+
tr_error("M2MNsdlInterface - EST mode activated - EST feature is NOT configured in!");
2731+
return false;
27292732
#endif
27302733
case M2MSecurity::NoSecurity:
27312734
if (!is_bs_server) {
@@ -2734,6 +2737,7 @@ bool M2MNsdlInterface::validate_security_object()
27342737
break;
27352738
default:
27362739
// Security mode not supported
2740+
tr_error("M2MNsdlInterface - Unknown security mode - not supported.!");
27372741
return false;
27382742
}
27392743
}

zephyr/Kconfig.pal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ config IZUMA_PAL_USE_APPLICATION_NETWORK_CALLBACK
5252

5353
choice
5454
prompt "DNS API"
55-
default IZUMA_PAL_USE_DNS_API_RESOLVE
55+
default IZUMA_PAL_USE_DNS_API_POSIX
5656
help
5757
Select DNS API used by network abstraction implementation.
5858

@@ -66,6 +66,7 @@ choice
6666
bool "DNS Resolve"
6767
depends on DNS_RESOLVER
6868
help
69+
NOTE! Do not use this feature right now. Issues with reconnecting.
6970
Use DNS Resolve's dns_get_addr_info. This call is asynchronous and maps
7071
to Izuma's DNS version 3.
7172

0 commit comments

Comments
 (0)