GNUnet  0.17.6
Data Structures | Macros | Functions | Variables
plugin_rest_identity.c File Reference

GNUnet Identity REST plugin. More...

#include "platform.h"
#include "gnunet_rest_plugin.h"
#include "gnunet_identity_service.h"
#include "gnunet_rest_lib.h"
#include "identity.h"
#include "gnunet_crypto_lib.h"
#include "microhttpd.h"
#include <jansson.h>
Include dependency graph for plugin_rest_identity.c:

Go to the source code of this file.

Data Structures

struct  Plugin
 Handle for a plugin. More...
 
struct  EgoEntry
 The ego list. More...
 
struct  RequestHandle
 The request handle. More...
 
struct  ego_sign_data_cls
 

Macros

#define GNUNET_REST_API_NS_IDENTITY   "/identity"
 Identity Namespace. More...
 
#define GNUNET_REST_API_NS_IDENTITY_PUBKEY   "/identity/pubkey"
 Identity Namespace with public key specifier. More...
 
#define GNUNET_REST_API_NS_IDENTITY_NAME   "/identity/name"
 Identity Namespace with public key specifier. More...
 
#define GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM   "/identity/subsystem"
 Identity Subsystem Namespace. More...
 
#define GNUNET_REST_API_NS_SIGN   "/sign"
 Identity Namespace with sign specifier. More...
 
#define GNUNET_REST_IDENTITY_PARAM_PUBKEY   "pubkey"
 Parameter public key. More...
 
#define GNUNET_REST_IDENTITY_PARAM_PRIVKEY   "privkey"
 Parameter private key. More...
 
#define GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM   "subsystem"
 Parameter subsystem. More...
 
#define GNUNET_REST_IDENTITY_PARAM_NAME   "name"
 Parameter name. More...
 
#define GNUNET_REST_IDENTITY_PARAM_NEWNAME   "newname"
 Parameter new name. More...
 
#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN   "Unknown Error"
 Error message Unknown Error. More...
 
#define GNUNET_REST_IDENTITY_NOT_FOUND   "No identity found"
 Error message No identity found. More...
 
#define GNUNET_REST_IDENTITY_MISSING_NAME   "Missing identity name"
 Error message Missing identity name. More...
 
#define GNUNET_REST_IDENTITY_MISSING_PUBKEY   "Missing identity public key"
 Error message Missing identity name. More...
 
#define GNUNET_REST_ERROR_NO_DATA   "No data"
 Error message No data. More...
 
#define GNUNET_REST_ERROR_DATA_INVALID   "Data invalid"
 Error message Data invalid. More...
 
#define ID_REST_STATE_INIT   0
 State while collecting all egos. More...
 
#define ID_REST_STATE_POST_INIT   1
 Done collecting egos. More...
 

Functions

static void cleanup_handle (void *cls)
 Cleanup lookup handle. More...
 
static void do_error (void *cls)
 Task run on errors. More...
 
struct EgoEntryget_egoentry (struct RequestHandle *handle, char *pubkey, char *name)
 Get EgoEntry from list with either a public key or a name If public key and name are not NULL, it returns the public key result first. More...
 
static void ego_get_for_subsystem (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name)
 Callback for GET Request with subsystem. More...
 
