src/dpdk/drivers/crypto/caam_jr/caam_jr.c
static void
caam_jr_sym_session_clear(struct rte_cryptodev *dev,
		struct rte_cryptodev_sym_session *sess)
{
	uint8_t index = dev->driver_id;
	void *sess_priv = get_sym_session_private_data(sess, index);
	struct caam_jr_session *s = (struct caam_jr_session *)sess_priv;

	PMD_INIT_FUNC_TRACE();

	if (sess_priv) {
		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);

		rte_free(s->cipher_key.data);
		rte_free(s->auth_key.data);
		memset(s, 0, sizeof(struct caam_jr_session));
		set_sym_session_private_data(sess, index, NULL);
		rte_mempool_put(sess_mp, sess_priv);
	}
}
/* Clear the memory of session so it doesn't leave key material behind */
Clear the memory of session so it doesn't leave key material behind
Clear the memory of session so it doesn ' t leave key material behind
static void
caam_jr_sym_session_clear(struct rte_cryptodev *dev,
		struct rte_cryptodev_sym_session *sess)
{
	uint8_t index = dev->driver_id;
	void *sess_priv = get_sym_session_private_data(sess, index);
	struct caam_jr_session *s = (struct caam_jr_session *)sess_priv;
	PMD_INIT_FUNC_TRACE();
	if (sess_priv) {
		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
		rte_free(s->cipher_key.data);
		rte_free(s->auth_key.data);
		memset(s, 0, sizeof(struct caam_jr_session));
		set_sym_session_private_data(sess, index, NULL);
		rte_mempool_put(sess_mp, sess_priv);
	}
}
static void caam_jr_sym_session_clear ( struct rte_cryptodev * dev , struct rte_cryptodev_sym_session * sess ) { uint8_t index = dev -> driver_id ; void * sess_priv = get_sym_session_private_data ( sess , index ) ; struct caam_jr_session * s = ( struct caam_jr_session * ) sess_priv ; PMD_INIT_FUNC_TRACE ( ) ; if ( sess_priv ) { struct rte_mempool * sess_mp = rte_mempool_from_obj ( sess_priv ) ; rte_free ( s -> cipher_key . data ) ; rte_free ( s -> auth_key . data ) ; memset ( s , 0 , sizeof ( struct caam_jr_session ) ) ; set_sym_session_private_data ( sess , index , NULL ) ; rte_mempool_put ( sess_mp , sess_priv ) ; } }
Clear the memory of session so it doesn't leave key material behind
Clear the memory of session so it doesn ' t leave key material behind