static void deinit_keys(gnutls_session_t session)
{
	const version_entry_st *vers = get_version(session);

	if (vers == NULL)
		return;

	gnutls_pk_params_release(&session->key.kshare.ecdhx_params);
	gnutls_pk_params_release(&session->key.kshare.ecdh_params);
	gnutls_pk_params_release(&session->key.kshare.dh_params);

	if (!vers->tls13_sem && session->key.binders[0].prf == NULL) {
		gnutls_pk_params_release(&session->key.proto.tls12.ecdh.params);
		gnutls_pk_params_release(&session->key.proto.tls12.dh.params);
		zrelease_temp_mpi_key(&session->key.proto.tls12.ecdh.x);
		zrelease_temp_mpi_key(&session->key.proto.tls12.ecdh.y);
		_gnutls_free_temp_key_datum(&session->key.proto.tls12.ecdh.raw);

		zrelease_temp_mpi_key(&session->key.proto.tls12.dh.client_Y);

		/* SRP */
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_p);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_g);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_key);

		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.u);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.a);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.x);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.A);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.B);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.b);
	} else {
		gnutls_memset(session->key.proto.tls13.temp_secret, 0,
			      sizeof(session->key.proto.tls13.temp_secret));
	}

	reset_binders(session);
	_gnutls_free_temp_key_datum(&session->key.key);
}
static void deinit_keys(gnutls_session_t session)
{
	const version_entry_st *vers = get_version(session);

	if (vers == NULL)
		return;

	gnutls_pk_params_release(&session->key.kshare.ecdhx_params);
	gnutls_pk_params_release(&session->key.kshare.ecdh_params);
	gnutls_pk_params_release(&session->key.kshare.dh_params);

	if (!vers->tls13_sem && session->key.binders[0].prf == NULL) {
		gnutls_pk_params_release(&session->key.proto.tls12.ecdh.params);
		gnutls_pk_params_release(&session->key.proto.tls12.dh.params);
		zrelease_temp_mpi_key(&session->key.proto.tls12.ecdh.x);
		zrelease_temp_mpi_key(&session->key.proto.tls12.ecdh.y);
		_gnutls_free_temp_key_datum(&session->key.proto.tls12.ecdh.raw);

		zrelease_temp_mpi_key(&session->key.proto.tls12.dh.client_Y);

		 
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_p);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_g);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.srp_key);

		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.u);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.a);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.x);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.A);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.B);
		zrelease_temp_mpi_key(&session->key.proto.tls12.srp.b);
	} else {
		gnutls_memset(session->key.proto.tls13.temp_secret, 0,
			      sizeof(session->key.proto.tls13.temp_secret));
	}

	reset_binders(session);
	_gnutls_free_temp_key_datum(&session->key.key);
}