Skip to content

Commit f456180

Browse files
Vge0rgecarlescufi
authored andcommitted
nrf_security: Minor compliance fixes
No funtional change here, just fixes spacing issues causing compliance failures in nrf_security and TFM. Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
1 parent ce4acf2 commit f456180

File tree

9 files changed

+31
-33
lines changed

9 files changed

+31
-33
lines changed

include/tfm/platform_otp_ids.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern "C" {
1414
#endif
1515

1616
enum tfm_otp_element_id_t {
17-
PLAT_OTP_ID_LCS = UINT32_MAX -1,
17+
PLAT_OTP_ID_LCS = UINT32_MAX - 1,
1818
PLAT_OTP_ID_MAX = UINT32_MAX,
1919
};
2020

modules/trusted-firmware-m/tfm_boards/external_core.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ if(NOT PSA_CRYPTO_EXTERNAL_CORE)
1313
return()
1414
endif()
1515

16-
# Note that
17-
1816
# Adjusting includes from spe-CMakeLists.txt which has the following heading:
1917
#
2018
# This CMake script is prepard by TF-M for building the non-secure side
@@ -47,7 +45,7 @@ if(TARGET psa_interface)
4745
# Mbed TLS (mbedcrypto) PSA headers
4846
${ARM_MBEDTLS_PATH}/library
4947
${ARM_MBEDTLS_PATH}/include
50-
${ARM_MBEDTLS_PATH}/include/library
48+
${ARM_MBEDTLS_PATH}/include/library
5149
)
5250
endif()
5351

modules/trusted-firmware-m/tfm_boards/external_core_install.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install(
3030
FILES
3131
${OBERON_PSA_CORE_PATH}/include/mbedtls/build_info.h
3232
${OBERON_PSA_CORE_PATH}/include/mbedtls/config_psa.h
33-
DESTINATION
33+
DESTINATION
3434
${INSTALL_INTERFACE_INC_DIR}/mbedtls
3535
)
3636

subsys/nrf_security/cmake/extensions.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ endmacro()
167167
#
168168
macro(nrf_security_add_zephyr_options_library lib_name)
169169
if(TARGET zephyr_interface)
170-
# Add an an filtered version of zephyr_interface (PSA crypto interface filtered out)
170+
# Add an filtered version of zephyr_interface (PSA crypto interface filtered out)
171171
target_compile_options(${lib_name} PRIVATE $<TARGET_PROPERTY:zephyr_interface,INTERFACE_COMPILE_OPTIONS>)
172172
target_compile_definitions(${lib_name} PRIVATE $<TARGET_PROPERTY:zephyr_interface,INTERFACE_COMPILE_DEFINITIONS>)
173173
# Ensure that the PSA crypto interface include folder isn't added in library builds (filtered out)
174-
target_include_directories(${lib_name}
174+
target_include_directories(${lib_name}
175175
PRIVATE
176176
$<FILTER:$<TARGET_PROPERTY:zephyr_interface,INTERFACE_INCLUDE_DIRECTORIES>,EXCLUDE,${PSA_CRYPTO_CONFIG_INTERFACE_PATH_REGEX}>
177177
)
178178
# Ensure that the PSA crypto interface include folder isn't added in library builds (filtered out)
179-
target_include_directories(${lib_name}
179+
target_include_directories(${lib_name}
180180
PRIVATE
181181
$<FILTER:$<TARGET_PROPERTY:zephyr_interface,INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>,EXCLUDE,${PSA_CRYPTO_CONFIG_INTERFACE_PATH_REGEX}>
182182
)

subsys/nrf_security/cmake/generate_configs.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ macro(generate_mbedcrypto_interface_configs)
4444
# Empty out previous versions of interface config-files
4545
file(REMOVE_RECURSE ${generated_include_path})
4646

47-
# Generate MBEDCRYPTO_CONFIG_FILE
47+
# Generate MBEDCRYPTO_CONFIG_FILE
4848
if(CONFIG_MBEDTLS_LEGACY_CRYPTO_C)
4949
include(${NRF_SECURITY_ROOT}/cmake/legacy_crypto_config.cmake)
5050
else()
@@ -56,7 +56,7 @@ macro(generate_mbedcrypto_interface_configs)
5656

5757
# Note: Interface doesn't need PSA_CRYPTO_USER_CONFIG_FILE
5858

59-
# Restore the backup configurations
59+
# Restore the backup configurations
6060
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_SPM)
6161
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_C)
6262
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
@@ -129,7 +129,7 @@ macro(generate_mbedcrypto_library_configs)
129129
# Generate the PSA_CRYPTO_USER_CONFIG_FILE (PSA_NEED configurations)
130130
include(${NRF_SECURITY_ROOT}/cmake/psa_crypto_config.cmake)
131131

132-
# Restore the backup configurations
132+
# Restore the backup configurations
133133
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_C)
134134
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
135135
kconfig_restore_backup_config(CONFIG_MBEDTLS_PSA_CRYPTO_SPM)

