Skip to content

Commit

Permalink
nrf_security: drivers: cracen: log SX errors
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tomi-font authored and degjorva committed Feb 24, 2025
1 parent a39caf0 commit 1b98a30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
#include <sxsymcrypt/sha1.h>
#include <sxsymcrypt/sha2.h>
#include <sxsymcrypt/sha3.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/util.h>
#include <psa/nrf_platform_key_ids.h>

LOG_MODULE_DECLARE(cracen, CONFIG_CRACEN_LOG_LEVEL);

#define NOT_ENABLED_CURVE (0)
#define NOT_ENABLED_HASH_ALG (0)

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

psa_status_t silex_statuscodes_to_psa(int ret)
{
if (ret != SX_OK) {
LOG_INF("SX_ERR %d", ret);
}

switch (ret) {
case SX_OK:
case SX_ERR_READY:
Expand Down

0 comments on commit 1b98a30

Please sign in to comment.