void ego_get_subsystem (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity GET request for subsystem. More...
 
void ego_get_all (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity GET request - responds with all identities. More...
 
void ego_get_response (struct RequestHandle *handle, struct EgoEntry *ego_entry)
 Responds with the ego_entry identity. More...
 
void ego_get_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity GET request with a public key. More...
 
void ego_get_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity GET request with a name. More...
 
static void do_finished (void *cls, const char *emsg)
 Processing finished. More...
 
static void do_finished_create (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, const char *emsg)
 Processing finished, when creating an ego. More...
 
void ego_edit (struct RequestHandle *handle, struct EgoEntry *ego_entry)
 Processing edit ego with EgoEntry ego_entry. More...
 
void ego_edit_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity PUT request with public key. More...
 
void ego_edit_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity PUT request with name. More...
 
void ego_edit_subsystem (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity subsystem PUT request with name. More...
 
void ego_create (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity POST request. More...
 
void ego_delete_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity DELETE request with public key. More...
 
void ego_delete_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Handle identity DELETE request with name. More...
 
void ego_sign_data_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 
void ego_sign_data (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 
static void options_cont (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
 Respond to OPTIONS request. More...
 
static void list_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier)
 
static enum GNUNET_GenericReturnValue rest_process_request (struct GNUNET_REST_RequestHandle *rest_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
 Function processing the REST call. More...
 
void * libgnunet_plugin_rest_identity_init (void *cls)
 Entry point for the plugin. More...
 
void * libgnunet_plugin_rest_identity_done (void *cls)
 Exit point from the plugin. More...
 

Variables

const struct GNUNET_CONFIGURATION_Handlecfg
 The configuration handle. More...
 
static char * allow_methods
 HTTP methods allows for this plugin. More...
 
static struct EgoEntryego_head
 Ego list. More...
 
static struct EgoEntryego_tail
 Ego list. More...
 
static int state
 The processing state. More...
 
static struct GNUNET_IDENTITY_Handleidentity_handle
 Handle to Identity service. More...
 
static struct RequestHandlerequests_head
 DLL. More...
 
static struct RequestHandlerequests_tail
 DLL. More...
 

Detailed Description

GNUnet Identity REST plugin.

Author
Martin Schanzenbach
Philippe Buschmann

Definition in file plugin_rest_identity.c.

Macro Definition Documentation

◆ GNUNET_REST_API_NS_IDENTITY

#define GNUNET_REST_API_NS_IDENTITY   "/identity"

Identity Namespace.

Definition at line 39 of file plugin_rest_identity.c.

◆ GNUNET_REST_API_NS_IDENTITY_PUBKEY

#define GNUNET_REST_API_NS_IDENTITY_PUBKEY   "/identity/pubkey"

Identity Namespace with public key specifier.

Definition at line 44 of file plugin_rest_identity.c.

◆ GNUNET_REST_API_NS_IDENTITY_NAME

#define GNUNET_REST_API_NS_IDENTITY_NAME   "/identity/name"

Identity Namespace with public key specifier.

Definition at line 49 of file plugin_rest_identity.c.

◆ GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM

#define GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM   "/identity/subsystem"

Identity Subsystem Namespace.

Definition at line 54 of file plugin_rest_identity.c.

◆ GNUNET_REST_API_NS_SIGN

#define GNUNET_REST_API_NS_SIGN   "/sign"

Identity Namespace with sign specifier.

Definition at line 59 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_PARAM_PUBKEY

#define GNUNET_REST_IDENTITY_PARAM_PUBKEY   "pubkey"

Parameter public key.

Definition at line 64 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_PARAM_PRIVKEY

#define GNUNET_REST_IDENTITY_PARAM_PRIVKEY   "privkey"

Parameter private key.

Definition at line 69 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM

#define GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM   "subsystem"

Parameter subsystem.

Definition at line 74 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_PARAM_NAME

#define GNUNET_REST_IDENTITY_PARAM_NAME   "name"

Parameter name.

Definition at line 79 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_PARAM_NEWNAME

#define GNUNET_REST_IDENTITY_PARAM_NEWNAME   "newname"

Parameter new name.

Definition at line 84 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_ERROR_UNKNOWN

#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN   "Unknown Error"

Error message Unknown Error.

Definition at line 89 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_NOT_FOUND

#define GNUNET_REST_IDENTITY_NOT_FOUND   "No identity found"

Error message No identity found.

Definition at line 94 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_MISSING_NAME

#define GNUNET_REST_IDENTITY_MISSING_NAME   "Missing identity name"

Error message Missing identity name.

Definition at line 99 of file plugin_rest_identity.c.

◆ GNUNET_REST_IDENTITY_MISSING_PUBKEY

#define GNUNET_REST_IDENTITY_MISSING_PUBKEY   "Missing identity public key"

Error message Missing identity name.

Definition at line 104 of file plugin_rest_identity.c.

◆ GNUNET_REST_ERROR_NO_DATA

#define GNUNET_REST_ERROR_NO_DATA   "No data"

Error message No data.

Definition at line 109 of file plugin_rest_identity.c.

◆ GNUNET_REST_ERROR_DATA_INVALID

#define GNUNET_REST_ERROR_DATA_INVALID   "Data invalid"

Error message Data invalid.

Definition at line 114 of file plugin_rest_identity.c.

◆ ID_REST_STATE_INIT

#define ID_REST_STATE_INIT   0

State while collecting all egos.

Definition at line 119 of file plugin_rest_identity.c.

◆ ID_REST_STATE_POST_INIT

#define ID_REST_STATE_POST_INIT   1

Done collecting egos.

Definition at line 124 of file plugin_rest_identity.c.

Function Documentation

◆ cleanup_handle()

static void cleanup_handle ( void *  cls)
static

Cleanup lookup handle.

Parameters
handleHandle to clean up

Definition at line 286 of file plugin_rest_identity.c.

287 {
288  struct RequestHandle *handle = cls;
289 
290  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cleaning up\n");
291  if (NULL != handle->timeout_task)
292  {
293  GNUNET_SCHEDULER_cancel (handle->timeout_task);
294  handle->timeout_task = NULL;
295  }
296 
297  if (NULL != handle->url)
298  GNUNET_free (handle->url);
299  if (NULL != handle->emsg)
300  GNUNET_free (handle->emsg);
301  if (NULL != handle->name)
302  GNUNET_free (handle->name);
305  handle);
307 }
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_free(ptr)
Wrapper around free.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:957
static struct RequestHandle * requests_head
DLL.
static struct RequestHandle * requests_tail
DLL.
The request handle.

References GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SCHEDULER_cancel(), handle, requests_head, and requests_tail.

Referenced by do_error(), do_finished(), ego_create(), ego_edit(), ego_get_all(), ego_get_for_subsystem(), ego_get_response(), ego_sign_data_cb(), libgnunet_plugin_rest_identity_done(), and options_cont().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_error()

static void do_error ( void *  cls)
static

Task run on errors.

Reports an error and cleans up everything.

Parameters
clsthe struct RequestHandle

Definition at line 316 of file plugin_rest_identity.c.

317 {
318  struct RequestHandle *handle = cls;
319  struct MHD_Response *resp;
320  json_t *json_error = json_object ();
321  char *response;
322 
323  if (NULL == handle->emsg)
325 
326  json_object_set_new (json_error, "error", json_string (handle->emsg));
327 
328  if (0 == handle->response_code)
329  handle->response_code = MHD_HTTP_OK;
330  response = json_dumps (json_error, 0);
332  GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
333  "Content-Type",
334  "application/json"));
335  handle->proc (handle->proc_cls, resp, handle->response_code);
336  json_decref (json_error);
339 }
static struct MHD_Response * response
Our canonical response.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
struct MHD_Response * GNUNET_REST_create_response(const char *data)
Create REST MHD response.
Definition: rest.c:57
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1281
#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN
Error message Unknown Error.
static void cleanup_handle(void *cls)
Cleanup lookup handle.

References cleanup_handle(), GNUNET_assert, GNUNET_free, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_ERROR_UNKNOWN, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and response.

Referenced by do_finished(), ego_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_for_subsystem(), ego_get_name(), ego_get_pubkey(), ego_get_subsystem(), ego_sign_data(), and ego_sign_data_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_egoentry()

struct EgoEntry* get_egoentry ( struct RequestHandle handle,
char *  pubkey,
char *  name 
)

Get EgoEntry from list with either a public key or a name If public key and name are not NULL, it returns the public key result first.

Parameters
handlethe RequestHandle
pubkeythe public key of an identity (only one can be NULL)
namethe name of an identity (only one can be NULL)
Returns
EgoEntry or NULL if not found

Definition at line 352 of file plugin_rest_identity.c.

353 {
354  struct EgoEntry *ego_entry;
355 
356  if (NULL != pubkey)
357  {
358  for (ego_entry = ego_head; NULL != ego_entry;
359  ego_entry = ego_entry->next)
360  {
361  if (0 != strcasecmp (pubkey, ego_entry->keystring))
362  continue;
363  return ego_entry;
364  }
365  }
366  if (NULL != name)
367  {
368  for (ego_entry = ego_head; NULL != ego_entry;
369  ego_entry = ego_entry->next)
370  {
371  if (0 != strcasecmp (name, ego_entry->identifier))
372  continue;
373  return ego_entry;
374  }
375  }
376  return NULL;
377 }
static struct GNUNET_IDENTITY_PublicKey pubkey
Public key of the zone to look in.
const char * name
static struct EgoEntry * ego_head
Ego list.
The ego list.
char * identifier
Ego Identifier.
char * keystring
Public key string.
struct EgoEntry * next
DLL.

References ego_head, EgoEntry::identifier, EgoEntry::keystring, name, EgoEntry::next, and pubkey.

Referenced by ego_delete_name(), ego_delete_pubkey(), ego_edit(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_name(), and ego_get_pubkey().

Here is the caller graph for this function:

◆ ego_get_for_subsystem()

static void ego_get_for_subsystem ( void *  cls,
struct GNUNET_IDENTITY_Ego ego,
void **  ctx,
const char *  name 
)
static

Callback for GET Request with subsystem.

Parameters
clsthe RequestHandle
egothe Ego found
ctxthe context
namethe id of the ego

Definition at line 389 of file plugin_rest_identity.c.

393 {
394  struct RequestHandle *handle = cls;
395  struct MHD_Response *resp;
396  struct GNUNET_IDENTITY_PublicKey public_key;
397  json_t *json_root;
398  char *result_str;
399  char *public_key_string;
400 
401  if (NULL == ego)
402  {
403  handle->response_code = MHD_HTTP_NOT_FOUND;
406  return;
407  }
408 
409  GNUNET_IDENTITY_ego_get_public_key (ego, &public_key);
410  public_key_string = GNUNET_IDENTITY_public_key_to_string (&public_key);
411 
412  // create json with subsystem identity
413  json_root = json_object ();
414  json_object_set_new (json_root,
416  json_string (public_key_string));
417  json_object_set_new (json_root,
419  json_string (name));
420 
421  result_str = json_dumps (json_root, 0);
422  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
423  resp = GNUNET_REST_create_response (result_str);
424  GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
425  "Content-Type",
426  "application/json"));
427  json_decref (json_root);
428  handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
429  GNUNET_free (result_str);
430  GNUNET_free (public_key_string);
432 }
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_IDENTITY_PublicKey *pk)
Get the identifier (public key) of an ego.
Definition: identity_api.c:652
char * GNUNET_IDENTITY_public_key_to_string(const struct GNUNET_IDENTITY_PublicKey *key)
Creates a (Base32) string representation of the public key.
#define GNUNET_REST_IDENTITY_PARAM_NAME
Parameter name.
#define GNUNET_REST_IDENTITY_PARAM_PUBKEY
Parameter public key.
#define GNUNET_REST_IDENTITY_NOT_FOUND
Error message No identity found.
static void do_error(void *cls)
Task run on errors.
An identity key as per LSD0001.

References cleanup_handle(), do_error(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_public_key(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and name.

Referenced by ego_get_subsystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ego_get_subsystem()

void ego_get_subsystem ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity GET request for subsystem.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 443 of file plugin_rest_identity.c.

446 {
447  struct RequestHandle *handle = cls;
448  char *subsystem;
449 
450  if (strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM) >= strlen (handle->url))
451  {
452  handle->emsg = GNUNET_strdup ("Missing subsystem name");
454  return;
455  }
457  // requested default identity of subsystem
458  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking for %s's ego\n", subsystem);
459 
461  subsystem,
463  handle);
464 
465  if (NULL == handle->op)
466  {
467  handle->response_code = MHD_HTTP_NOT_FOUND;
470  return;
471  }
472 }
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_get(struct GNUNET_IDENTITY_Handle *h, const char *service_name, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Obtain the identity that is currently preferred/default for a service.
Definition: identity_api.c:675
#define GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM
Identity Subsystem Namespace.
static void ego_get_for_subsystem(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name)
Callback for GET Request with subsystem.
static struct GNUNET_IDENTITY_Handle * identity_handle
Handle to Identity service.

References do_error(), ego_get_for_subsystem(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_get(), GNUNET_log, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, identity_handle, and subsystem.

Here is the call graph for this function:

◆ ego_get_all()

void ego_get_all ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity GET request - responds with all identities.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 483 of file plugin_rest_identity.c.

486 {
487  struct RequestHandle *handle = cls;
488  struct EgoEntry *ego_entry;
489  struct MHD_Response *resp;
490  struct GNUNET_HashCode key;
491  json_t *json_root;
492  json_t *json_ego;
493  char *result_str;
494  char *privkey_str;
495 
496  json_root = json_array ();
497  // Return ego/egos
498  for (ego_entry = ego_head; NULL != ego_entry;
499  ego_entry = ego_entry->next)
500  {
501  json_ego = json_object ();
502  json_object_set_new (json_ego,
504  json_string (ego_entry->keystring));
505  GNUNET_CRYPTO_hash ("private", strlen ("private"), &key);
506  if (GNUNET_YES ==
508  handle->rest_handle->url_param_map, &key))
509  {
512  json_object_set_new (json_ego,
514  json_string (privkey_str));
515  GNUNET_free (privkey_str);
516  }
517 
518  json_object_set_new (json_ego,
520  json_string (ego_entry->identifier));
521  json_array_append (json_root, json_ego);
522  json_decref (json_ego);
523  }
524 
525  result_str = json_dumps (json_root, 0);
526  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
527  resp = GNUNET_REST_create_response (result_str);
528  GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
529  "Content-Type",
530  "application/json"));
531  json_decref (json_root);
532  handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
533  GNUNET_free (result_str);
535 }
struct GNUNET_HashCode key
The key used in the DHT.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
const struct GNUNET_IDENTITY_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:639
char * GNUNET_IDENTITY_private_key_to_string(const struct GNUNET_IDENTITY_PrivateKey *key)
Creates a (Base32) string representation of the private key.
@ GNUNET_YES
#define GNUNET_REST_IDENTITY_PARAM_PRIVKEY
Parameter private key.
struct GNUNET_IDENTITY_Ego * ego
The Ego.
A 512-bit hashcode.

