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>
diff --git a/programs/psa/psa_hash.c b/programs/psa/psa_hash.c
index b3f3597..fc39849 100644
--- a/programs/psa/psa_hash.c
+++ b/programs/psa/psa_hash.c
@@ -84,7 +84,11 @@
/* 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;
}