make sure the EVP_CIPHER memory is freed from the aes_gcm ctx
before memset the crypto session to zero.

Signed-off-by: balakrishna.garapati <balakrishna.garap...@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 08b479d..07df747 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -704,6 +704,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
        odp_crypto_generic_session_t *generic;

        generic = (odp_crypto_generic_session_t *)(intptr_t)session;
+        if(generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
+               EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
        memset(generic, 0, sizeof(*generic));
        free_session(generic);
        return 0;
--
1.9.1

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to