References cleanup_handle(), EgoEntry::ego, ego_head, GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_private_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_YES, handle, EgoEntry::identifier, key, EgoEntry::keystring, and EgoEntry::next.

Here is the call graph for this function:

◆ ego_get_response()

void ego_get_response ( struct RequestHandle handle,
struct EgoEntry ego_entry 
)

Responds with the ego_entry identity.

Parameters
handlethe struct RequestHandle
ego_entrythe struct EgoEntry for the response

Definition at line 545 of file plugin_rest_identity.c.

546 {
547  struct MHD_Response *resp;
548  struct GNUNET_HashCode key;
549  json_t *json_ego;
550  char *result_str;
551  char *privkey_str;
552 
553  json_ego = json_object ();
554  json_object_set_new (json_ego,
556  json_string (ego_entry->keystring));
557  json_object_set_new (json_ego,
559  json_string (ego_entry->identifier));
560  GNUNET_CRYPTO_hash ("private", strlen ("private"), &key);
561  if (GNUNET_YES ==
563  handle->rest_handle->url_param_map, &key))
564  {
567  json_object_set_new (json_ego,
569  json_string (privkey_str));
570  GNUNET_free (privkey_str);
571  }
572 
573  result_str = json_dumps (json_ego, 0);
574  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
575  resp = GNUNET_REST_create_response (result_str);
576  handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
577  GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
578  "Content-Type",
579  "application/json"));
580  json_decref (json_ego);
581  GNUNET_free (result_str);
583 }

References cleanup_handle(), EgoEntry::ego, GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_private_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_YES, handle, EgoEntry::identifier, key, and EgoEntry::keystring.

Referenced by ego_get_name(), and ego_get_pubkey().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ego_get_pubkey()

void ego_get_pubkey ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity GET request with a public key.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 594 of file plugin_rest_identity.c.

