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:
parent
86f9795b00
commit
760538885a
1 changed files with 5 additions and 1 deletions
|
@ -84,7 +84,11 @@ int main(void)
|
||||||
/* Compute hash using multi-part operation */
|
/* Compute hash using multi-part operation */
|
||||||
|
|
||||||
status = psa_hash_setup(&hash_operation, HASH_ALG);
|
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");
|
mbedtls_printf("psa_hash_setup failed\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue