static void
send_ticket_result (struct IdpClient *client,
uint32_t r_id,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
- const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket)
{
struct TicketResultMessage *irm;
struct GNUNET_MQ_Envelope *env;
/* store ticket in DB */
if (GNUNET_OK != TKT_database->store_ticket (TKT_database->cls,
- ticket,
- attrs))
+ ticket))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unable to store ticket after issue\n");
}
send_ticket_result (handle->client,
handle->r_id,
- &handle->ticket,
- handle->attrs);
+ &handle->ticket);
cleanup_ticket_issue_handle (handle);
}
/* Store ticket in DB */
if (GNUNET_OK != TKT_database->store_ticket (TKT_database->cls,
- &handle->ticket,
- handle->attrs))
+ &handle->ticket))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unable to store ticket after consume\n");
*/
static void
ticket_iterate_proc (void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
- const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket)
{
struct TicketIterationProcResult *proc = cls;
proc->res_iteration_finished = IT_SUCCESS_NOT_MORE_RESULTS_AVAILABLE;
return;
}
- if ((NULL == ticket) || (NULL == attrs))
- {
- /* error */
- proc->res_iteration_finished = IT_START;
- GNUNET_break (0);
- return;
- }
proc->res_iteration_finished = IT_SUCCESS_MORE_AVAILABLE;
send_ticket_result (proc->ti->client,
proc->ti->r_id,
- ticket,
- attrs);
+ ticket);
}
#include "platform.h"
#include "gnunet_identity_provider_service.h"
#include "gnunet_identity_provider_plugin.h"
-#include "identity_attribute.h"
#include "gnunet_sq_lib.h"
#include <sqlite3.h>
"CREATE TABLE identity001tickets ("
" identity BLOB NOT NULL DEFAULT '',"
" audience BLOB NOT NULL DEFAULT '',"
- " rnd INT8 NOT NULL DEFAULT '',"
- " attributes BLOB NOT NULL DEFAULT ''"
+ " rnd INT8 NOT NULL DEFAULT ''"
")",
NULL, NULL, NULL) != SQLITE_OK))
{
if ( (SQLITE_OK !=
sq_prepare (plugin->dbh,
- "INSERT INTO identity001tickets (identity, audience, rnd, attributes)"
- " VALUES (?, ?, ?, ?)",
+ "INSERT INTO identity001tickets (identity, audience, rnd)"
+ " VALUES (?, ?, ?)",
&plugin->store_ticket)) ||
(SQLITE_OK !=
sq_prepare (plugin->dbh,
&plugin->delete_ticket)) ||
(SQLITE_OK !=
sq_prepare (plugin->dbh,
- "SELECT identity,audience,rnd,attributes"
+ "SELECT identity,audience,rnd"
" FROM identity001tickets WHERE identity=?"
" ORDER BY rnd LIMIT 1 OFFSET ?",
&plugin->iterate_tickets)) ||
(SQLITE_OK !=
sq_prepare (plugin->dbh,
- "SELECT identity,audience,rnd,attributes"
+ "SELECT identity,audience,rnd"
" FROM identity001tickets WHERE audience=?"
" ORDER BY rnd LIMIT 1 OFFSET ?",
&plugin->iterate_tickets_by_audience)) )
*
* @param cls closure (internal context for the plugin)
* @param ticket the ticket to persist
- * @param attrs attributes to persist
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
identity_provider_sqlite_store_ticket (void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
- const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs)
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket)
{
struct Plugin *plugin = cls;
int n;
- size_t attrs_size;
- char *attrs_serialized;
-
- attrs_size = attribute_list_serialize_get_size (attrs);
-
- attrs_serialized = GNUNET_malloc (attrs_size);
-
- attribute_list_serialize (attrs,
- attrs_serialized);
{
/* First delete duplicates */
GNUNET_SQ_query_param_auto_from_type (&ticket->identity),
GNUNET_SQ_query_param_auto_from_type (&ticket->audience),
GNUNET_SQ_query_param_uint64 (&ticket->rnd),
- GNUNET_SQ_query_param_fixed_size (attrs_serialized, attrs_size),
GNUNET_SQ_query_param_end
};
void *iter_cls)
{
struct GNUNET_IDENTITY_PROVIDER_Ticket2 ticket;
- size_t attrs_size;
- void *attrs_serialized;
int ret;
int sret;
GNUNET_SQ_result_spec_auto_from_type (&ticket.identity),
GNUNET_SQ_result_spec_auto_from_type (&ticket.audience),
GNUNET_SQ_result_spec_uint64 (&ticket.rnd),
- GNUNET_SQ_result_spec_variable_size (&attrs_serialized, &attrs_size),
GNUNET_SQ_result_spec_end
};
}
else
{
- struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs;
-
- attrs = attribute_list_deserialize (attrs_serialized, attrs_size);
-
- if (NULL == attrs)
- {
- GNUNET_break (0);
- ret = GNUNET_SYSERR;
- }
- else
- {
if (NULL != iter)
iter (iter_cls,
- &ticket,
- attrs);
+ &ticket);
ret = GNUNET_YES;
- }
}
GNUNET_SQ_cleanup_result (rs);
}
*
* @param cls closure
* @param ticket the ticket
- * @prarm attrs the attributes
*/
typedef void (*GNUNET_IDENTITY_PROVIDER_TicketIterator) (void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
- const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket);
/**
*
* @param cls closure (internal context for the plugin)
* @param ticket the ticket to store
- * @param attrs the attributes shared with the ticket
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
int (*store_ticket) (void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
- const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket);
/**
* Delete a ticket from the database.