597 {
598  struct RequestHandle *handle = cls;
599  struct EgoEntry *ego_entry;
600  char *keystring;
601 
602  keystring = NULL;
603 
604  if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
605  {
606  handle->response_code = MHD_HTTP_NOT_FOUND;
609  return;
610  }
612  ego_entry = get_egoentry (handle, keystring, NULL);
613 
614  if (NULL == ego_entry)
615  {
616  handle->response_code = MHD_HTTP_NOT_FOUND;
619  return;
620  }
621 
622  ego_get_response (handle, ego_entry);
623 }
struct EgoEntry * get_egoentry(struct RequestHandle *handle, char *pubkey, char *name)
Get EgoEntry from list with either a public key or a name If public key and name are not NULL,...
#define GNUNET_REST_IDENTITY_MISSING_PUBKEY
Error message Missing identity name.
void ego_get_response(struct RequestHandle *handle, struct EgoEntry *ego_entry)
Responds with the ego_entry identity.
#define GNUNET_REST_API_NS_IDENTITY_PUBKEY
Identity Namespace with public key specifier.

References do_error(), ego_get_response(), get_egoentry(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and EgoEntry::keystring.

Here is the call graph for this function:

◆ ego_get_name()

void ego_get_name ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity GET request with a name.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 634 of file plugin_rest_identity.c.

637 {
638  struct RequestHandle *handle = cls;
639  struct EgoEntry *ego_entry;
640  char *egoname;
641 
642  egoname = NULL;
643 
644  if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
645  {
646  handle->response_code = MHD_HTTP_NOT_FOUND;
649  return;
650  }
651  egoname = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_NAME) + 1];
652  ego_entry = get_egoentry (handle, NULL, egoname);
653 
654  if (NULL == ego_entry)
655  {
656  handle->response_code = MHD_HTTP_NOT_FOUND;
659  return;
660  }
661 
662  ego_get_response (handle, ego_entry);
663 }
static char * egoname
Ego Attribut String.
Definition: gnunet-did.c:96
#define GNUNET_REST_IDENTITY_MISSING_NAME
Error message Missing identity name.
#define GNUNET_REST_API_NS_IDENTITY_NAME
Identity Namespace with public key specifier.

References do_error(), ego_get_response(), egoname, get_egoentry(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, and handle.

Here is the call graph for this function:

◆ do_finished()

static void do_finished ( void *  cls,
const char *  emsg 
)
static

Processing finished.

Parameters
clsrequest handle
emsgerror message

Definition at line 673 of file plugin_rest_identity.c.

674 {
675  struct RequestHandle *handle = cls;
676  struct MHD_Response *resp;
677 
678  handle->op = NULL;
679  if (NULL != emsg)
680  {
681  handle->emsg = GNUNET_strdup (emsg);
683  return;
684  }
685  if (0 == handle->response_code)
686  {
687  handle->response_code = MHD_HTTP_NO_CONTENT;
688  }
689  resp = GNUNET_REST_create_response (NULL);
690  handle->proc (handle->proc_cls, resp, handle->response_code);
692 }

References cleanup_handle(), do_error(), GNUNET_REST_create_response(), GNUNET_SCHEDULER_add_now(), GNUNET_strdup, and handle.

Referenced by do_finished_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit(), and ego_edit_subsystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_finished_create()

static void do_finished_create ( void *  cls,
const struct GNUNET_IDENTITY_PrivateKey pk,
const char *  emsg 
)
static

Processing finished, when creating an ego.

Parameters
clsrequest handle
privatekey of the ego, or NULL on error
emsgerror message

Definition at line 703 of file plugin_rest_identity.c.

706 {
707  struct RequestHandle *handle = cls;
708 
709  (void) pk;
711 }
struct GNUNET_IDENTITY_PrivateKey pk
Private key from command line option, or NULL.
static void do_finished(void *cls, const char *emsg)
Processing finished.
char * emsg
Error response message.

References do_finished(), RequestHandle::emsg, handle, and pk.

Referenced by ego_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ego_edit()

void ego_edit ( struct RequestHandle handle,
struct EgoEntry ego_entry 
)

Processing edit ego with EgoEntry ego_entry.

Parameters
handlethe struct RequestHandle
ego_entrythe struct EgoEntry we want to edit

Definition at line 721 of file plugin_rest_identity.c.

722 {
723  struct EgoEntry *ego_entry_tmp;
724  struct MHD_Response *resp;
725  json_t *data_js;
726  json_error_t err;
727  char *newname;
728  char term_data[handle->data_size + 1];
729  int json_state;
730 
731  // if no data
732  if (0 >= handle->data_size)
733  {
736  return;
737  }
738  // if not json
739  term_data[handle->data_size] = '\0';
740  GNUNET_memcpy (term_data, handle->data, handle->data_size);
741  data_js = json_loads (term_data, JSON_DECODE_ANY, &err);
742 
743  if (NULL == data_js)
744  {
747  return;
748  }
749 
750  newname = NULL;
751  // NEW NAME
752  json_state = 0;
753  json_state = json_unpack (data_js,
754  "{s:s!}",
756  &newname);
757  // Change name with pubkey or name identifier
758  if (0 != json_state)
759  {
762  json_decref (data_js);
763  return;
764  }
765 
766  if (NULL == newname)
767  {
770  json_decref (data_js);
771  return;
772  }
773 
774  if (0 >= strlen (newname))
775  {
778  json_decref (data_js);
779  return;
780  }
781 
782  ego_entry_tmp = get_egoentry (handle, NULL, newname);
783  if (NULL != ego_entry_tmp)
784  {
785  // Ego with same name not allowed (even if its the ego we change)
786  resp = GNUNET_REST_create_response (NULL);
787  handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
789  json_decref (data_js);
790  return;
791  }
793  ego_entry->identifier,
794  newname,
795  &do_finished,
796  handle);
797  if (NULL == handle->op)
798  {
799  handle->emsg = GNUNET_strdup ("Rename failed");
801  json_decref (data_js);
802  return;
803  }
804  json_decref (data_js);
805  return;
806 }
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *h, const char *old_name, const char *new_name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Renames an existing identity.
Definition: identity_api.c:810
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_REST_ERROR_NO_DATA
Error message No data.
#define GNUNET_REST_IDENTITY_PARAM_NEWNAME
Parameter new name.
#define GNUNET_REST_ERROR_DATA_INVALID
Error message Data invalid.

References cleanup_handle(), do_error(), do_finished(), get_egoentry(), GNUNET_IDENTITY_rename(), GNUNET_memcpy, GNUNET_REST_create_response(), GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_PARAM_NEWNAME, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::identifier, and identity_handle.

Referenced by ego_edit_name(), and ego_edit_pubkey().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ego_edit_pubkey()

void ego_edit_pubkey ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity PUT request with public key.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 817 of file plugin_rest_identity.c.

820 {
821  struct RequestHandle *handle = cls;
822  struct EgoEntry *ego_entry;
823  char *keystring;
824 
825  keystring = NULL;
826 
827  if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
828  {
829  handle->response_code = MHD_HTTP_NOT_FOUND;
832  return;
833  }
835  ego_entry = get_egoentry (handle, keystring, NULL);
836 
837  if (NULL == ego_entry)
838  {
839  handle->response_code = MHD_HTTP_NOT_FOUND;
842  return;
843  }
844 
845  ego_edit (handle, ego_entry);
846 }
void ego_edit(struct RequestHandle *handle, struct EgoEntry *ego_entry)
Processing edit ego with EgoEntry ego_entry.

