Skip to content

Commit

Permalink
crypto: Move nrf_oberon base library out of BUILD_WITH_TFM filter
Browse files Browse the repository at this point in the history
-This allows direct calls to nrf_oberon library regardless if
 TF-M is set for the implementations that don't have a PSA crypto API
 to call (for ocrypto_ prefixed calls)
Note: This addition is done to allow deprecating more legacy features
by always allowing NRF_SECURITY being enabled by default. Previously
the NORDIC_SECURITY_BACKEND and legacy Mbed TLS APIs was allowing
for direct access to nrf_oberon and its proprietary APIs.

ref: NCSDK-29217

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
  • Loading branch information
frkv committed Oct 22, 2024
1 parent e9dfe1f commit 38a130f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ if(CONFIG_NRF_OBERON OR CONFIG_BUILD_WITH_TFM OR CONFIG_OBERON_BACKEND OR CONFIG
"(${OBERON_LIB} or ${OBERON_MBEDTLS_LIB} doesn't exist.)")
endif()

#
# Add mbedcrypto_oberon_imported - Contains proprietary nrf_oberon APIs
#
add_library(mbedcrypto_oberon_imported STATIC IMPORTED GLOBAL)
set_target_properties(mbedcrypto_oberon_imported PROPERTIES
IMPORTED_LOCATION
"${OBERON_LIB}"
)
target_include_directories(mbedcrypto_oberon_imported
INTERFACE
"${OBERON_BASE}/include"
)


if (NOT CONFIG_BUILD_WITH_TFM AND NOT CONFIG_OBERON_BACKEND AND NOT CONFIG_PSA_CRYPTO_DRIVER_OBERON)
target_include_directories(nrfxlib_crypto INTERFACE ${OBERON_BASE}/include)
target_link_libraries(nrfxlib_crypto INTERFACE ${OBERON_LIB})
Expand All @@ -40,19 +54,6 @@ if(CONFIG_NRF_OBERON OR CONFIG_BUILD_WITH_TFM OR CONFIG_OBERON_BACKEND OR CONFIG
"(${OBERON_MBEDTLS_LIB} doesn't exist.)")
endif()

#
# Add mbedcrypto_oberon_imported - Contains proprietary nrf_oberon APIs
#
add_library(mbedcrypto_oberon_imported STATIC IMPORTED GLOBAL)
set_target_properties(mbedcrypto_oberon_imported PROPERTIES
IMPORTED_LOCATION
"${OBERON_LIB}"
)
target_include_directories(mbedcrypto_oberon_imported
INTERFACE
"${OBERON_BASE}/include"
)

#
# Add mbedcrypto_oberon_mbedtls_imported - contains legacy crypto APIs
#
Expand Down

0 comments on commit 38a130f

Please sign in to comment.