Skip to content

Commit 59dbc78

Browse files
tomi-fontendre-nordic
authored andcommitted
nrf_security: drivers: cracen: log SX errors
Make silex_statuscodes_to_psa() log the SX error it translates to psa_status_t. This helps being aware of and debugging erros happening in the Silex drivers. Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent d085464 commit 59dbc78

File tree

1 file changed

+7
-0
lines changed
  • subsys/nrf_security/src/drivers/cracen/cracenpsa/src

1 file changed

+7
-0
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
#include <sxsymcrypt/sha1.h>
2626
#include <sxsymcrypt/sha2.h>
2727
#include <sxsymcrypt/sha3.h>
28+
#include <zephyr/logging/log.h>
2829
#include <zephyr/sys/util.h>
2930
#include <psa/nrf_platform_key_ids.h>
3031

32+
LOG_MODULE_DECLARE(cracen, CONFIG_CRACEN_LOG_LEVEL);
33+
3134
#define NOT_ENABLED_CURVE (0)
3235
#define NOT_ENABLED_HASH_ALG (0)
3336

@@ -42,6 +45,10 @@ static const uint8_t RSA_ALGORITHM_IDENTIFIER[] = {0x06, 0x09, 0x2a, 0x86, 0x48,
4245

4346
psa_status_t silex_statuscodes_to_psa(int ret)
4447
{
48+
if (ret != SX_OK) {
49+
LOG_DBG("SX_ERR %d", ret);
50+
}
51+
4552
switch (ret) {
4653
case SX_OK:
4754
case SX_ERR_READY:

0 commit comments

Comments
 (0)