References do_error(), ego_edit(), get_egoentry(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and EgoEntry::keystring.

Here is the call graph for this function:

◆ ego_edit_name()

void ego_edit_name ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity PUT request with name.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 857 of file plugin_rest_identity.c.

860 {
861  struct RequestHandle *handle = cls;
862  struct EgoEntry *ego_entry;
863  char *name;
864 
865  name = NULL;
866 
867  if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
868  {
869  handle->response_code = MHD_HTTP_NOT_FOUND;
872  return;
873  }
874  name = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_NAME) + 1];
875  ego_entry = get_egoentry (handle, NULL, name);
876 
877  if (NULL == ego_entry)
878  {
879  handle->response_code = MHD_HTTP_NOT_FOUND;
882  return;
883  }
884 
885  ego_edit (handle, ego_entry);
886 }

References do_error(), ego_edit(), get_egoentry(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and name.

Here is the call graph for this function:

◆ ego_edit_subsystem()

void ego_edit_subsystem ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity subsystem PUT request with name.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 897 of file plugin_rest_identity.c.

900 {
901  struct RequestHandle *handle = cls;
902  struct EgoEntry *ego_entry;
903  json_t *data_js;
904  json_error_t err;
905  char *newsubsys;
906  char *name;
907  char term_data[handle->data_size + 1];
908  int json_state;
909 
910  name = NULL;
911 
912  if (strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM) >= strlen (handle->url))
913  {
914  handle->response_code = MHD_HTTP_NOT_FOUND;
917  return;
918  }
919  name = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM) + 1];
920  ego_entry = get_egoentry (handle, NULL, name);
921 
922  if (NULL == ego_entry)
923  {
924  handle->response_code = MHD_HTTP_NOT_FOUND;
927  return;
928  }
929 
930  // if no data
931  if (0 >= handle->data_size)
932  {
935  return;
936  }
937  // if not json
938  term_data[handle->data_size] = '\0';
939  GNUNET_memcpy (term_data, handle->data, handle->data_size);
940  data_js = json_loads (term_data, JSON_DECODE_ANY, &err);
941 
942  if (NULL == data_js)
943  {
946  return;
947  }
948 
949  newsubsys = NULL;
950  // SUBSYSTEM
951  json_state = 0;
952  json_state = json_unpack (data_js,
953  "{s:s!}",
955  &newsubsys);
956  // Change subsystem with pubkey or name identifier
957  if (0 != json_state)
958  {
961  json_decref (data_js);
962  return;
963  }
964 
965  if (NULL == newsubsys)
966  {
969  json_decref (data_js);
970  return;
971  }
972 
973  if (0 >= strlen (newsubsys))
974  {
977  json_decref (data_js);
978  return;
979  }
980 
981  handle->response_code = MHD_HTTP_NO_CONTENT;
983  newsubsys,
984  ego_entry->ego,
985  &do_finished,
986  handle);
987  if (NULL == handle->op)
988  {
989  handle->emsg = GNUNET_strdup ("Setting subsystem failed");
991  return;
992  }
993  json_decref (data_js);
994  return;
995 }
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_set(struct GNUNET_IDENTITY_Handle *h, const char *service_name, struct GNUNET_IDENTITY_Ego *ego, GNUNET_IDENTITY_Continuation cont, void *cont_cls)
Set the preferred/default identity for a service.
Definition: identity_api.c:720
#define GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM
Parameter subsystem.

References do_error(), do_finished(), EgoEntry::ego, get_egoentry(), GNUNET_IDENTITY_set(), GNUNET_memcpy, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, identity_handle, and name.

Here is the call graph for this function:

◆ ego_create()

void ego_create ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity POST request.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 1006 of file plugin_rest_identity.c.

1009 {
1010  struct RequestHandle *handle = cls;
1011  struct EgoEntry *ego_entry;
1012  struct MHD_Response *resp;
1013  json_t *data_js;
1014  json_error_t err;
1015  char *egoname;
1016  char *privkey;
1018  struct GNUNET_IDENTITY_PrivateKey *pk_ptr;
1019  int json_unpack_state;
1020  char term_data[handle->data_size + 1];
1021 
1022  if (strlen (GNUNET_REST_API_NS_IDENTITY) != strlen (handle->url))
1023  {
1025  return;
1026  }
1027 
1028  if (0 >= handle->data_size)
1029  {
1032  return;
1033  }
1034  term_data[handle->data_size] = '\0';
1035  GNUNET_memcpy (term_data, handle->data, handle->data_size);
1036  data_js = json_loads (term_data, JSON_DECODE_ANY, &err);
1037  if (NULL == data_js)
1038  {
1041  json_decref (data_js);
1042  return;
1043  }
1044  json_unpack_state = 0;
1045  privkey = NULL;
1046  json_unpack_state =
1047  json_unpack (data_js, "{s:s, s?:s!}",
1050  if (0 != json_unpack_state)
1051  {
1054  json_decref (data_js);
1055  return;
1056  }
1057 
1058  if (NULL == egoname)
1059  {
1062  json_decref (data_js);
1063  return;
1064  }
1065  if (0 >= strlen (egoname))
1066  {
1067  json_decref (data_js);
1070  return;
1071  }
1073  for (ego_entry = ego_head; NULL != ego_entry;
1074  ego_entry = ego_entry->next)
1075  {
1076  if (0 == strcasecmp (egoname, ego_entry->identifier))
1077  {
1078  resp = GNUNET_REST_create_response (NULL);
1079  handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
1081  json_decref (data_js);
1082  return;
1083  }
1084  }
1085  handle->name = GNUNET_strdup (egoname);
1086  if (NULL != privkey)
1087  {
1089  strlen (privkey),
1090  &pk,
1091  sizeof(struct
1093  pk_ptr = &pk;
1094  }
1095  else
1096  pk_ptr = NULL;
1097  json_decref (data_js);
1098  handle->response_code = MHD_HTTP_CREATED;
1100  handle->name,
1101  pk_ptr,
1104  handle);
1105 }
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *h, const char *name, const struct GNUNET_IDENTITY_PrivateKey *privkey, enum GNUNET_IDENTITY_KeyType ktype, GNUNET_IDENTITY_CreateContinuation cont, void *cont_cls)
Create a new ego with the given name.
Definition: identity_api.c:757
@ GNUNET_IDENTITY_TYPE_ECDSA
The identity type.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
Definition: strings.c:789
enum GNUNET_GenericReturnValue GNUNET_STRINGS_utf8_tolower(const char *input, char *output)
Convert the utf-8 input string to lower case.
Definition: strings.c:450
#define GNUNET_REST_API_NS_IDENTITY
Identity Namespace.
static void do_finished_create(void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, const char *emsg)
Processing finished, when creating an ego.
A private key for an identity as per LSD0001.

