diff mbox

[PATCHv2,2/2] linux-generic: crypto: fix crypto operation return code for invalid IV

Message ID 1424775782-15453-3-git-send-email-taras.kondratiuk@linaro.org
State Accepted
Commit f0ff8d832ddd6c90d37cc9d5d9424cfe7c38ef0a
Headers show

Commit Message

Taras Kondratiuk Feb. 24, 2015, 11:03 a.m. UTC
Current code returns an incompatible enum value as an error code in
case of not specified IV. Use a proper return code instead.

Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index bc0f961..9635453 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -161,7 +161,7 @@  enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params,
 	else if (session->cipher.iv.data)
 		iv_ptr = session->cipher.iv.data;
 	else
-		return ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER;
+		return ODP_CRYPTO_ALG_ERR_IV_INVALID;
 
 	/*
 	 * Create a copy of the IV.  The DES library modifies IV
@@ -199,7 +199,7 @@  enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params,
 	else if (session->cipher.iv.data)
 		iv_ptr = session->cipher.iv.data;
 	else
-		return ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER;
+		return ODP_CRYPTO_ALG_ERR_IV_INVALID;
 
 	/*
 	 * Create a copy of the IV.  The DES library modifies IV