Skip to content

Commit d31c7fb

Browse files
maxd-nordicnordicjm
authored andcommitted
lib: nrf_cloud: integrate app_jwt library
Replace internal JWT implementation with the app_jwt library. Requires the usage of prime256v1 keys. Signed-off-by: Maximilian Deubel <[email protected]>
1 parent 482d41b commit d31c7fb

File tree

5 files changed

+54
-331
lines changed

5 files changed

+54
-331
lines changed

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,11 @@ Libraries for networking
964964
* :ref:`lib_nrf_cloud` library:
965965

966966
* Added the :kconfig:option:`CONFIG_NRF_CLOUD` Kconfig option to prevent unintended inclusion of nRF Cloud Kconfig variables in non-nRF Cloud projects.
967-
* Updated to use the :ref:`lib_downloader` library for CoAP downloads.
967+
968+
* Updated:
969+
970+
* To use the :ref:`lib_downloader` library for CoAP downloads.
971+
* To use the :ref:`lib_app_jwt` library to generate JWT tokens.
968972

969973
Libraries for NFC
970974
-----------------

lib/app_jwt/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ zephyr_library()
99
zephyr_library_sources(
1010
app_jwt.c
1111
)
12+
13+
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)

lib/app_jwt/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
menuconfig APP_JWT
88
bool "Application JWT Library"
9-
depends on SSF_CLIENT && SSF_PSA_CRYPTO_SERVICE_ENABLED && SSF_DEVICE_INFO_SERVICE_ENABLED
109
select BASE64
1110
# Needed for time and date
1211
select DATE_TIME
@@ -15,6 +14,10 @@ menuconfig APP_JWT
1514
# Needed to print integer values in JSON
1615
select CJSON_LIB
1716
select CBPRINTF_FP_SUPPORT
17+
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
18+
select PSA_WANT_ALG_ECDSA
19+
select PSA_WANT_ECC_SECP_R1_256
20+
select PSA_WANT_ALG_SHA_256
1821

1922
if APP_JWT
2023

subsys/net/lib/nrf_cloud/Kconfig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,7 @@ config NRF_CLOUD_JWT_SOURCE_CUSTOM
103103
select EXPERIMENTAL
104104
select TLS_CREDENTIALS
105105
select BASE64
106-
select TINYCRYPT
107-
select TINYCRYPT_SHA256
108-
select TINYCRYPT_ECC_DSA
109-
select TINYCRYPT_CTR_PRNG
110-
select TINYCRYPT_AES
111-
select CJSON_LIB
112-
depends on NEWLIB_LIBC_FLOAT_PRINTF || PICOLIBC_IO_FLOAT
113-
depends on DATE_TIME
106+
select APP_JWT
114107
help
115108
JWTs are created and signed by the nRF Cloud library, not the modem.
116109
The signing key is obtained from the TLS credentials module.

0 commit comments

Comments
 (0)