References cleanup_handle(), do_error(), do_finished_create(), ego_head, egoname, GNUNET_IDENTITY_create(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_memcpy, GNUNET_REST_API_NS_IDENTITY, GNUNET_REST_create_response(), GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, GNUNET_STRINGS_string_to_data(), GNUNET_STRINGS_utf8_tolower(), handle, EgoEntry::identifier, identity_handle, EgoEntry::next, and pk.

Here is the call graph for this function:

◆ ego_delete_pubkey()

void ego_delete_pubkey ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity DELETE request with public key.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 1116 of file plugin_rest_identity.c.

1119 {
1120  struct RequestHandle *handle = cls;
1121  struct EgoEntry *ego_entry;
1122  char *keystring;
1123 
1124  keystring = NULL;
1125 
1126  if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
1127  {
1128  handle->response_code = MHD_HTTP_NOT_FOUND;
1131  return;
1132  }
1133  keystring = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) + 1];
1134  ego_entry = get_egoentry (handle, keystring, NULL);
1135 
1136  if (NULL == ego_entry)
1137  {
1138  handle->response_code = MHD_HTTP_NOT_FOUND;
1141  return;
1142  }
1143 
1144  handle->response_code = MHD_HTTP_NO_CONTENT;
1146  ego_entry->identifier,
1147  &do_finished,
1148  handle);
1149 }
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *h, const char *name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Delete an existing identity.
Definition: identity_api.c:863

References do_error(), do_finished(), get_egoentry(), GNUNET_IDENTITY_delete(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::identifier, identity_handle, and EgoEntry::keystring.

Here is the call graph for this function:

◆ ego_delete_name()

void ego_delete_name ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)

Handle identity DELETE request with name.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 1160 of file plugin_rest_identity.c.

1163 {
1164  struct RequestHandle *handle = cls;
1165  struct EgoEntry *ego_entry;
1166  char *name;
1167 
1168  name = NULL;
1169 
1170  if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
1171  {
1172  handle->response_code = MHD_HTTP_NOT_FOUND;
1175  return;
1176  }
1177  name = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_NAME) + 1];
1178  ego_entry = get_egoentry (handle, NULL, name);
1179 
1180  if (NULL == ego_entry)
1181  {
1182  handle->response_code = MHD_HTTP_NOT_FOUND;
1185  return;
1186  }
1187 
1188  handle->response_code = MHD_HTTP_NO_CONTENT;
1190  ego_entry->identifier,
1191  &do_finished,
1192  handle);
1193 }

References do_error(), do_finished(), get_egoentry(), GNUNET_IDENTITY_delete(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::identifier, identity_handle, and name.

Here is the call graph for this function:

◆ ego_sign_data_cb()

void ego_sign_data_cb ( void *  cls,
struct GNUNET_IDENTITY_Ego ego 
)

Definition at line 1202 of file plugin_rest_identity.c.

1203 {
1204  struct RequestHandle *handle = ((struct ego_sign_data_cls *) cls)->handle;
1205  unsigned char *data
1206  = (unsigned char *) ((struct ego_sign_data_cls *) cls)->data; // data is url decoded
1207  struct MHD_Response *resp;
1208  struct GNUNET_CRYPTO_EddsaSignature sig;
1209  char *sig_str;
1210  char *result;
1211 
1212  if (ego == NULL)
1213  {
1214  handle->response_code = MHD_HTTP_BAD_REQUEST;
1215  handle->emsg = GNUNET_strdup ("Ego not found");
1217  return;
1218  }
1219 
1220  if (ntohl (ego->pk.type) != GNUNET_IDENTITY_TYPE_EDDSA)
1221  {
1222  handle->response_code = MHD_HTTP_BAD_REQUEST;
1223  handle->emsg = GNUNET_strdup ("Ego has to use an EdDSA key");
1225  return;
1226  }
1227 
1229  (void *) data,
1230  strlen ( (char*) data),
1231  &sig))
1232  {
1233  handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
1234  handle->emsg = GNUNET_strdup ("Signature creation failed");
1236  return;
1237  }
1238 
1240  sizeof (struct GNUNET_CRYPTO_EddsaSignature),
1241  &sig_str);
1242 
1244  "{\"signature\": \"%s\"}",
1245  sig_str);
1246 
1248  handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
1249 
1250  free (data);
1251  free (sig_str);
1252  free (result);
1253  free (cls);
1255 }
uint32_t data
The data value.
static int result
Global testing status.
@ GNUNET_IDENTITY_TYPE_EDDSA
EDDSA identity.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_raw(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, void *data, size_t size, struct GNUNET_CRYPTO_EddsaSignature *sig)
Definition: crypto_ecc.c:598
@ GNUNET_OK
Definition: gnunet_common.h:99
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
size_t GNUNET_STRINGS_base64url_encode(const void *in, size_t len, char **output)
Encode into Base64url.
Definition: strings.c:1657
an ECC signature using EdDSA.
struct GNUNET_IDENTITY_PrivateKey pk
The identity key pair.
Definition: identity.h:51
uint32_t type
Type of public key.
struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_key
AN EdDSA identtiy key.

References cleanup_handle(), data, do_error(), GNUNET_IDENTITY_PrivateKey::eddsa_key, GNUNET_asprintf(), GNUNET_CRYPTO_eddsa_sign_raw(), GNUNET_IDENTITY_TYPE_EDDSA, GNUNET_OK, GNUNET_REST_create_response(), GNUNET_SCHEDULER_add_now(), GNUNET_strdup, GNUNET_STRINGS_base64url_encode(), handle, GNUNET_IDENTITY_Ego::pk, result, and GNUNET_IDENTITY_PrivateKey::type.

Referenced by ego_sign_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ego_sign_data()

void ego_sign_data ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)
Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 1264 of file plugin_rest_identity.c.

1267 {
1268  // TODO: replace with precompiler #define
1269  const char *username_key = "user";
1270  const char *data_key = "data";
1271 
1272  struct RequestHandle *handle = cls;
1273  struct GNUNET_HashCode cache_key_username;
1274  struct GNUNET_HashCode cache_key_data;
1275  char *username;
1276  char *data;
1277 
1278  struct ego_sign_data_cls *cls2;
1279 
1280  GNUNET_CRYPTO_hash (username_key, strlen (username_key), &cache_key_username);
1281  GNUNET_CRYPTO_hash (data_key, strlen (data_key), &cache_key_data);
1282 
1284  handle->rest_handle->url_param_map,
1285  &cache_key_username)) ||
1287  handle->rest_handle->url_param_map,
1288  &cache_key_data)))
1289  {
1290  handle->response_code = MHD_HTTP_BAD_REQUEST;
1291  handle->emsg = GNUNET_strdup ("URL parameter missing");
1293  return;
1294  }
1295 
1296  username = (char *) GNUNET_CONTAINER_multihashmap_get (
1297  handle->rest_handle->url_param_map,
1298  &cache_key_username);
1299 
1301  handle->rest_handle->url_param_map,
1302  &cache_key_data);
1303 
1304  cls2 = malloc (sizeof(struct ego_sign_data_cls));
1305  cls2->data = (void *) GNUNET_strdup (data);
1306  cls2->handle = handle;
1307 
1309  username,
1311  cls2);
1312 }
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
struct GNUNET_IDENTITY_EgoLookup * GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, GNUNET_IDENTITY_EgoCallback cb, void *cb_cls)
Lookup an ego by name.
@ GNUNET_NO
Definition: gnunet_common.h:98
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration handle.
void ego_sign_data_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego)
struct RequestHandle * handle

