Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions generated/include/infuse/fs/kv_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions generated/include/infuse/rpc/commands_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions generated/include/infuse/rpc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions generated/include/infuse/tdf/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/security/hardware_unique_key/huk_nrf_kmu_cc3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ int hardware_unique_key_init(void)
}

/* Derive our HUK root from the KMU HUK */
const char *label = "INFUSE_HUK";
const char *context = "CTX";
const char *const label = "INFUSE_HUK";
const char *const context = "CTX";

rc = nrf_cc3xx_platform_kmu_shadow_key_derive(0, HUK_SIZE_BYTES * 8, label, strlen(label),
context, strlen(context), key, 32);
Expand Down
4 changes: 2 additions & 2 deletions samples/crypto/profiling/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum algorithms {
NUM_ALGORITHMS,
};

const char *algorithm_names[] = {
const char *const algorithm_names[] = {
[ASCON_128] = "ascon-128",
[ASCON_128A] = "ascon-128a",
[ASCON_80PQ] = "ascon-80pq",
Expand All @@ -59,7 +59,7 @@ enum sign_alg {
NUM_SIGN_ALGORITHMS,
};

const char *sign_algorithm_names[] = {
const char *const sign_algorithm_names[] = {
[SHA256] = "SHA256",
[HMAC_SHA256] = "HMAC-SHA256",
[ECDSA_SHA256] = "ECDSA-SHA256",
Expand Down
5 changes: 3 additions & 2 deletions samples/validation/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ K_THREAD_DEFINE(gnss_thread, 2048, gnss_validator, NULL, NULL, NULL, 5, 0, 0);
static int disk_validator(void *a, void *b, void *c)
{
#ifdef CONFIG_SDMMC_STM32
const char *disk = DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(st_stm32_sdmmc), disk_name);
const char *const disk = DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(st_stm32_sdmmc), disk_name);
#else
const char *disk = DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(zephyr_sdmmc_disk), disk_name);
const char *const disk =
DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(zephyr_sdmmc_disk), disk_name);
#endif

atomic_inc(&validators_registered);
Expand Down
2 changes: 2 additions & 0 deletions scripts/west_commands/templates/kv_types.h.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions scripts/west_commands/templates/rpc_commands.h.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
3 changes: 3 additions & 0 deletions scripts/west_commands/templates/rpc_runner.c.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* Add the following to `sonar.issue.ignore.allfile`
* SONARQUBE-AUTOGENERATED-IGNORE
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions scripts/west_commands/templates/rpc_types.h.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 2 additions & 0 deletions scripts/west_commands/templates/tdf_definitions.h.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
2 changes: 1 addition & 1 deletion subsys/data_logger/backends/exfat_multi_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int logger_exfat_reset(const struct device *dev, uint32_t block_hint,
{
const struct dl_exfat_config *config = dev->config;
struct dl_exfat_data *data = dev->data;
const char *infuse_prefix = "infuse_";
const char *const infuse_prefix = "infuse_";
uint32_t blocks_erased = 0;
char filename[40];
FILINFO fno;
Expand Down
3 changes: 3 additions & 0 deletions subsys/epacket/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ psa_key_id_t epacket_key_id_get(uint8_t key_type, uint32_t key_identifier, uint3
}
}
interface = key_type & EPACKET_KEY_INTERFACE_MASK;
if (interface >= EPACKET_KEY_INTERFACE_NUM) {
return PSA_KEY_ID_NULL;
}

/* Handle key rotation */
if (storage[interface].rotation != key_rotation) {
Expand Down
4 changes: 2 additions & 2 deletions subsys/fs/secure_storage/secure_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ psa_status_t psa_its_remove(psa_storage_uid_t uid)
int secure_storage_init(void)
{
psa_key_id_t huk_id = hardware_unique_key_id();
const char *info = "SECURE_STORAGE";
const char *salt = "SS_SALT";
const char *const info = "SECURE_STORAGE";
const char *const salt = "SS_SALT";

/* Derive secure storage key from HUK */
secure_storage_key_id = infuse_security_derive_chacha_key(huk_id, salt, strlen(salt), info,
Expand Down
7 changes: 4 additions & 3 deletions subsys/net/coap/infuse_coap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ LOG_MODULE_REGISTER(infuse_coap, CONFIG_INFUSE_COAP_LOG_LEVEL);
/* Determine the locations of '/' characters and encode into array */
static int resource_path_split(const char *resource, uint8_t *component_starts, uint8_t array_len)
{
uint8_t resource_len = strlen(resource);
uint8_t num_paths = 1;
int i = 0;

/* Scan through string for the '/' character */
for (int i = 0; i < resource_len; i++) {
while (resource[i] != '\0') {
if (resource[i] == '/') {
if (num_paths == (array_len - 1)) {
/* Too many path splits */
Expand All @@ -35,9 +35,10 @@ static int resource_path_split(const char *resource, uint8_t *component_starts,
/* Store the start of the next component */
component_starts[num_paths++] = i + 1;
}
i++;
}
/* Add the end of the string with a hypothetical next component */
component_starts[num_paths] = resource_len + 1;
component_starts[num_paths] = i + 1;
return num_paths;
}

Expand Down
2 changes: 1 addition & 1 deletion subsys/validation/validation_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int validation_network_scan(struct net_if *iface)

static int validation_wifi_sntp(void)
{
const char *sntp_server = CONFIG_INFUSE_VALIDATION_SNTP_SERVER;
const char *const sntp_server = CONFIG_INFUSE_VALIDATION_SNTP_SERVER;
char addr_str[INET6_ADDRSTRLEN] = {0};
struct sntp_time s_time;
struct sntp_ctx s_ctx;
Expand Down
2 changes: 1 addition & 1 deletion tests/net/coap/general/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
K_SEM_DEFINE(l4_up, 0, 1);

/* Static COAP test server run by TZI */
const char *coap_test_server = "coap.me";
const char *const coap_test_server = "coap.me";
uint8_t work_area[2048];

struct cb_ctx {
Expand Down
2 changes: 1 addition & 1 deletion tests/net/coap/infuse/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

K_SEM_DEFINE(l4_up, 0, 1);

const char *coap_test_server = "coap.dev.infuse-iot.com";
const char *const coap_test_server = "coap.dev.infuse-iot.com";

/* Hardcoded authentication that only has access to test files */
const uint8_t test_identity[8] = {0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
Expand Down
4 changes: 2 additions & 2 deletions tests/subsys/data_logger/backends/exfat_multi_file/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ZTEST(data_logger_exfat, test_init_constants)
ZTEST(data_logger_exfat, test_init_state)
{
const struct device *logger = DEVICE_DT_GET(DT_NODELABEL(data_logger_exfat));
const char *readme = DISK_NAME ":README.txt";
const char *const readme = DISK_NAME ":README.txt";
struct data_logger_state state;
FIL fp;

Expand All @@ -73,7 +73,7 @@ ZTEST(data_logger_exfat, test_init_state)
ZTEST(data_logger_exfat, test_bad_label)
{
const struct device *logger = DEVICE_DT_GET(DT_NODELABEL(data_logger_exfat));
const char *bad_label = DISK_NAME ":BADLABEL";
const char *const bad_label = DISK_NAME ":BADLABEL";
struct data_logger_state state;

/* Init and write some data */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ZTEST(data_logger_exfat, test_init_constants)
ZTEST(data_logger_exfat, test_init_state)
{
const struct device *logger = DEVICE_DT_GET(DT_NODELABEL(data_logger_exfat));
const char *readme = DISK_NAME ":README.txt";
const char *const readme = DISK_NAME ":README.txt";
struct data_logger_state state;
FIL fp;

Expand All @@ -75,7 +75,7 @@ ZTEST(data_logger_exfat, test_init_state)
ZTEST(data_logger_exfat, test_bad_label)
{
const struct device *logger = DEVICE_DT_GET(DT_NODELABEL(data_logger_exfat));
const char *bad_label = DISK_NAME ":BADLABEL";
const char *const bad_label = DISK_NAME ":BADLABEL";
struct data_logger_state state;

/* Init and write some data */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @copyright 2024 Embeint Inc
* @author scripts/west_commands/cloudgen.py
*
* INFUSE-IOT-AUTOGENERATED
*
* SPDX-License-Identifier: LicenseRef-Embeint
*/

Expand Down
7 changes: 6 additions & 1 deletion tests/subsys/epacket/keys/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ZTEST(epacket_keys, test_network_ids)

ZTEST(epacket_keys, test_invalid_key)
{
const char *info = "test";
const char *const info = "test";
psa_key_id_t id;

zassert_equal(-EINVAL, epacket_key_derive(PSA_KEY_ID_NULL, info, strlen(info), 1, &id));
Expand Down Expand Up @@ -162,6 +162,11 @@ ZTEST(epacket_keys, test_key_id_get)
{
psa_key_id_t id_1, id_2;

/* Invalid interface ID */
id_1 = epacket_key_id_get(EPACKET_KEY_INTERFACE_NUM,
infuse_security_network_key_identifier(), 1);
zassert_equal(PSA_KEY_ID_NULL, id_1);

/* We expect rotations of the same interface key to have the same ID */
id_1 = epacket_key_id_get(EPACKET_KEY_DEVICE | EPACKET_KEY_INTERFACE_SERIAL,
infuse_security_device_key_identifier(), 1);
Expand Down