diff options
author | Aakash Sasidharan <asasidharan@marvell.com> | 2022-05-09 14:10:40 +0530 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-05-23 15:39:42 +0300 |
commit | 4bda1edb1bb667f3ba6923282d6ad127b43e39a0 (patch) | |
tree | 8b49e7d38b4851b55df6c4316a311425d942b34d /test | |
parent | e59bf3a1ee8413d20c5674776c326ad5d496c416 (diff) |
validation: crypto: fix check for session create error
Crypto session create API returns a negative value on failure.
To check for the error code for failure, status parameter need to
be explicitly checked not the return value of the API.
Fixes: c14955e1d60e ("validation: crypto: do not test unsupported algorithm combos")
Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/validation/api/crypto/odp_crypto_test_inp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index e3eff88b9..6b27280cf 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -689,7 +689,8 @@ static odp_crypto_session_t session_create(odp_crypto_op_t op, * In some cases an individual algorithm cannot be used alone, * i.e. with the null cipher/auth algorithm. */ - if (rc == ODP_CRYPTO_SES_ERR_ALG_COMBO) { + 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)); |