aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-04-05 14:38:59 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2023-04-06 09:11:13 +0300
commit291d293463dac12cf63396846171a7867c66466f (patch)
tree4a65ea591ae4424491f31b9d15f19a08dbd149b9 /test
parentb62057cd37b475d199fc2f55f29ad9dff2f8cb94 (diff)
validation: crypto: reduce the number of unsupported combo warnings
Print a warning about an unsupported combination of algorithms only once per algorithm combination. Do not, for now, change the code to not attempt the same combination again. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'test')
-rw-r--r--test/validation/api/crypto/odp_crypto_test_inp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index 787f75d21..3c1b725c2 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -968,6 +968,7 @@ static void alg_test_op(alg_test_param_t *param)
}
}
+static int combo_warning_shown;
static int oop_warning_shown;
typedef enum {
@@ -1029,9 +1030,12 @@ static odp_crypto_session_t session_create(odp_crypto_op_t op,
rc = odp_crypto_session_create(&ses_params, &session, &status);
if (rc < 0 && status == ODP_CRYPTO_SES_ERR_ALG_COMBO) {
- printf("\n Unsupported algorithm combination: %s, %s\n",
- cipher_alg_name(cipher_alg),
- auth_alg_name(auth_alg));
+ if (!combo_warning_shown) {
+ combo_warning_shown = 1;
+ printf("\n Unsupported algorithm combination: %s, %s\n",
+ cipher_alg_name(cipher_alg),
+ auth_alg_name(auth_alg));
+ }
return ODP_CRYPTO_SESSION_INVALID;
}
@@ -2302,6 +2306,8 @@ static void test_combo_variants(odp_cipher_alg_t cipher, odp_auth_alg_t auth)
num = odp_crypto_auth_capability(auth, auth_capa, num_auths);
CU_ASSERT(num == num_auths);
+ combo_warning_shown = 0;
+
for (int n = 0; n < num_ciphers; n++)
for (int i = 0; i < num_auths; i++) {
crypto_suite_t suite = {.cipher = cipher,