int32_t success,
const char*emsg)
{
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- "Store continuation\n");
-
if (GNUNET_SYSERR == success) {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%s\n", emsg);
{
struct GNUNET_IDENTITY_PROVIDER_Attribute *attr;
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- "Attribute collection finished!\n");
attr_iterator = NULL;
if (list) {
GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
GNUNET_IDENTITY_PROVIDER_AT_STRING,
attr_value,
strlen (attr_value));
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- "Adding attribute\n");
-
idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle,
pkey,
attr,
rd[0].data_size = GNUNET_CRYPTO_cpabe_serialize_master_key (abh->abe_key,
(void**)&rd[0].data);
rd[0].record_type = GNUNET_GNSRECORD_TYPE_ABE_MASTER;
- rd[0].flags = GNUNET_GNSRECORD_RF_NONE | GNUNET_GNSRECORD_RF_PRIVATE;
+ rd[0].flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION | GNUNET_GNSRECORD_RF_PRIVATE;
rd[0].expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; //TODO sane?
abh->ns_qe = GNUNET_NAMESTORE_records_store (ns_handle,
&abh->identity,
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending ATTRIBUTE_STORE_RESPONSE message\n");
env = GNUNET_MQ_msg (acr_msg,
GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_STORE_RESPONSE);
char* buf;
size_t buf_size;
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Storing attribute\n");
buf_size = attribute_serialize_get_size (as_handle->attribute);
buf = GNUNET_malloc (buf_size);
store_after_abe_bootstrap (void *cls,
struct GNUNET_CRYPTO_AbeMasterKey *abe_key)
{
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Finished ABE bootstrap\n");
struct AttributeStoreHandle *ash = cls;
ash->abe_key = abe_key;
struct AttributeStoreHandle *as_handle;
struct IdpClient *idp = cls;
size_t data_len;
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received ATTRIBUTE_STORE message\n");
data_len = ntohs (sam->attr_len);
key,
(void**)&attr_ser);
GNUNET_CRYPTO_cpabe_delete_key (key);
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Found attribute: %s\n", label);
env = GNUNET_MQ_msg_extra (arm,
msg_extra_len,
uint32_t id GNUNET_PACKED;
};
+
+/**
+ * Ticket consume message
+ */
+struct ConsumeTicketMessage
+{
+ /**
+ * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique identifier for this request (for key collisions).
+ */
+ uint32_t id GNUNET_PACKED;
+
+ /**
+ * Identity.
+ */
+ struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
+
+ //Followed by a serialized ticket
+};
+
+
GNUNET_NETWORK_STRUCT_END
#endif
*/
GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus as_cb;
+ /**
+ * Attribute result callback
+ */
+ GNUNET_IDENTITY_PROVIDER_AttributeResult ar_cb;
+
/**
* Ticket result callback
*/
return op;
}
+/**
+ * Consumes an issued ticket. The ticket is persisted
+ * and used to retrieve identity information from the issuer
+ *
+ * @param id the identity provider to use
+ * @param identity the identity that is the subject of the issued ticket (the relying party)
+ * @param ticket the issued ticket to consume
+ * @param cb the callback to call
+ * @param cb_cls the callback closure
+ * @return handle to abort the operation
+ */
+struct GNUNET_IDENTITY_PROVIDER_Operation *
+GNUNET_IDENTITY_PROVIDER_rp_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey * identity,
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
+ GNUNET_IDENTITY_PROVIDER_AttributeResult cb,
+ void *cb_cls)
+{
+ struct GNUNET_IDENTITY_PROVIDER_Operation *op;
+ struct ConsumeTicketMessage *ctm;
+
+ op = GNUNET_new (struct GNUNET_IDENTITY_PROVIDER_Operation);
+ op->h = h;
+ op->ar_cb = cb;
+ op->cls = cb_cls;
+ op->r_id = h->r_id_gen++;
+ GNUNET_CONTAINER_DLL_insert_tail (h->op_head,
+ h->op_tail,
+ op);
+ op->env = GNUNET_MQ_msg_extra (ctm,
+ sizeof (const struct GNUNET_IDENTITY_PROVIDER_Ticket2),
+ GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE);
+ ctm->identity = *identity;
+ ctm->id = htonl (op->r_id);
+
+ GNUNET_memcpy ((char*)&ctm[1],
+ ticket,
+ sizeof (const struct GNUNET_IDENTITY_PROVIDER_Ticket2));
+
+ if (NULL != h->mq)
+ GNUNET_MQ_send_copy (h->mq,
+ op->env);
+ return op;
+
+}
+
} name_map[] = {
{ "ID_ATTR", GNUNET_GNSRECORD_TYPE_ID_ATTR },
{ "ID_TOKEN", GNUNET_GNSRECORD_TYPE_ID_TOKEN },
+ { "ABE_KEY", GNUNET_GNSRECORD_TYPE_ABE_KEY },
+ { "ABE_MASTER", GNUNET_GNSRECORD_TYPE_ABE_MASTER },
{ "ID_TOKEN_METADATA", GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA },
{ NULL, UINT32_MAX }
};
* @return the exported block API
*/
void *
-libgnunet_plugin_gnsrecord_identity_init (void *cls)
+libgnunet_plugin_gnsrecord_identity_provider_init (void *cls)
{
struct GNUNET_GNSRECORD_PluginFunctions *api;
* @return NULL
*/
void *
-libgnunet_plugin_gnsrecord_identity_done (void *cls)
+libgnunet_plugin_gnsrecord_identity_provider_done (void *cls)
{
struct GNUNET_GNSRECORD_PluginFunctions *api = cls;
struct GNUNET_IDENTITY_PROVIDER_Operation *
GNUNET_IDENTITY_PROVIDER_rp_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *id,
const struct GNUNET_CRYPTO_EcdsaPrivateKey * identity,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
GNUNET_IDENTITY_PROVIDER_AttributeResult cb,
void *cb_cls);