References cfg, ego_sign_data_cls::data, data, do_error(), ego_sign_data_cb(), GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CRYPTO_hash(), GNUNET_IDENTITY_ego_lookup(), GNUNET_NO, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, and ego_sign_data_cls::handle.

Here is the call graph for this function:

◆ options_cont()

static void options_cont ( struct GNUNET_REST_RequestHandle con_handle,
const char *  url,
void *  cls 
)
static

Respond to OPTIONS request.

Parameters
con_handlethe connection handle
urlthe url
clsthe RequestHandle

Definition at line 1322 of file plugin_rest_identity.c.

1325 {
1326  struct MHD_Response *resp;
1327  struct RequestHandle *handle = cls;
1328 
1329  // For now, independent of path return all options
1330  resp = GNUNET_REST_create_response (NULL);
1331  GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
1332  "Access-Control-Allow-Methods",
1333  allow_methods));
1334  handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
1336  return;
1337 }
static char * allow_methods
HTTP methods allows for this plugin.

References allow_methods, cleanup_handle(), GNUNET_assert, GNUNET_REST_create_response(), GNUNET_SCHEDULER_add_now(), and handle.

Here is the call graph for this function:

◆ list_ego()

static void list_ego ( void *  cls,
struct GNUNET_IDENTITY_Ego ego,
void **  ctx,
const char *  identifier 
)
static

Definition at line 1341 of file plugin_rest_identity.c.

1345 {
1346  struct EgoEntry *ego_entry;
1348 
1349  if ((NULL == ego) && (ID_REST_STATE_INIT == state))
1350  {
1352  return;
1353  }
1354  if (NULL == ego)
1355  {
1357  "Called with NULL ego\n");
1358  return;
1359  }
1360  if (ID_REST_STATE_INIT == state)
1361  {
1362  ego_entry = GNUNET_new (struct EgoEntry);
1365  ego_entry->ego = ego;
1366  ego_entry->identifier = GNUNET_strdup (identifier);
1368  ego_tail,
1369  ego_entry);
1370  }
1371  /* Ego renamed or added */
1372  if (identifier != NULL)
1373  {
1374  for (ego_entry = ego_head; NULL != ego_entry;
1375  ego_entry = ego_entry->next)
1376  {
1377  if (ego_entry->ego == ego)
1378  {
1379  /* Rename */
1380  GNUNET_free (ego_entry->identifier);
1381  ego_entry->identifier = GNUNET_strdup (identifier);
1382  break;
1383  }
1384  }
1385  if (NULL == ego_entry)
1386  {
1387  /* Add */
1388  ego_entry = GNUNET_new (struct EgoEntry);
1391  ego_entry->ego = ego;
1392  ego_entry->identifier = GNUNET_strdup (identifier);
1394  ego_tail,
1395  ego_entry);
1396  }
1397  }
1398  else
1399  {
1400  /* Delete */
1401  for (ego_entry = ego_head; NULL != ego_entry;
1402  ego_entry = ego_entry->next)
1403  {
1404  if (ego_entry->ego == ego)
1405  break;
1406  }
1407  if (NULL == ego_entry)
1408  return; /* Not found */
1409 
1411  ego_tail,
1412  ego_entry);
1413  GNUNET_free (ego_entry->identifier);
1414  GNUNET_free (ego_entry->keystring);
1415  GNUNET_free (ego_entry);
1416  return;
1417  }
1418 
1419 }
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
@ GNUNET_ERROR_TYPE_WARNING
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static struct EgoEntry * ego_tail
Ego list.
#define ID_REST_STATE_INIT
State while collecting all egos.
static int state
The processing state.
#define ID_REST_STATE_POST_INIT
Done collecting egos.

