Skip to content

Commit cd2f6ad

Browse files
AntonZmarlubos
authored andcommitted
nrf_security: CRACEN: Fix hardfault when using sxsymcrypt API
Using the following sequence of calls led to the hardfault: sx_mac_create_hmac_sha2_256(ctx, key) sx_mac_feed(ctx, 'chunk 1') sx_mac_feed(ctx, 'chunk 2') sx_mac_generate(ctx) sx_mac_wait(ctx) Reason: attempt to dereference a pointer that has not been set. Ref: NCSDK-36712 Signed-off-by: Anton Zyma <[email protected]>
1 parent 6a7b8f9 commit cd2f6ad

File tree

1 file changed

+2
-0
lines changed
  • subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src

1 file changed

+2
-0
lines changed

subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hmac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static int sx_hash_create_hmac_ba413(struct sxmac *mac_ctx, const struct sxhasha
5858
return SX_ERR_INCOMPATIBLE_HW;
5959
}
6060

61+
mac_ctx->key = keyref;
6162
sx_hw_reserve(&mac_ctx->dma);
6263

6364
mac_ctx->cfg = &ba413cfg;
@@ -119,6 +120,7 @@ static int sx_hash_create_hmac_ba418(struct sxmac *mac_ctx, const struct sxhasha
119120
return SX_ERR_INVALID_KEYREF;
120121
}
121122

123+
mac_ctx->key = keyref;
122124
sx_hw_reserve(&mac_ctx->dma);
123125

124126
mac_ctx->cfg = &ba418cfg;

0 commit comments

Comments
 (0)