Skip to content

Commit b3d5150

Browse files
karstenkoenignordicjm
authored andcommitted
sdfw_services: psa_crypto: Skip psa init
We can skip remote psa init, so remove the call but leave the handler intact to not break the interface. Also add new functions returning not supported. Signed-off-by: Karsten Koenig <[email protected]>
1 parent b62a0ed commit b3d5150

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

subsys/nrf_security/src/ssf_secdom/ssf_crypto.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
psa_status_t psa_crypto_init(void)
1010
{
11-
return ssf_psa_crypto_init();
11+
return PSA_SUCCESS;
1212
}
1313

1414
psa_status_t psa_get_key_attributes(mbedtls_svc_key_id_t key, psa_key_attributes_t *attributes)
@@ -400,6 +400,18 @@ psa_status_t psa_key_derivation_output_key(const psa_key_attributes_t *attribute
400400
return ssf_psa_key_derivation_output_key(attributes, &operation->handle, key);
401401
}
402402

403+
psa_status_t psa_key_derivation_verify_bytes(psa_key_derivation_operation_t *operation,
404+
const uint8_t *expected_output, size_t output_length)
405+
{
406+
return PSA_ERROR_NOT_SUPPORTED;
407+
}
408+
409+
psa_status_t psa_key_derivation_verify_key(psa_key_derivation_operation_t *operation,
410+
mbedtls_svc_key_id_t expected)
411+
{
412+
return PSA_ERROR_NOT_SUPPORTED;
413+
}
414+
403415
psa_status_t psa_key_derivation_abort(psa_key_derivation_operation_t *operation)
404416
{
405417
return ssf_psa_key_derivation_abort(&operation->handle);
@@ -430,6 +442,13 @@ psa_status_t psa_sign_hash_start(psa_sign_hash_interruptible_operation_t *operat
430442
return PSA_ERROR_NOT_SUPPORTED;
431443
}
432444

445+
psa_status_t psa_sign_hash_complete(psa_sign_hash_interruptible_operation_t *operation,
446+
uint8_t *signature, size_t signature_size,
447+
size_t *signature_length)
448+
{
449+
return PSA_ERROR_NOT_SUPPORTED;
450+
}
451+
433452
psa_status_t psa_sign_hash_abort(psa_sign_hash_interruptible_operation_t *operation)
434453
{
435454
return PSA_ERROR_NOT_SUPPORTED;
@@ -443,6 +462,11 @@ psa_status_t psa_verify_hash_start(psa_verify_hash_interruptible_operation_t *op
443462
return PSA_ERROR_NOT_SUPPORTED;
444463
}
445464

465+
psa_status_t psa_verify_hash_complete(psa_verify_hash_interruptible_operation_t *operation)
466+
{
467+
return PSA_ERROR_NOT_SUPPORTED;
468+
}
469+
446470
psa_status_t psa_verify_hash_abort(psa_verify_hash_interruptible_operation_t *operation)
447471
{
448472
return PSA_ERROR_NOT_SUPPORTED;

subsys/sdfw_services/services/psa_crypto/psa_crypto_service.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ SSF_CLIENT_SERVICE_DEFINE(psa_crypto_srvc, PSA_CRYPTO, cbor_encode_psa_crypto_re
1818

1919
psa_status_t ssf_psa_crypto_init(void)
2020
{
21-
return PSA_SUCCESS;
21+
int err;
22+
struct psa_crypto_req req = { 0 };
23+
struct psa_crypto_rsp rsp = { 0 };
24+
25+
req.psa_crypto_req_msg_choice = psa_crypto_req_msg_psa_crypto_init_req_m_c;
26+
27+
err = ssf_client_send_request(&psa_crypto_srvc, &req, &rsp, NULL);
28+
if (err != 0) {
29+
return err;
30+
}
31+
32+
return rsp.psa_crypto_rsp_status;
2233
}
2334

2435
psa_status_t ssf_psa_get_key_attributes(

0 commit comments

Comments
 (0)