aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-04-05 14:38:56 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2023-04-06 09:11:13 +0300
commit2ff5d82752e9cc2f6daee64980b646cbd15006fd (patch)
tree7772e1d9fe4be4f6072769388c196d55e2155c2b /test
parent7c1a68785ef477004c0fc679bce98c74020bda52 (diff)
validation: crypto: do not require support for digest in cipher range
Allow crypto operation failure if hash result offset lies within cipher range when testing combined ciphering and authentication. Such hash result location is not supported by all implementations, including odp-dpdk. 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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index 4ed20a57c..93ea6be24 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -864,12 +864,26 @@ static void alg_test_execute(const alg_test_param_t *param)
CU_ASSERT(test_packet_is_md_equal(&md_out, &md_in));
}
+ if (param->cipher_alg != ODP_CIPHER_ALG_NULL &&
+ param->auth_alg != ODP_AUTH_ALG_NULL &&
+ param->digest_offset >= cipher_range.offset &&
+ param->digest_offset < cipher_range.offset + cipher_range.length) {
+ /*
+ * Not all implementations support digest offset in cipher
+ * range, so allow crypto op failure without further checks
+ * in this case.
+ */
+ if (!ok)
+ goto out;
+ }
+
if (param->wrong_digest) {
CU_ASSERT(!ok);
} else {
CU_ASSERT(ok);
}
check_output_packet_data(pkt_out, &expected);
+out:
odp_packet_free(pkt_out);
}