1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Fix issues with get_{sign/verify}_num_ops

Move to accumulate ops in context rather than attempting to read straight out
of structures due to structure ops getting reset per operation, and also
issues with _abort clearing internal data. Fix usage of size_t in structures

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott
2022-12-15 17:00:30 +00:00
parent 588f8ed498
commit 296ede99c9
3 changed files with 25 additions and 4 deletions

View File

@ -448,6 +448,10 @@ uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
{
switch( operation->id )
{
/* If uninitialised, return 0, as no work can have been done. */
case 0:
return 0;
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
return( mbedtls_psa_sign_hash_get_num_ops(
&operation->ctx.mbedtls_ctx )
@ -469,6 +473,10 @@ uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
{
switch( operation->id )
{
/* If uninitialised, return 0, as no work can have been done. */
case 0:
return 0;
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
return( mbedtls_psa_verify_hash_get_num_ops(
&operation->ctx.mbedtls_ctx )