References EgoEntry::ego, ego_head, ego_tail, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_IDENTITY_ego_get_public_key(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_log, GNUNET_new, GNUNET_strdup, ID_REST_STATE_INIT, ID_REST_STATE_POST_INIT, EgoEntry::identifier, EgoEntry::keystring, EgoEntry::next, pk, and state.

Referenced by libgnunet_plugin_rest_identity_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rest_process_request()

static enum GNUNET_GenericReturnValue rest_process_request ( struct GNUNET_REST_RequestHandle rest_handle,
GNUNET_REST_ResultProcessor  proc,
void *  proc_cls 
)
static

Function processing the REST call.

Parameters
methodHTTP method
urlURL of the HTTP request
databody of the HTTP request (optional)
data_sizelength of the body
proccallback function for the result
proc_clsclosure for callback function
Returns
GNUNET_OK if request accepted

Definition at line 1341 of file plugin_rest_identity.c.

1437 {
1438  struct RequestHandle *handle = GNUNET_new (struct RequestHandle);
1440  static const struct GNUNET_REST_RequestHandler handlers[] =
1441  { { MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_PUBKEY,
1442  &ego_get_pubkey },
1443  { MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_NAME, &ego_get_name },
1444  { MHD_HTTP_METHOD_GET,
1446  &ego_get_subsystem },
1447  { MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY, &ego_get_all },
1448  { MHD_HTTP_METHOD_PUT,
1450  &ego_edit_pubkey },
1451  { MHD_HTTP_METHOD_PUT, GNUNET_REST_API_NS_IDENTITY_NAME, &ego_edit_name },
1452  { MHD_HTTP_METHOD_PUT,
1454  &ego_edit_subsystem },
1455  { MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY, &ego_create },
1456  { MHD_HTTP_METHOD_DELETE,
1458  &ego_delete_pubkey },
1459  { MHD_HTTP_METHOD_DELETE,
1461  &ego_delete_name },
1462  { MHD_HTTP_METHOD_OPTIONS, GNUNET_REST_API_NS_IDENTITY, &options_cont },
1463  { MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_SIGN, &ego_sign_data},
1465 
1466 
1467  handle->response_code = 0;
1469  handle->proc_cls = proc_cls;
1470  handle->proc = proc;
1471  handle->rest_handle = rest_handle;
1472  handle->data = rest_handle->data;
1473  handle->data_size = rest_handle->data_size;
1474 
1475  handle->url = GNUNET_strdup (rest_handle->url);
1476  if (handle->url[strlen (handle->url) - 1] == '/')
1477  handle->url[strlen (handle->url) - 1] = '\0';
1478  handle->timeout_task =
1481  requests_tail,
1482  handle);
1483  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting...\n");
1484  if (GNUNET_NO ==
1485  GNUNET_REST_handle_request (handle->rest_handle, handlers, &err, handle))
1486  {
1488  return GNUNET_NO;
1489  }
1490 
1491  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
1492  return GNUNET_YES;
1493 }
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
int GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn, const struct GNUNET_REST_RequestHandler *handlers, struct GNUNET_REST_RequestHandlerError *err, void *cls)
Definition: rest.c:77
#define GNUNET_REST_HANDLER_END
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1254
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
void ego_get_pubkey(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity GET request with a public key.
void ego_sign_data(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
void ego_get_all(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity GET request - responds with all identities.
void ego_delete_pubkey(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity DELETE request with public key.
void ego_edit_name(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity PUT request with name.
static void options_cont(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Respond to OPTIONS request.
#define GNUNET_REST_API_NS_SIGN
Identity Namespace with sign specifier.
void ego_edit_subsystem(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity subsystem PUT request with name.
void ego_delete_name(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity DELETE request with name.
void ego_get_name(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity GET request with a name.
void ego_get_subsystem(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity GET request for subsystem.
void ego_edit_pubkey(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity PUT request with public key.
void ego_create(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle identity POST request.
const char * data
The POST data.
const char * url
The url as string.
size_t data_size
The POST data size.
void(* proc)(struct GNUNET_REST_RequestHandle *handle, const char *url, void *cls)
Namespace to handle.

Referenced by libgnunet_plugin_rest_identity_init().

Here is the caller graph for this function:

◆ libgnunet_plugin_rest_identity_init()

void* libgnunet_plugin_rest_identity_init ( void *  cls)

Entry point for the plugin.

Parameters
clsConfig info
Returns
NULL on error, otherwise the plugin context

Definition at line 1503 of file plugin_rest_identity.c.

1504 {
1505  static struct Plugin plugin;
1506  struct GNUNET_REST_Plugin *api;
1507 
1508  cfg = cls;
1509  if (NULL != plugin.cfg)
1510  return NULL; /* can only initialize once! */
1511  memset (&plugin, 0, sizeof(struct Plugin));
1512  plugin.cfg = cfg;
1513  api = GNUNET_new (struct GNUNET_REST_Plugin);
1514  api->cls = &plugin;
1518  "%s, %s, %s, %s, %s",
1519  MHD_HTTP_METHOD_GET,
1520  MHD_HTTP_METHOD_POST,
1521  MHD_HTTP_METHOD_PUT,
1522  MHD_HTTP_METHOD_DELETE,
1523  MHD_HTTP_METHOD_OPTIONS);
1526 
1527  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _ ("Identity REST API initialized\n"));
1528  return api;
1529 }
struct Plugin * plugin
The process handle to the testbed service.
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
Definition: identity_api.c:610
#define _(String)
GNU gettext support macro.
Definition: platform.h:177
static enum GNUNET_GenericReturnValue rest_process_request(struct GNUNET_REST_RequestHandle *rest_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
Function processing the REST call.
static void list_ego(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier)
struct returned by the initialization function of the plugin
char * name
Plugin name.
void * cls
The closure of the plugin.
enum GNUNET_GenericReturnValue(* process_request)(struct GNUNET_REST_RequestHandle *handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
Function to process a REST call.
Handle for a plugin.
Definition: block.c:38
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.

References _, allow_methods, Plugin::cfg, cfg, GNUNET_REST_Plugin::cls, GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_connect(), GNUNET_log, GNUNET_new, GNUNET_REST_API_NS_IDENTITY, ID_REST_STATE_INIT, identity_handle, list_ego(), GNUNET_REST_Plugin::name, plugin, GNUNET_REST_Plugin::process_request, rest_process_request(), and state.

Here is the call graph for this function:

◆ libgnunet_plugin_rest_identity_done()

void* libgnunet_plugin_rest_identity_done ( void *  cls)

Exit point from the plugin.

Parameters
clsthe plugin context (as returned by "init")
Returns
always NULL

Definition at line 1539 of file plugin_rest_identity.c.

1540 {
1541  struct GNUNET_REST_Plugin *api = cls;
1542  struct Plugin *plugin = api->cls;
1543  struct EgoEntry *ego_entry;
1544  struct EgoEntry *ego_tmp;
1545 
1546  plugin->cfg = NULL;
1547  while (NULL != requests_head)
1549  if (NULL != identity_handle)
1551 
1552  for (ego_entry = ego_head; NULL != ego_entry;)
1553  {
1554  ego_tmp = ego_entry;
1555  ego_entry = ego_entry->next;
1556  GNUNET_free (ego_tmp->identifier);
1557  GNUNET_free (ego_tmp->keystring);
1558  GNUNET_free (ego_tmp);
1559  }
1560 
1562  GNUNET_free (api);
1563  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Identity REST plugin is finished\n");
1564  return NULL;
1565 }
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
Definition: identity_api.c:921
void * cls
Closure for all of the callbacks.
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
Definition: block.c:47

References allow_methods, Plugin::api, Plugin::cfg, cleanup_handle(), GNUNET_BLOCK_PluginFunctions::cls, GNUNET_REST_Plugin::cls, ego_head, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_disconnect(), GNUNET_log, EgoEntry::identifier, identity_handle, EgoEntry::keystring, EgoEntry::next, plugin, and requests_head.

Here is the call graph for this function:

Variable Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* cfg

The configuration handle.

Handle to our configuration.

Definition at line 129 of file plugin_rest_identity.c.

Referenced by ego_sign_data(), and libgnunet_plugin_rest_identity_init().

◆ allow_methods

char* allow_methods
static

HTTP methods allows for this plugin.

Definition at line 134 of file plugin_rest_identity.c.

Referenced by libgnunet_plugin_rest_identity_done(), libgnunet_plugin_rest_identity_init(), and options_cont().

◆ ego_head

struct EgoEntry* ego_head
static

◆ ego_tail

struct EgoEntry* ego_tail
static

Ego list.

Definition at line 144 of file plugin_rest_identity.c.

Referenced by list_ego().

◆ state

int state
static

The processing state.

Definition at line 149 of file plugin_rest_identity.c.

Referenced by libgnunet_plugin_rest_identity_init(), and list_ego().

◆ identity_handle

struct GNUNET_IDENTITY_Handle* identity_handle
static

◆ requests_head

struct RequestHandle* requests_head
static

DLL.

Definition at line 274 of file plugin_rest_identity.c.

Referenced by cleanup_handle(), and libgnunet_plugin_rest_identity_done().

◆ requests_tail

struct RequestHandle* requests_tail
static

DLL.

Definition at line 279 of file plugin_rest_identity.c.

Referenced by cleanup_handle().