Allow multiple return statuses where reasonable
psa_aead_verify always outputs 0 bytes in Mbed TLS, so accept
PSA_SUCCESS as well in the small buffer test.
Allow psa_aead_setup to return PSA_ERROR_NOT_SUPPORTED for incompatible
algorithm / key type pairs in addition to PSA_ERROR_INVALID_ARGUMENT.
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
diff --git a/secure-debug/val/include/val.h b/secure-debug/val/include/val.h
index 4082c5c..4ec7de6 100644
--- a/secure-debug/val/include/val.h
+++ b/secure-debug/val/include/val.h
@@ -138,8 +138,15 @@
{ \
val->print(PRINT_ERROR, "\tFailed at Checkpoint: %d\n", checkpoint); \
val->print(PRINT_ERROR, "\tActual: %d\n", arg1); \
- val->print(PRINT_ERROR, "\tExpected: %d", status1); \
- val->print(PRINT_ERROR, "or %d\n", status2); \
+ if ((status1) != (status2)) \
+ { \
+ val->print(PRINT_ERROR, "\tExpected: %d", status1); \
+ val->print(PRINT_ERROR, "or %d\n", status2); \
+ } \
+ else \
+ { \
+ val->print(PRINT_ERROR, "\tExpected: %d\n", status1); \
+ } \
return 1; \
} \
} while (0)