subsys/nrf_security/cmake/nrf_config.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
6-
# Convert all platform and TLS/DTLS and X.509 Kconfig variables for Mbed TLS
6+
# Convert all platform and TLS/DTLS and X.509 Kconfig variables for Mbed TLS
77
# (strip CONFIG_)
88

99
# TF-M

subsys/nrf_security/configs/config_extra.cmake.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
set(PSA_CRYPTO_EXTERNAL_CORE ON CACHE BOOL "Enable building PSA core externally")
1010

1111
# This file is populated with paths needed building nrf_security with and without TF-M
12-
# It is added to circumvent issues with install-targets inside TF-M and to unify the
12+
# It is added to circumvent issues with install-targets inside TF-M and to unify the
1313
# CMake code with Zephyr builds
1414
set(NRFXLIB_DIR ${ZEPHYR_NRFXLIB_MODULE_DIR} CACHE STRING "nrfxlib folder")
1515
set(NRF_SECURITY_ROOT ${NRF_DIR}/subsys/nrf_security CACHE STRING "nrf_security root folder")

subsys/nrf_security/configs/nrf-config.h.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*/
77
/* The include guards used here ensures that a different Mbed TLS config is not
8-
* added to the build and used by accident. Hence, this guard is not
8+
* added to the build and used by accident. Hence, this guard is not
99
* equivalent to naming of this file.
1010
*/
1111
#ifndef MBEDTLS_CONFIG_FILE_H

subsys/nrf_security/include/crypto_compat.h

+19-19
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef mbedtls_svc_key_id_t psa_key_handle_t;
4040
*/
4141
static inline int psa_key_handle_is_null(psa_key_handle_t handle)
4242
{
43-
return mbedtls_svc_key_id_is_null(handle);
43+
return mbedtls_svc_key_id_is_null(handle);
4444
}
4545

4646
/** Open a handle to an existing persistent key.
@@ -104,7 +104,7 @@ static inline int psa_key_handle_is_null(psa_key_handle_t handle)
104104
* results in this error code.
105105
*/
106106
psa_status_t psa_open_key(mbedtls_svc_key_id_t key,
107-
psa_key_handle_t *handle);
107+
psa_key_handle_t *handle);
108108

109109
/** Close a key handle.
110110
*
@@ -160,7 +160,7 @@ psa_status_t psa_close_key(psa_key_handle_t handle);
160160
* a future version of the library.
161161
*/
162162
#define PSA_DH_FAMILY_CUSTOM \
163-
((psa_dh_family_t) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(0x7e))
163+
((psa_dh_family_t) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(0x7e))
164164

165165
/**
166166
* \brief Set domain parameters for a key.
@@ -179,15 +179,15 @@ psa_status_t psa_close_key(psa_key_handle_t handle);
179179
* \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription
180180
*/
181181
static inline psa_status_t MBEDTLS_DEPRECATED psa_set_key_domain_parameters(
182-
psa_key_attributes_t *attributes,
183-
psa_key_type_t type, const uint8_t *data, size_t data_length)
182+
psa_key_attributes_t *attributes,
183+
psa_key_type_t type, const uint8_t *data, size_t data_length)
184184
{
185-
(void) data;
186-
if (data_length != 0) {
187-
return PSA_ERROR_NOT_SUPPORTED;
188-
}
189-
psa_set_key_type(attributes, type);
190-
return PSA_SUCCESS;
185+
(void) data;
186+
if (data_length != 0) {
187+
return PSA_ERROR_NOT_SUPPORTED;
188+
}
189+
psa_set_key_type(attributes, type);
190+
return PSA_SUCCESS;
191191
}
192192

193193
/**
@@ -205,21 +205,21 @@ static inline psa_status_t MBEDTLS_DEPRECATED psa_set_key_domain_parameters(
205205
* \retval #PSA_SUCCESS \emptydescription
206206
*/
207207
static inline psa_status_t MBEDTLS_DEPRECATED psa_get_key_domain_parameters(
208-
const psa_key_attributes_t *attributes,
209-
uint8_t *data, size_t data_size, size_t *data_length)
208+
const psa_key_attributes_t *attributes,
209+
uint8_t *data, size_t data_size, size_t *data_length)
210210
{
211-
(void) attributes;
212-
(void) data;
213-
(void) data_size;
214-
*data_length = 0;
215-
return PSA_SUCCESS;
211+
(void) attributes;
212+
(void) data;
213+
(void) data_size;
214+
*data_length = 0;
215+
return PSA_SUCCESS;
216216
}
217217

218218
/** Safe output buffer size for psa_get_key_domain_parameters().
219219
*
220220
*/
221221
#define PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) \
222-
MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(1u)
222+
MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(1u)
223223
#endif /* MBEDTLS_DEPRECATED_REMOVED */
224224

225225
/**@}*/

0 commit comments

Comments
 (0)