mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-10 06:40:16 +00:00
Enable algorithms other than hash-then-sign
For psa_hash/verify_message other algorithms than hash-then-sign is enabled like PureEdDSA. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
46c23a051c
commit
0f62240942
@ -2504,9 +2504,6 @@ static psa_status_t psa_sign_internal( mbedtls_svc_key_id_t key,
|
|||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Curently only hash-then-sign algorithms are supported. */
|
|
||||||
else
|
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Immediately reject a zero-length signature buffer. This guarantees
|
/* Immediately reject a zero-length signature buffer. This guarantees
|
||||||
@ -2597,9 +2594,6 @@ static psa_status_t psa_verify_internal( mbedtls_svc_key_id_t key,
|
|||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Curently only hash-then-sign algorithms are supported. */
|
|
||||||
else
|
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_get_and_lock_key_slot_with_policy(
|
status = psa_get_and_lock_key_slot_with_policy(
|
||||||
@ -2651,13 +2645,16 @@ psa_status_t psa_sign_message_internal(
|
|||||||
size_t hash_length;
|
size_t hash_length;
|
||||||
uint8_t hash[PSA_HASH_MAX_SIZE];
|
uint8_t hash[PSA_HASH_MAX_SIZE];
|
||||||
|
|
||||||
status = psa_driver_wrapper_hash_compute( PSA_ALG_SIGN_GET_HASH( alg ),
|
if ( PSA_ALG_IS_HASH_AND_SIGN( alg ) )
|
||||||
input, input_length,
|
{
|
||||||
hash, sizeof( hash ),
|
status = psa_driver_wrapper_hash_compute(
|
||||||
&hash_length );
|
PSA_ALG_SIGN_GET_HASH( alg ),
|
||||||
|
input, input_length,
|
||||||
|
hash, sizeof( hash ), &hash_length );
|
||||||
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
return psa_sign_hash_internal(
|
return psa_sign_hash_internal(
|
||||||
attributes, key_buffer, key_buffer_size,
|
attributes, key_buffer, key_buffer_size,
|
||||||
@ -2692,13 +2689,16 @@ psa_status_t psa_verify_message_internal(
|
|||||||
size_t hash_length;
|
size_t hash_length;
|
||||||
uint8_t hash[PSA_HASH_MAX_SIZE];
|
uint8_t hash[PSA_HASH_MAX_SIZE];
|
||||||
|
|
||||||
status = psa_driver_wrapper_hash_compute( PSA_ALG_SIGN_GET_HASH( alg ),
|
if ( PSA_ALG_IS_HASH_AND_SIGN( alg ) )
|
||||||
input, input_length,
|
{
|
||||||
hash, sizeof( hash ),
|
status = psa_driver_wrapper_hash_compute(
|
||||||
&hash_length );
|
PSA_ALG_SIGN_GET_HASH( alg ),
|
||||||
|
input, input_length,
|
||||||
|
hash, sizeof( hash ), &hash_length );
|
||||||
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
return psa_verify_hash_internal(
|
return psa_verify_hash_internal(
|
||||||
attributes, key_buffer, key_buffer_size,
|
attributes, key_buffer, key_buffer_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user