proxy_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self,
                         CK_SESSION_HANDLE handle,
                         CK_MECHANISM_PTR mechanism,
                         CK_ATTRIBUTE_PTR pub_template,
                         CK_ULONG pub_count,
                         CK_ATTRIBUTE_PTR priv_template,
                         CK_ULONG priv_count,
                         CK_OBJECT_HANDLE_PTR pub_key,
                         CK_OBJECT_HANDLE_PTR priv_key)
{
	State *state = (State *)self;
	Mapping map;
	CK_RV rv;

	rv = map_session_to_real (state->px, &handle, &map, NULL);
	if (rv != CKR_OK)
		return rv;
	return (map.funcs->C_GenerateKeyPair) (handle, mechanism, pub_template, pub_count, priv_template, priv_count, pub_key, priv_key);
}
proxy_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self,
                         CK_SESSION_HANDLE handle,
                         CK_MECHANISM_PTR mechanism,
                         CK_ATTRIBUTE_PTR pub_template,
                         CK_ULONG pub_count,
                         CK_ATTRIBUTE_PTR priv_template,
                         CK_ULONG priv_count,
                         CK_OBJECT_HANDLE_PTR pub_key,
                         CK_OBJECT_HANDLE_PTR priv_key)
{
	State *state = (State *)self;
	Mapping map;
	CK_RV rv;

	rv = map_session_to_real (state->px, &handle, &map, NULL);
	if (rv != CKR_OK)
		return rv;
	return (map.funcs->C_GenerateKeyPair) (handle, mechanism, pub_template, pub_count, priv_template, priv_count, pub_key, priv_key);
}