mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Inform user when unknown hash algorithm supplied
Excplictly inform the user that their hash algorithm selection is invalid. Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
@@ -84,7 +84,11 @@ int main(void)
|
||||
/* Compute hash using multi-part operation */
|
||||
|
||||
status = psa_hash_setup(&hash_operation, HASH_ALG);
|
||||
if (status != PSA_SUCCESS) {
|
||||
if (status == PSA_ERROR_NOT_SUPPORTED){
|
||||
mbedtls_printf("unknown hash algorithm supplied\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
else if (status != PSA_SUCCESS) {
|
||||
mbedtls_printf("psa_hash_setup failed\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user