diff options
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/chat/chat.c | 4 | ||||
-rw-r--r-- | src/chat/gnunet-chat.c | 24 | ||||
-rw-r--r-- | src/fs/fs_api.h | 4 | ||||
-rw-r--r-- | src/fs/fs_namespace.c | 26 | ||||
-rw-r--r-- | src/fs/fs_pseudonym.c | 182 | ||||
-rw-r--r-- | src/fs/fs_publish_ksk.c | 18 | ||||
-rw-r--r-- | src/fs/fs_search.c | 24 | ||||
-rw-r--r-- | src/fs/fs_unindex.c | 16 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 14 | ||||
-rw-r--r-- | src/fs/gnunet-pseudonym.c | 20 | ||||
-rw-r--r-- | src/fs/plugin_block_fs.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_uri.c | 8 | ||||
-rw-r--r-- | src/fs/test_pseudonym.c | 156 | ||||
-rw-r--r-- | src/include/block_fs.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_fs_service.h | 146 |
17 files changed, 331 insertions, 331 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 11e260e5a..b620c0335 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -3,15 +3,15 @@ | |||
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | if HAVE_EXPERIMENTAL | 5 | if HAVE_EXPERIMENTAL |
6 | EXP_DIR = fs chat consensus dv | 6 | EXP_DIR = fs gns chat consensus dv |
7 | endif | 7 | endif |
8 | 8 | ||
9 | if LINUX | 9 | if LINUX |
10 | # All of these currently only work on GNU/Linux | 10 | # All of these currently only work on GNU/Linux |
11 | LINUX_DIR = dns exit vpn gns pt | 11 | LINUX_DIR = dns exit vpn pt |
12 | endif | 12 | endif |
13 | if MINGW | 13 | if MINGW |
14 | MINGW_DIR = dns gns vpn exit | 14 | MINGW_DIR = dns vpn exit |
15 | endif | 15 | endif |
16 | 16 | ||
17 | if HAVE_MYSQL | 17 | if HAVE_MYSQL |
diff --git a/src/chat/chat.c b/src/chat/chat.c index cdcf282e2..19f5d0a96 100644 --- a/src/chat/chat.c +++ b/src/chat/chat.c | |||
@@ -264,7 +264,7 @@ process_result (struct GNUNET_CHAT_Room *room, | |||
264 | GNUNET_CRYPTO_hash (&join_msg->public_key, | 264 | GNUNET_CRYPTO_hash (&join_msg->public_key, |
265 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 265 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), |
266 | &pos->id); | 266 | &pos->id); |
267 | GNUNET_PSEUDONYM_add (room->cfg, &pos->id, meta); | 267 | GNUNET_FS_pseudonym_add (room->cfg, &pos->id, meta); |
268 | pos->next = room->members; | 268 | pos->next = room->members; |
269 | room->members = pos; | 269 | room->members = pos; |
270 | if (GNUNET_NO == room->is_joined) | 270 | if (GNUNET_NO == room->is_joined) |
@@ -665,7 +665,7 @@ GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
665 | GNUNET_CRYPTO_hash (&pub_key, | 665 | GNUNET_CRYPTO_hash (&pub_key, |
666 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 666 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), |
667 | me); | 667 | me); |
668 | GNUNET_PSEUDONYM_add (cfg, me, member_info); | 668 | GNUNET_FS_pseudonym_add (cfg, me, member_info); |
669 | client = GNUNET_CLIENT_connect ("chat", cfg); | 669 | client = GNUNET_CLIENT_connect ("chat", cfg); |
670 | if (NULL == client) | 670 | if (NULL == client) |
671 | { | 671 | { |
diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index 8e6ba9bc2..f2c7f109a 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c | |||
@@ -125,14 +125,14 @@ receive_cb (void *cls, struct GNUNET_CHAT_Room *room, | |||
125 | nick = GNUNET_strdup (_("anonymous")); | 125 | nick = GNUNET_strdup (_("anonymous")); |
126 | else | 126 | else |
127 | { | 127 | { |
128 | if (GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 128 | if (GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
129 | sender, NULL, NULL, &non_unique_nick, &nick_is_a_dup) | 129 | sender, NULL, NULL, &non_unique_nick, &nick_is_a_dup) |
130 | || (nick_is_a_dup == GNUNET_YES)) | 130 | || (nick_is_a_dup == GNUNET_YES)) |
131 | { | 131 | { |
132 | GNUNET_free (non_unique_nick); | 132 | GNUNET_free (non_unique_nick); |
133 | non_unique_nick = GNUNET_strdup (_("anonymous")); | 133 | non_unique_nick = GNUNET_strdup (_("anonymous")); |
134 | } | 134 | } |
135 | nick = GNUNET_PSEUDONYM_name_uniquify (cfg, sender, non_unique_nick, NULL); | 135 | nick = GNUNET_FS_pseudonym_name_uniquify (cfg, sender, non_unique_nick, NULL); |
136 | GNUNET_free (non_unique_nick); | 136 | GNUNET_free (non_unique_nick); |
137 | } | 137 | } |
138 | 138 | ||
@@ -204,14 +204,14 @@ confirmation_cb (void *cls, struct GNUNET_CHAT_Room *room, | |||
204 | char *unique_nick; | 204 | char *unique_nick; |
205 | int nick_is_a_dup; | 205 | int nick_is_a_dup; |
206 | 206 | ||
207 | if (GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 207 | if (GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
208 | receiver, NULL, NULL, &nick, &nick_is_a_dup) | 208 | receiver, NULL, NULL, &nick, &nick_is_a_dup) |
209 | || (nick_is_a_dup == GNUNET_YES)) | 209 | || (nick_is_a_dup == GNUNET_YES)) |
210 | { | 210 | { |
211 | GNUNET_free (nick); | 211 | GNUNET_free (nick); |
212 | nick = GNUNET_strdup (_("anonymous")); | 212 | nick = GNUNET_strdup (_("anonymous")); |
213 | } | 213 | } |
214 | unique_nick = GNUNET_PSEUDONYM_name_uniquify (cfg, receiver, nick, NULL); | 214 | unique_nick = GNUNET_FS_pseudonym_name_uniquify (cfg, receiver, nick, NULL); |
215 | GNUNET_free (nick); | 215 | GNUNET_free (nick); |
216 | FPRINTF (stdout, _("'%s' acknowledged message #%d\n"), unique_nick, orig_seq_number); | 216 | FPRINTF (stdout, _("'%s' acknowledged message #%d\n"), unique_nick, orig_seq_number); |
217 | GNUNET_free (unique_nick); | 217 | GNUNET_free (unique_nick); |
@@ -244,14 +244,14 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, | |||
244 | GNUNET_CRYPTO_hash (member_id, | 244 | GNUNET_CRYPTO_hash (member_id, |
245 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 245 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), |
246 | &id); | 246 | &id); |
247 | if (GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 247 | if (GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
248 | &id, NULL, NULL, &non_unique_nick, &nick_is_a_dup) | 248 | &id, NULL, NULL, &non_unique_nick, &nick_is_a_dup) |
249 | || (nick_is_a_dup == GNUNET_YES)) | 249 | || (nick_is_a_dup == GNUNET_YES)) |
250 | { | 250 | { |
251 | GNUNET_free (non_unique_nick); | 251 | GNUNET_free (non_unique_nick); |
252 | non_unique_nick = GNUNET_strdup (_("anonymous")); | 252 | non_unique_nick = GNUNET_strdup (_("anonymous")); |
253 | } | 253 | } |
254 | nick = GNUNET_PSEUDONYM_name_uniquify (cfg, &id, non_unique_nick, NULL); | 254 | nick = GNUNET_FS_pseudonym_name_uniquify (cfg, &id, non_unique_nick, NULL); |
255 | GNUNET_free (non_unique_nick); | 255 | GNUNET_free (non_unique_nick); |
256 | 256 | ||
257 | FPRINTF (stdout, | 257 | FPRINTF (stdout, |
@@ -320,7 +320,7 @@ do_join (const char *arg, const void *xtra) | |||
320 | FPRINTF (stdout, "%s", _("Could not change username\n")); | 320 | FPRINTF (stdout, "%s", _("Could not change username\n")); |
321 | return GNUNET_SYSERR; | 321 | return GNUNET_SYSERR; |
322 | } | 322 | } |
323 | if ((GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 323 | if ((GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
324 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || | 324 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || |
325 | (my_name_is_a_dup == GNUNET_YES)) | 325 | (my_name_is_a_dup == GNUNET_YES)) |
326 | { | 326 | { |
@@ -362,7 +362,7 @@ do_nick (const char *msg, const void *xtra) | |||
362 | FPRINTF (stdout, "%s", _("Could not change username\n")); | 362 | FPRINTF (stdout, "%s", _("Could not change username\n")); |
363 | return GNUNET_SYSERR; | 363 | return GNUNET_SYSERR; |
364 | } | 364 | } |
365 | if ((GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 365 | if ((GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
366 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || | 366 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || |
367 | (my_name_is_a_dup == GNUNET_YES)) | 367 | (my_name_is_a_dup == GNUNET_YES)) |
368 | { | 368 | { |
@@ -391,14 +391,14 @@ do_names (const char *msg, const void *xtra) | |||
391 | GNUNET_CRYPTO_hash (&pos->pkey, | 391 | GNUNET_CRYPTO_hash (&pos->pkey, |
392 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 392 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), |
393 | &pid); | 393 | &pid); |
394 | if (GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 394 | if (GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
395 | &pid, NULL, NULL, &name, &name_is_a_dup) | 395 | &pid, NULL, NULL, &name, &name_is_a_dup) |
396 | || (name_is_a_dup == GNUNET_YES)) | 396 | || (name_is_a_dup == GNUNET_YES)) |
397 | { | 397 | { |
398 | GNUNET_free (name); | 398 | GNUNET_free (name); |
399 | name = GNUNET_strdup (_("anonymous")); | 399 | name = GNUNET_strdup (_("anonymous")); |
400 | } | 400 | } |
401 | unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &pid, name, NULL); | 401 | unique_name = GNUNET_FS_pseudonym_name_uniquify (cfg, &pid, name, NULL); |
402 | GNUNET_free (name); | 402 | GNUNET_free (name); |
403 | FPRINTF (stdout, "`%s' ", unique_name); | 403 | FPRINTF (stdout, "`%s' ", unique_name); |
404 | GNUNET_free (unique_name); | 404 | GNUNET_free (unique_name); |
@@ -436,7 +436,7 @@ do_send_pm (const char *msg, const void *xtra) | |||
436 | user = GNUNET_strdup (msg); | 436 | user = GNUNET_strdup (msg); |
437 | strstr (user, " ")[0] = '\0'; | 437 | strstr (user, " ")[0] = '\0'; |
438 | msg += strlen (user) + 1; | 438 | msg += strlen (user) + 1; |
439 | if (GNUNET_OK != GNUNET_PSEUDONYM_name_to_id (cfg, user, &uid)) | 439 | if (GNUNET_OK != GNUNET_FS_pseudonym_name_to_id (cfg, user, &uid)) |
440 | { | 440 | { |
441 | FPRINTF (stderr, | 441 | FPRINTF (stderr, |
442 | _("Unknown user `%s'. Make sure you specify its numeric suffix, if any.\n"), | 442 | _("Unknown user `%s'. Make sure you specify its numeric suffix, if any.\n"), |
@@ -691,7 +691,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
691 | ret = -1; | 691 | ret = -1; |
692 | return; | 692 | return; |
693 | } | 693 | } |
694 | if ((GNUNET_OK != GNUNET_PSEUDONYM_get_info (cfg, | 694 | if ((GNUNET_OK != GNUNET_FS_pseudonym_get_info (cfg, |
695 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || | 695 | &me, NULL, NULL, &my_name, &my_name_is_a_dup)) || |
696 | (my_name_is_a_dup == GNUNET_YES)) | 696 | (my_name_is_a_dup == GNUNET_YES)) |
697 | { | 697 | { |
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index b2744237e..8d9c0b298 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -206,7 +206,7 @@ struct GNUNET_FS_Uri | |||
206 | /** | 206 | /** |
207 | * Identifier of the namespace. | 207 | * Identifier of the namespace. |
208 | */ | 208 | */ |
209 | struct GNUNET_PseudonymIdentifier ns; | 209 | struct GNUNET_FS_PseudonymIdentifier ns; |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * Human-readable identifier chosen for this | 212 | * Human-readable identifier chosen for this |
@@ -2008,7 +2008,7 @@ struct GNUNET_FS_Namespace | |||
2008 | /** | 2008 | /** |
2009 | * Private key for the namespace. | 2009 | * Private key for the namespace. |
2010 | */ | 2010 | */ |
2011 | struct GNUNET_PseudonymHandle *key; | 2011 | struct GNUNET_FS_PseudonymHandle *key; |
2012 | 2012 | ||
2013 | /** | 2013 | /** |
2014 | * Hash map mapping identifiers of update nodes | 2014 | * Hash map mapping identifiers of update nodes |
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index 87ddb667f..e129d70f8 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c | |||
@@ -245,7 +245,7 @@ GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name) | |||
245 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Namespace)); | 245 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Namespace)); |
246 | ret->h = h; | 246 | ret->h = h; |
247 | ret->rc = 1; | 247 | ret->rc = 1; |
248 | ret->key = GNUNET_PSEUDONYM_create (fn); | 248 | ret->key = GNUNET_FS_pseudonym_create (fn); |
249 | if (NULL == ret->key) | 249 | if (NULL == ret->key) |
250 | { | 250 | { |
251 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 251 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -289,7 +289,7 @@ GNUNET_FS_namespace_open_existing (struct GNUNET_FS_Handle *h, const char *name) | |||
289 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Namespace)); | 289 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Namespace)); |
290 | ret->h = h; | 290 | ret->h = h; |
291 | ret->rc = 1; | 291 | ret->rc = 1; |
292 | ret->key = GNUNET_PSEUDONYM_create_from_existing_file (fn); | 292 | ret->key = GNUNET_FS_pseudonym_create_from_existing_file (fn); |
293 | if (NULL == ret->key) | 293 | if (NULL == ret->key) |
294 | { | 294 | { |
295 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 295 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -384,7 +384,7 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *ns, int freeze) | |||
384 | } | 384 | } |
385 | if (0 != ns->rc) | 385 | if (0 != ns->rc) |
386 | return GNUNET_OK; | 386 | return GNUNET_OK; |
387 | GNUNET_PSEUDONYM_destroy (ns->key); | 387 | GNUNET_FS_pseudonym_destroy (ns->key); |
388 | GNUNET_free (ns->filename); | 388 | GNUNET_free (ns->filename); |
389 | GNUNET_free (ns->name); | 389 | GNUNET_free (ns->name); |
390 | for (i = 0; i < ns->update_node_count; i++) | 390 | for (i = 0; i < ns->update_node_count; i++) |
@@ -433,11 +433,11 @@ struct ProcessNamespaceContext | |||
433 | */ | 433 | */ |
434 | int | 434 | int |
435 | GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, | 435 | GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, |
436 | struct GNUNET_PseudonymIdentifier *id) | 436 | struct GNUNET_FS_PseudonymIdentifier *id) |
437 | { | 437 | { |
438 | if ((NULL == ns) || (NULL == id)) | 438 | if ((NULL == ns) || (NULL == id)) |
439 | return GNUNET_SYSERR; | 439 | return GNUNET_SYSERR; |
440 | GNUNET_PSEUDONYM_get_identifier (ns->key, id); | 440 | GNUNET_FS_pseudonym_get_identifier (ns->key, id); |
441 | return GNUNET_OK; | 441 | return GNUNET_OK; |
442 | } | 442 | } |
443 | 443 | ||
@@ -455,12 +455,12 @@ static int | |||
455 | process_namespace (void *cls, const char *filename) | 455 | process_namespace (void *cls, const char *filename) |
456 | { | 456 | { |
457 | struct ProcessNamespaceContext *pnc = cls; | 457 | struct ProcessNamespaceContext *pnc = cls; |
458 | struct GNUNET_PseudonymHandle *ph; | 458 | struct GNUNET_FS_PseudonymHandle *ph; |
459 | struct GNUNET_PseudonymIdentifier id; | 459 | struct GNUNET_FS_PseudonymIdentifier id; |
460 | const char *name; | 460 | const char *name; |
461 | const char *t; | 461 | const char *t; |
462 | 462 | ||
463 | if (NULL == (ph = GNUNET_PSEUDONYM_create (filename))) | 463 | if (NULL == (ph = GNUNET_FS_pseudonym_create (filename))) |
464 | { | 464 | { |
465 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 465 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
466 | _ | 466 | _ |
@@ -470,8 +470,8 @@ process_namespace (void *cls, const char *filename) | |||
470 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename); | 470 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename); |
471 | return GNUNET_OK; | 471 | return GNUNET_OK; |
472 | } | 472 | } |
473 | GNUNET_PSEUDONYM_get_identifier (ph, &id); | 473 | GNUNET_FS_pseudonym_get_identifier (ph, &id); |
474 | GNUNET_PSEUDONYM_destroy (ph); | 474 | GNUNET_FS_pseudonym_destroy (ph); |
475 | name = filename; | 475 | name = filename; |
476 | while (NULL != (t = strstr (name, DIR_SEPARATOR_STR))) | 476 | while (NULL != (t = strstr (name, DIR_SEPARATOR_STR))) |
477 | name = t + 1; | 477 | name = t + 1; |
@@ -714,14 +714,14 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
714 | &sk, &iv, | 714 | &sk, &iv, |
715 | &ub_enc[1]); | 715 | &ub_enc[1]); |
716 | ub_enc->purpose.size = htonl (nidlen + slen + mdsize + sizeof (struct UBlock) | 716 | ub_enc->purpose.size = htonl (nidlen + slen + mdsize + sizeof (struct UBlock) |
717 | - sizeof (struct GNUNET_PseudonymSignature)); | 717 | - sizeof (struct GNUNET_FS_PseudonymSignature)); |
718 | ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); | 718 | ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); |
719 | GNUNET_PSEUDONYM_sign (ns->key, | 719 | GNUNET_FS_pseudonym_sign (ns->key, |
720 | &ub_enc->purpose, | 720 | &ub_enc->purpose, |
721 | NULL, | 721 | NULL, |
722 | &signing_key, | 722 | &signing_key, |
723 | &ub_enc->signature); | 723 | &ub_enc->signature); |
724 | GNUNET_PSEUDONYM_derive_verification_key (&sks_uri->data.sks.ns, | 724 | GNUNET_FS_pseudonym_derive_verification_key (&sks_uri->data.sks.ns, |
725 | &signing_key, | 725 | &signing_key, |
726 | &ub_enc->verification_key); | 726 | &ub_enc->verification_key); |
727 | GNUNET_CRYPTO_hash (&ub_enc->verification_key, | 727 | GNUNET_CRYPTO_hash (&ub_enc->verification_key, |
diff --git a/src/fs/fs_pseudonym.c b/src/fs/fs_pseudonym.c index 5e9c9816e..eb8c43ddf 100644 --- a/src/fs/fs_pseudonym.c +++ b/src/fs/fs_pseudonym.c | |||
@@ -67,22 +67,22 @@ | |||
67 | /** | 67 | /** |
68 | * Registered callbacks for discovery of pseudonyms. | 68 | * Registered callbacks for discovery of pseudonyms. |
69 | */ | 69 | */ |
70 | struct GNUNET_PSEUDONYM_DiscoveryHandle | 70 | struct GNUNET_FS_pseudonym_DiscoveryHandle |
71 | { | 71 | { |
72 | /** | 72 | /** |
73 | * This is a doubly linked list. | 73 | * This is a doubly linked list. |
74 | */ | 74 | */ |
75 | struct GNUNET_PSEUDONYM_DiscoveryHandle *next; | 75 | struct GNUNET_FS_pseudonym_DiscoveryHandle *next; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * This is a doubly linked list. | 78 | * This is a doubly linked list. |
79 | */ | 79 | */ |
80 | struct GNUNET_PSEUDONYM_DiscoveryHandle *prev; | 80 | struct GNUNET_FS_pseudonym_DiscoveryHandle *prev; |
81 | 81 | ||
82 | /** | 82 | /** |
83 | * Function to call each time a pseudonym is discovered. | 83 | * Function to call each time a pseudonym is discovered. |
84 | */ | 84 | */ |
85 | GNUNET_PSEUDONYM_Iterator callback; | 85 | GNUNET_FS_PseudonymIterator callback; |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * Closure for callback. | 88 | * Closure for callback. |
@@ -95,13 +95,13 @@ struct GNUNET_PSEUDONYM_DiscoveryHandle | |||
95 | * Head of the linked list of functions to call when | 95 | * Head of the linked list of functions to call when |
96 | * new pseudonyms are added. | 96 | * new pseudonyms are added. |
97 | */ | 97 | */ |
98 | static struct GNUNET_PSEUDONYM_DiscoveryHandle *disco_head; | 98 | static struct GNUNET_FS_pseudonym_DiscoveryHandle *disco_head; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Tail of the linked list of functions to call when | 101 | * Tail of the linked list of functions to call when |
102 | * new pseudonyms are added. | 102 | * new pseudonyms are added. |
103 | */ | 103 | */ |
104 | static struct GNUNET_PSEUDONYM_DiscoveryHandle *disco_tail; | 104 | static struct GNUNET_FS_pseudonym_DiscoveryHandle *disco_tail; |
105 | 105 | ||
106 | 106 | ||
107 | /** | 107 | /** |
@@ -112,10 +112,10 @@ static struct GNUNET_PSEUDONYM_DiscoveryHandle *disco_tail; | |||
112 | * @param rating rating of pseudonym | 112 | * @param rating rating of pseudonym |
113 | */ | 113 | */ |
114 | static void | 114 | static void |
115 | internal_notify (const struct GNUNET_PseudonymIdentifier *pseudonym, | 115 | internal_notify (const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
116 | const struct GNUNET_CONTAINER_MetaData *md, int rating) | 116 | const struct GNUNET_CONTAINER_MetaData *md, int rating) |
117 | { | 117 | { |
118 | struct GNUNET_PSEUDONYM_DiscoveryHandle *pos; | 118 | struct GNUNET_FS_pseudonym_DiscoveryHandle *pos; |
119 | 119 | ||
120 | for (pos = disco_head; NULL != pos; pos = pos->next) | 120 | for (pos = disco_head; NULL != pos; pos = pos->next) |
121 | pos->callback (pos->callback_cls, pseudonym, NULL, NULL, md, rating); | 121 | pos->callback (pos->callback_cls, pseudonym, NULL, NULL, md, rating); |
@@ -133,19 +133,19 @@ internal_notify (const struct GNUNET_PseudonymIdentifier *pseudonym, | |||
133 | * @param iterator_cls point to a closure | 133 | * @param iterator_cls point to a closure |
134 | * @return registration handle | 134 | * @return registration handle |
135 | */ | 135 | */ |
136 | struct GNUNET_PSEUDONYM_DiscoveryHandle * | 136 | struct GNUNET_FS_pseudonym_DiscoveryHandle * |
137 | GNUNET_PSEUDONYM_discovery_callback_register (const struct | 137 | GNUNET_FS_pseudonym_discovery_callback_register (const struct |
138 | GNUNET_CONFIGURATION_Handle *cfg, | 138 | GNUNET_CONFIGURATION_Handle *cfg, |
139 | GNUNET_PSEUDONYM_Iterator iterator, | 139 | GNUNET_FS_PseudonymIterator iterator, |
140 | void *iterator_cls) | 140 | void *iterator_cls) |
141 | { | 141 | { |
142 | struct GNUNET_PSEUDONYM_DiscoveryHandle *dh; | 142 | struct GNUNET_FS_pseudonym_DiscoveryHandle *dh; |
143 | 143 | ||
144 | dh = GNUNET_malloc (sizeof (struct GNUNET_PSEUDONYM_DiscoveryHandle)); | 144 | dh = GNUNET_malloc (sizeof (struct GNUNET_FS_pseudonym_DiscoveryHandle)); |
145 | dh->callback = iterator; | 145 | dh->callback = iterator; |
146 | dh->callback_cls = iterator_cls; | 146 | dh->callback_cls = iterator_cls; |
147 | GNUNET_CONTAINER_DLL_insert (disco_head, disco_tail, dh); | 147 | GNUNET_CONTAINER_DLL_insert (disco_head, disco_tail, dh); |
148 | GNUNET_PSEUDONYM_list_all (cfg, iterator, iterator_cls); | 148 | GNUNET_FS_pseudonym_list_all (cfg, iterator, iterator_cls); |
149 | return dh; | 149 | return dh; |
150 | } | 150 | } |
151 | 151 | ||
@@ -156,7 +156,7 @@ GNUNET_PSEUDONYM_discovery_callback_register (const struct | |||
156 | * @param dh registration to unregister | 156 | * @param dh registration to unregister |
157 | */ | 157 | */ |
158 | void | 158 | void |
159 | GNUNET_PSEUDONYM_discovery_callback_unregister (struct GNUNET_PSEUDONYM_DiscoveryHandle *dh) | 159 | GNUNET_FS_pseudonym_discovery_callback_unregister (struct GNUNET_FS_pseudonym_DiscoveryHandle *dh) |
160 | { | 160 | { |
161 | GNUNET_CONTAINER_DLL_remove (disco_head, disco_tail, dh); | 161 | GNUNET_CONTAINER_DLL_remove (disco_head, disco_tail, dh); |
162 | GNUNET_free (dh); | 162 | GNUNET_free (dh); |
@@ -175,7 +175,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (struct GNUNET_PSEUDONYM_Discover | |||
175 | static char * | 175 | static char * |
176 | get_data_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, | 176 | get_data_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, |
177 | const char *prefix, | 177 | const char *prefix, |
178 | const struct GNUNET_PseudonymIdentifier *pseudonym) | 178 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
179 | { | 179 | { |
180 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 180 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
181 | struct GNUNET_HashCode psid; | 181 | struct GNUNET_HashCode psid; |
@@ -183,7 +183,7 @@ get_data_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
183 | if (NULL != pseudonym) | 183 | if (NULL != pseudonym) |
184 | { | 184 | { |
185 | GNUNET_CRYPTO_hash (pseudonym, | 185 | GNUNET_CRYPTO_hash (pseudonym, |
186 | sizeof (struct GNUNET_PseudonymIdentifier), | 186 | sizeof (struct GNUNET_FS_PseudonymIdentifier), |
187 | &psid); | 187 | &psid); |
188 | GNUNET_CRYPTO_hash_to_enc (&psid, &enc); | 188 | GNUNET_CRYPTO_hash_to_enc (&psid, &enc); |
189 | } | 189 | } |
@@ -237,8 +237,8 @@ get_data_filename_hash (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
237 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 237 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
238 | */ | 238 | */ |
239 | int | 239 | int |
240 | GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | 240 | GNUNET_FS_pseudonym_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, |
241 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 241 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
242 | const char *name, | 242 | const char *name, |
243 | const struct GNUNET_CONTAINER_MetaData *md, | 243 | const struct GNUNET_CONTAINER_MetaData *md, |
244 | int32_t rank) | 244 | int32_t rank) |
@@ -253,7 +253,7 @@ GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
253 | return GNUNET_SYSERR; | 253 | return GNUNET_SYSERR; |
254 | } | 254 | } |
255 | if ((GNUNET_OK != GNUNET_BIO_write (fileW, pseudonym, | 255 | if ((GNUNET_OK != GNUNET_BIO_write (fileW, pseudonym, |
256 | sizeof (struct GNUNET_PseudonymIdentifier))) || | 256 | sizeof (struct GNUNET_FS_PseudonymIdentifier))) || |
257 | (GNUNET_OK != GNUNET_BIO_write_int32 (fileW, rank)) || | 257 | (GNUNET_OK != GNUNET_BIO_write_int32 (fileW, rank)) || |
258 | (GNUNET_OK != GNUNET_BIO_write_string (fileW, name)) || | 258 | (GNUNET_OK != GNUNET_BIO_write_string (fileW, name)) || |
259 | (GNUNET_OK != GNUNET_BIO_write_meta_data (fileW, md))) | 259 | (GNUNET_OK != GNUNET_BIO_write_meta_data (fileW, md))) |
@@ -272,7 +272,7 @@ GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
272 | GNUNET_free (fn); | 272 | GNUNET_free (fn); |
273 | /* create entry for pseudonym name in names */ | 273 | /* create entry for pseudonym name in names */ |
274 | if (NULL != name) | 274 | if (NULL != name) |
275 | GNUNET_free_non_null (GNUNET_PSEUDONYM_name_uniquify (cfg, pseudonym, | 275 | GNUNET_free_non_null (GNUNET_FS_pseudonym_name_uniquify (cfg, pseudonym, |
276 | name, NULL)); | 276 | name, NULL)); |
277 | return GNUNET_OK; | 277 | return GNUNET_OK; |
278 | } | 278 | } |
@@ -290,12 +290,12 @@ GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
290 | */ | 290 | */ |
291 | static int | 291 | static int |
292 | read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | 292 | read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, |
293 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 293 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
294 | struct GNUNET_CONTAINER_MetaData **meta, | 294 | struct GNUNET_CONTAINER_MetaData **meta, |
295 | int32_t *rank, | 295 | int32_t *rank, |
296 | char **ns_name) | 296 | char **ns_name) |
297 | { | 297 | { |
298 | struct GNUNET_PseudonymIdentifier pd; | 298 | struct GNUNET_FS_PseudonymIdentifier pd; |
299 | char *fn; | 299 | char *fn; |
300 | char *emsg; | 300 | char *emsg; |
301 | struct GNUNET_BIO_ReadHandle *fileR; | 301 | struct GNUNET_BIO_ReadHandle *fileR; |
@@ -351,7 +351,7 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
351 | 351 | ||
352 | /** | 352 | /** |
353 | * Return unique variant of the namespace name. Use it after | 353 | * Return unique variant of the namespace name. Use it after |
354 | * GNUNET_PSEUDONYM_get_info() to make sure that name is unique. | 354 | * GNUNET_FS_pseudonym_get_info() to make sure that name is unique. |
355 | * | 355 | * |
356 | * @param cfg configuration | 356 | * @param cfg configuration |
357 | * @param pseudonym public key of the pseudonym | 357 | * @param pseudonym public key of the pseudonym |
@@ -361,13 +361,13 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
361 | * Free the name with GNUNET_free(). | 361 | * Free the name with GNUNET_free(). |
362 | */ | 362 | */ |
363 | char * | 363 | char * |
364 | GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | 364 | GNUNET_FS_pseudonym_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, |
365 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 365 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
366 | const char *name, | 366 | const char *name, |
367 | unsigned int *suffix) | 367 | unsigned int *suffix) |
368 | { | 368 | { |
369 | struct GNUNET_HashCode nh; | 369 | struct GNUNET_HashCode nh; |
370 | struct GNUNET_PseudonymIdentifier pi; | 370 | struct GNUNET_FS_PseudonymIdentifier pi; |
371 | uint64_t len; | 371 | uint64_t len; |
372 | char *fn; | 372 | char *fn; |
373 | struct GNUNET_DISK_FileHandle *fh; | 373 | struct GNUNET_DISK_FileHandle *fh; |
@@ -388,11 +388,11 @@ GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
388 | GNUNET_DISK_PERM_USER_WRITE); | 388 | GNUNET_DISK_PERM_USER_WRITE); |
389 | i = 0; | 389 | i = 0; |
390 | idx = -1; | 390 | idx = -1; |
391 | while ((len >= sizeof (struct GNUNET_PseudonymIdentifier)) && | 391 | while ((len >= sizeof (struct GNUNET_FS_PseudonymIdentifier)) && |
392 | (sizeof (struct GNUNET_PseudonymIdentifier) == | 392 | (sizeof (struct GNUNET_FS_PseudonymIdentifier) == |
393 | GNUNET_DISK_file_read (fh, &pi, sizeof (struct GNUNET_PseudonymIdentifier)))) | 393 | GNUNET_DISK_file_read (fh, &pi, sizeof (struct GNUNET_FS_PseudonymIdentifier)))) |
394 | { | 394 | { |
395 | if (0 == memcmp (&pi, pseudonym, sizeof (struct GNUNET_PseudonymIdentifier))) | 395 | if (0 == memcmp (&pi, pseudonym, sizeof (struct GNUNET_FS_PseudonymIdentifier))) |
396 | { | 396 | { |
397 | idx = i; | 397 | idx = i; |
398 | break; | 398 | break; |
@@ -403,8 +403,8 @@ GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
403 | if (-1 == idx) | 403 | if (-1 == idx) |
404 | { | 404 | { |
405 | idx = i; | 405 | idx = i; |
406 | if (sizeof (struct GNUNET_PseudonymIdentifier) != | 406 | if (sizeof (struct GNUNET_FS_PseudonymIdentifier) != |
407 | GNUNET_DISK_file_write (fh, pseudonym, sizeof (struct GNUNET_PseudonymIdentifier))) | 407 | GNUNET_DISK_file_write (fh, pseudonym, sizeof (struct GNUNET_FS_PseudonymIdentifier))) |
408 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "write", fn); | 408 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "write", fn); |
409 | } | 409 | } |
410 | GNUNET_DISK_file_close (fh); | 410 | GNUNET_DISK_file_close (fh); |
@@ -436,8 +436,8 @@ GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
436 | * empty metadata container, rank -1 and a "no-name" name). | 436 | * empty metadata container, rank -1 and a "no-name" name). |
437 | */ | 437 | */ |
438 | int | 438 | int |
439 | GNUNET_PSEUDONYM_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | 439 | GNUNET_FS_pseudonym_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, |
440 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 440 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
441 | struct GNUNET_CONTAINER_MetaData **ret_meta, | 441 | struct GNUNET_CONTAINER_MetaData **ret_meta, |
442 | int32_t *ret_rank, | 442 | int32_t *ret_rank, |
443 | char **ret_name, | 443 | char **ret_name, |
@@ -514,9 +514,9 @@ GNUNET_PSEUDONYM_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
514 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 514 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
515 | */ | 515 | */ |
516 | int | 516 | int |
517 | GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | 517 | GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, |
518 | const char *ns_uname, | 518 | const char *ns_uname, |
519 | struct GNUNET_PseudonymIdentifier *pseudonym) | 519 | struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
520 | { | 520 | { |
521 | size_t slen; | 521 | size_t slen; |
522 | uint64_t len; | 522 | uint64_t len; |
@@ -541,7 +541,7 @@ GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
541 | 541 | ||
542 | if ((GNUNET_OK != GNUNET_DISK_file_test (fn) || | 542 | if ((GNUNET_OK != GNUNET_DISK_file_test (fn) || |
543 | (GNUNET_OK != GNUNET_DISK_file_size (fn, &len, GNUNET_YES, GNUNET_YES))) || | 543 | (GNUNET_OK != GNUNET_DISK_file_size (fn, &len, GNUNET_YES, GNUNET_YES))) || |
544 | ((idx + 1) * sizeof (struct GNUNET_PseudonymIdentifier) > len)) | 544 | ((idx + 1) * sizeof (struct GNUNET_FS_PseudonymIdentifier) > len)) |
545 | { | 545 | { |
546 | GNUNET_free (fn); | 546 | GNUNET_free (fn); |
547 | return GNUNET_SYSERR; | 547 | return GNUNET_SYSERR; |
@@ -553,14 +553,14 @@ GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
553 | GNUNET_DISK_PERM_USER_WRITE); | 553 | GNUNET_DISK_PERM_USER_WRITE); |
554 | GNUNET_free (fn); | 554 | GNUNET_free (fn); |
555 | if (GNUNET_SYSERR == | 555 | if (GNUNET_SYSERR == |
556 | GNUNET_DISK_file_seek (fh, idx * sizeof (struct GNUNET_PseudonymIdentifier), | 556 | GNUNET_DISK_file_seek (fh, idx * sizeof (struct GNUNET_FS_PseudonymIdentifier), |
557 | GNUNET_DISK_SEEK_SET)) | 557 | GNUNET_DISK_SEEK_SET)) |
558 | { | 558 | { |
559 | GNUNET_DISK_file_close (fh); | 559 | GNUNET_DISK_file_close (fh); |
560 | return GNUNET_SYSERR; | 560 | return GNUNET_SYSERR; |
561 | } | 561 | } |
562 | if (sizeof (struct GNUNET_PseudonymIdentifier) != | 562 | if (sizeof (struct GNUNET_FS_PseudonymIdentifier) != |
563 | GNUNET_DISK_file_read (fh, pseudonym, sizeof (struct GNUNET_PseudonymIdentifier))) | 563 | GNUNET_DISK_file_read (fh, pseudonym, sizeof (struct GNUNET_FS_PseudonymIdentifier))) |
564 | { | 564 | { |
565 | GNUNET_DISK_file_close (fh); | 565 | GNUNET_DISK_file_close (fh); |
566 | return GNUNET_SYSERR; | 566 | return GNUNET_SYSERR; |
@@ -580,7 +580,7 @@ struct ListPseudonymClosure | |||
580 | /** | 580 | /** |
581 | * iterator over pseudonym | 581 | * iterator over pseudonym |
582 | */ | 582 | */ |
583 | GNUNET_PSEUDONYM_Iterator iterator; | 583 | GNUNET_FS_PseudonymIterator iterator; |
584 | 584 | ||
585 | /** | 585 | /** |
586 | * Closure for iterator. | 586 | * Closure for iterator. |
@@ -605,7 +605,7 @@ static int | |||
605 | list_pseudonym_helper (void *cls, const char *fullname) | 605 | list_pseudonym_helper (void *cls, const char *fullname) |
606 | { | 606 | { |
607 | struct ListPseudonymClosure *lpc = cls; | 607 | struct ListPseudonymClosure *lpc = cls; |
608 | struct GNUNET_PseudonymIdentifier pd; | 608 | struct GNUNET_FS_PseudonymIdentifier pd; |
609 | char *emsg; | 609 | char *emsg; |
610 | struct GNUNET_BIO_ReadHandle *fileR; | 610 | struct GNUNET_BIO_ReadHandle *fileR; |
611 | int32_t rank; | 611 | int32_t rank; |
@@ -645,7 +645,7 @@ list_pseudonym_helper (void *cls, const char *fullname) | |||
645 | return GNUNET_SYSERR; | 645 | return GNUNET_SYSERR; |
646 | } | 646 | } |
647 | ret = GNUNET_OK; | 647 | ret = GNUNET_OK; |
648 | name_unique = GNUNET_PSEUDONYM_name_uniquify (lpc->cfg, &pd, ns_name, NULL); | 648 | name_unique = GNUNET_FS_pseudonym_name_uniquify (lpc->cfg, &pd, ns_name, NULL); |
649 | if (NULL != lpc->iterator) | 649 | if (NULL != lpc->iterator) |
650 | ret = lpc->iterator (lpc->iterator_cls, &pd, ns_name, name_unique, meta, rank); | 650 | ret = lpc->iterator (lpc->iterator_cls, &pd, ns_name, name_unique, meta, rank); |
651 | GNUNET_free (ns_name); | 651 | GNUNET_free (ns_name); |
@@ -664,8 +664,8 @@ list_pseudonym_helper (void *cls, const char *fullname) | |||
664 | * @return number of pseudonyms found | 664 | * @return number of pseudonyms found |
665 | */ | 665 | */ |
666 | int | 666 | int |
667 | GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, | 667 | GNUNET_FS_pseudonym_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
668 | GNUNET_PSEUDONYM_Iterator iterator, | 668 | GNUNET_FS_PseudonymIterator iterator, |
669 | void *iterator_cls) | 669 | void *iterator_cls) |
670 | { | 670 | { |
671 | struct ListPseudonymClosure cls; | 671 | struct ListPseudonymClosure cls; |
@@ -693,8 +693,8 @@ GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
693 | * @return new rating of the pseudonym | 693 | * @return new rating of the pseudonym |
694 | */ | 694 | */ |
695 | int | 695 | int |
696 | GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | 696 | GNUNET_FS_pseudonym_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, |
697 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 697 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
698 | int32_t delta) | 698 | int32_t delta) |
699 | { | 699 | { |
700 | struct GNUNET_CONTAINER_MetaData *meta; | 700 | struct GNUNET_CONTAINER_MetaData *meta; |
@@ -710,7 +710,7 @@ GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
710 | meta = GNUNET_CONTAINER_meta_data_create (); | 710 | meta = GNUNET_CONTAINER_meta_data_create (); |
711 | } | 711 | } |
712 | rank += delta; | 712 | rank += delta; |
713 | GNUNET_PSEUDONYM_set_info (cfg, pseudonym, name, meta, rank); | 713 | GNUNET_FS_pseudonym_set_info (cfg, pseudonym, name, meta, rank); |
714 | GNUNET_CONTAINER_meta_data_destroy (meta); | 714 | GNUNET_CONTAINER_meta_data_destroy (meta); |
715 | GNUNET_free_non_null (name); | 715 | GNUNET_free_non_null (name); |
716 | return rank; | 716 | return rank; |
@@ -728,8 +728,8 @@ GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
728 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 728 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
729 | */ | 729 | */ |
730 | int | 730 | int |
731 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | 731 | GNUNET_FS_pseudonym_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |
732 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 732 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
733 | const struct GNUNET_CONTAINER_MetaData *meta) | 733 | const struct GNUNET_CONTAINER_MetaData *meta) |
734 | { | 734 | { |
735 | char *name; | 735 | char *name; |
@@ -747,13 +747,13 @@ GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
747 | (GNUNET_OK == read_info (cfg, pseudonym, &old, &rank, &name))) | 747 | (GNUNET_OK == read_info (cfg, pseudonym, &old, &rank, &name))) |
748 | { | 748 | { |
749 | GNUNET_CONTAINER_meta_data_merge (old, meta); | 749 | GNUNET_CONTAINER_meta_data_merge (old, meta); |
750 | ret = GNUNET_PSEUDONYM_set_info (cfg, pseudonym, name, old, rank); | 750 | ret = GNUNET_FS_pseudonym_set_info (cfg, pseudonym, name, old, rank); |
751 | GNUNET_CONTAINER_meta_data_destroy (old); | 751 | GNUNET_CONTAINER_meta_data_destroy (old); |
752 | GNUNET_free_non_null (name); | 752 | GNUNET_free_non_null (name); |
753 | } | 753 | } |
754 | else | 754 | else |
755 | { | 755 | { |
756 | ret = GNUNET_PSEUDONYM_set_info (cfg, pseudonym, NULL, meta, rank); | 756 | ret = GNUNET_FS_pseudonym_set_info (cfg, pseudonym, NULL, meta, rank); |
757 | } | 757 | } |
758 | GNUNET_free (fn); | 758 | GNUNET_free (fn); |
759 | internal_notify (pseudonym, meta, rank); | 759 | internal_notify (pseudonym, meta, rank); |
@@ -766,7 +766,7 @@ GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
766 | /** | 766 | /** |
767 | * Handle for a pseudonym (private key). | 767 | * Handle for a pseudonym (private key). |
768 | */ | 768 | */ |
769 | struct GNUNET_PseudonymHandle | 769 | struct GNUNET_FS_PseudonymHandle |
770 | { | 770 | { |
771 | /** | 771 | /** |
772 | * 256-bit 'd' secret value (mod 'n', where n is 256-bit for NIST P-256). | 772 | * 256-bit 'd' secret value (mod 'n', where n is 256-bit for NIST P-256). |
@@ -776,7 +776,7 @@ struct GNUNET_PseudonymHandle | |||
776 | /** | 776 | /** |
777 | * Public key corresponding to the private key. | 777 | * Public key corresponding to the private key. |
778 | */ | 778 | */ |
779 | struct GNUNET_PseudonymIdentifier public_key; | 779 | struct GNUNET_FS_PseudonymIdentifier public_key; |
780 | }; | 780 | }; |
781 | 781 | ||
782 | 782 | ||
@@ -862,10 +862,10 @@ key_from_sexp (gcry_mpi_t * array, gcry_sexp_t sexp, const char *topname, | |||
862 | * @param filename name of the file to use for storage, NULL for in-memory only | 862 | * @param filename name of the file to use for storage, NULL for in-memory only |
863 | * @return handle to the private key of the pseudonym | 863 | * @return handle to the private key of the pseudonym |
864 | */ | 864 | */ |
865 | struct GNUNET_PseudonymHandle * | 865 | struct GNUNET_FS_PseudonymHandle * |
866 | GNUNET_PSEUDONYM_create (const char *filename) | 866 | GNUNET_FS_pseudonym_create (const char *filename) |
867 | { | 867 | { |
868 | struct GNUNET_PseudonymHandle *ph; | 868 | struct GNUNET_FS_PseudonymHandle *ph; |
869 | ssize_t ret; | 869 | ssize_t ret; |
870 | gcry_sexp_t r_key; | 870 | gcry_sexp_t r_key; |
871 | gcry_sexp_t params; | 871 | gcry_sexp_t params; |
@@ -877,14 +877,14 @@ GNUNET_PSEUDONYM_create (const char *filename) | |||
877 | gcry_mpi_t d; | 877 | gcry_mpi_t d; |
878 | size_t size; | 878 | size_t size; |
879 | 879 | ||
880 | ph = GNUNET_malloc (sizeof (struct GNUNET_PseudonymHandle)); | 880 | ph = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymHandle)); |
881 | if ( (NULL != filename) && | 881 | if ( (NULL != filename) && |
882 | (GNUNET_YES == GNUNET_DISK_file_test (filename)) ) | 882 | (GNUNET_YES == GNUNET_DISK_file_test (filename)) ) |
883 | { | 883 | { |
884 | ret = GNUNET_DISK_fn_read (filename, ph, | 884 | ret = GNUNET_DISK_fn_read (filename, ph, |
885 | sizeof (struct GNUNET_PseudonymHandle)); | 885 | sizeof (struct GNUNET_FS_PseudonymHandle)); |
886 | /* Note: we don't do any validation here, maybe we should? */ | 886 | /* Note: we don't do any validation here, maybe we should? */ |
887 | if (sizeof (struct GNUNET_PseudonymHandle) == ret) | 887 | if (sizeof (struct GNUNET_FS_PseudonymHandle) == ret) |
888 | return ph; | 888 | return ph; |
889 | } | 889 | } |
890 | if (0 != (rc = gcry_sexp_build (¶ms, NULL, | 890 | if (0 != (rc = gcry_sexp_build (¶ms, NULL, |
@@ -962,9 +962,9 @@ GNUNET_PSEUDONYM_create (const char *filename) | |||
962 | /* write to disk */ | 962 | /* write to disk */ |
963 | if (NULL != filename) | 963 | if (NULL != filename) |
964 | { | 964 | { |
965 | ret = GNUNET_DISK_fn_write (filename, ph, sizeof (struct GNUNET_PseudonymHandle), | 965 | ret = GNUNET_DISK_fn_write (filename, ph, sizeof (struct GNUNET_FS_PseudonymHandle), |
966 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); | 966 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); |
967 | if (sizeof (struct GNUNET_PseudonymHandle) != ret) | 967 | if (sizeof (struct GNUNET_FS_PseudonymHandle) != ret) |
968 | { | 968 | { |
969 | GNUNET_free (ph); | 969 | GNUNET_free (ph); |
970 | return NULL; | 970 | return NULL; |
@@ -980,16 +980,16 @@ GNUNET_PSEUDONYM_create (const char *filename) | |||
980 | * @param filename name of the file to use for storage, NULL for in-memory only | 980 | * @param filename name of the file to use for storage, NULL for in-memory only |
981 | * @return handle to the private key of the pseudonym | 981 | * @return handle to the private key of the pseudonym |
982 | */ | 982 | */ |
983 | struct GNUNET_PseudonymHandle * | 983 | struct GNUNET_FS_PseudonymHandle * |
984 | GNUNET_PSEUDONYM_create_from_existing_file (const char *filename) | 984 | GNUNET_FS_pseudonym_create_from_existing_file (const char *filename) |
985 | { | 985 | { |
986 | struct GNUNET_PseudonymHandle *ph; | 986 | struct GNUNET_FS_PseudonymHandle *ph; |
987 | ssize_t ret; | 987 | ssize_t ret; |
988 | 988 | ||
989 | ph = GNUNET_malloc (sizeof (struct GNUNET_PseudonymHandle)); | 989 | ph = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymHandle)); |
990 | ret = GNUNET_DISK_fn_read (filename, ph, | 990 | ret = GNUNET_DISK_fn_read (filename, ph, |
991 | sizeof (struct GNUNET_PseudonymHandle)); | 991 | sizeof (struct GNUNET_FS_PseudonymHandle)); |
992 | if (sizeof (struct GNUNET_PseudonymHandle) != ret) | 992 | if (sizeof (struct GNUNET_FS_PseudonymHandle) != ret) |
993 | { | 993 | { |
994 | GNUNET_free (ph); | 994 | GNUNET_free (ph); |
995 | return NULL; | 995 | return NULL; |
@@ -1007,12 +1007,12 @@ GNUNET_PSEUDONYM_create_from_existing_file (const char *filename) | |||
1007 | * | 1007 | * |
1008 | * @return handle to the (non-secret) private key of the 'anonymous' pseudonym | 1008 | * @return handle to the (non-secret) private key of the 'anonymous' pseudonym |
1009 | */ | 1009 | */ |
1010 | struct GNUNET_PseudonymHandle * | 1010 | struct GNUNET_FS_PseudonymHandle * |
1011 | GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle () | 1011 | GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle () |
1012 | { | 1012 | { |
1013 | struct GNUNET_PseudonymHandle *ph; | 1013 | struct GNUNET_FS_PseudonymHandle *ph; |
1014 | 1014 | ||
1015 | ph = GNUNET_malloc (sizeof (struct GNUNET_PseudonymHandle)); | 1015 | ph = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymHandle)); |
1016 | /* Note if we use 'd=0' for the anonymous handle (as per#2564), | 1016 | /* Note if we use 'd=0' for the anonymous handle (as per#2564), |
1017 | then I believe the public key should be also zero, as Q=0P=0; | 1017 | then I believe the public key should be also zero, as Q=0P=0; |
1018 | so setting everything to all-zeros (as per GNUNET_malloc) | 1018 | so setting everything to all-zeros (as per GNUNET_malloc) |
@@ -1029,7 +1029,7 @@ GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle () | |||
1029 | * @param ph pseudonym handle to destroy | 1029 | * @param ph pseudonym handle to destroy |
1030 | */ | 1030 | */ |
1031 | void | 1031 | void |
1032 | GNUNET_PSEUDONYM_destroy (struct GNUNET_PseudonymHandle *ph) | 1032 | GNUNET_FS_pseudonym_destroy (struct GNUNET_FS_PseudonymHandle *ph) |
1033 | { | 1033 | { |
1034 | GNUNET_free (ph); | 1034 | GNUNET_free (ph); |
1035 | } | 1035 | } |
@@ -1043,7 +1043,7 @@ GNUNET_PSEUDONYM_destroy (struct GNUNET_PseudonymHandle *ph) | |||
1043 | * @return converted s-expression | 1043 | * @return converted s-expression |
1044 | */ | 1044 | */ |
1045 | static gcry_sexp_t | 1045 | static gcry_sexp_t |
1046 | data_to_pkcs1 (const struct GNUNET_PseudonymSignaturePurpose *purpose) | 1046 | data_to_pkcs1 (const struct GNUNET_FS_PseudonymSignaturePurpose *purpose) |
1047 | { | 1047 | { |
1048 | struct GNUNET_CRYPTO_ShortHashCode hc; | 1048 | struct GNUNET_CRYPTO_ShortHashCode hc; |
1049 | size_t bufSize; | 1049 | size_t bufSize; |
@@ -1084,11 +1084,11 @@ gcry_ctx_t xctx; | |||
1084 | * @return GNUNET_SYSERR on failure | 1084 | * @return GNUNET_SYSERR on failure |
1085 | */ | 1085 | */ |
1086 | int | 1086 | int |
1087 | GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, | 1087 | GNUNET_FS_pseudonym_sign (struct GNUNET_FS_PseudonymHandle *ph, |
1088 | const struct GNUNET_PseudonymSignaturePurpose *purpose, | 1088 | const struct GNUNET_FS_PseudonymSignaturePurpose *purpose, |
1089 | const struct GNUNET_HashCode *seed, | 1089 | const struct GNUNET_HashCode *seed, |
1090 | const struct GNUNET_HashCode *signing_key, | 1090 | const struct GNUNET_HashCode *signing_key, |
1091 | struct GNUNET_PseudonymSignature *signature) | 1091 | struct GNUNET_FS_PseudonymSignature *signature) |
1092 | { | 1092 | { |
1093 | size_t size; | 1093 | size_t size; |
1094 | size_t erroff; | 1094 | size_t erroff; |
@@ -1215,7 +1215,7 @@ GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, | |||
1215 | gcry_sexp_release (spriv); | 1215 | gcry_sexp_release (spriv); |
1216 | if (NULL != seed) | 1216 | if (NULL != seed) |
1217 | gcry_mpi_release (k); | 1217 | gcry_mpi_release (k); |
1218 | memset (signature, 0, sizeof (struct GNUNET_PseudonymSignature)); | 1218 | memset (signature, 0, sizeof (struct GNUNET_FS_PseudonymSignature)); |
1219 | return GNUNET_SYSERR; | 1219 | return GNUNET_SYSERR; |
1220 | } | 1220 | } |
1221 | if (NULL != seed) | 1221 | if (NULL != seed) |
@@ -1263,7 +1263,7 @@ GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, | |||
1263 | * @return curve context | 1263 | * @return curve context |
1264 | */ | 1264 | */ |
1265 | static gcry_ctx_t | 1265 | static gcry_ctx_t |
1266 | get_context_from_pseudonym (struct GNUNET_PseudonymIdentifier *pseudonym) | 1266 | get_context_from_pseudonym (struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
1267 | { | 1267 | { |
1268 | gcry_ctx_t ctx; | 1268 | gcry_ctx_t ctx; |
1269 | gcry_mpi_t ONE; | 1269 | gcry_mpi_t ONE; |
@@ -1317,13 +1317,13 @@ get_context_from_pseudonym (struct GNUNET_PseudonymIdentifier *pseudonym) | |||
1317 | * @param signing_key input to derive 'h' (see section 2.4 of #2564) | 1317 | * @param signing_key input to derive 'h' (see section 2.4 of #2564) |
1318 | * @param verification_key resulting public key to verify the signature | 1318 | * @param verification_key resulting public key to verify the signature |
1319 | * created from the '(d+h)' of 'pseudonym' and the 'signing_key'; | 1319 | * created from the '(d+h)' of 'pseudonym' and the 'signing_key'; |
1320 | * the value stored here can then be given to GNUNET_PSEUDONYM_verify. | 1320 | * the value stored here can then be given to GNUNET_FS_pseudonym_verify. |
1321 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1321 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1322 | */ | 1322 | */ |
1323 | int | 1323 | int |
1324 | GNUNET_PSEUDONYM_derive_verification_key (struct GNUNET_PseudonymIdentifier *pseudonym, | 1324 | GNUNET_FS_pseudonym_derive_verification_key (struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
1325 | const struct GNUNET_HashCode *signing_key, | 1325 | const struct GNUNET_HashCode *signing_key, |
1326 | struct GNUNET_PseudonymIdentifier *verification_key) | 1326 | struct GNUNET_FS_PseudonymIdentifier *verification_key) |
1327 | { | 1327 | { |
1328 | gcry_mpi_t h; | 1328 | gcry_mpi_t h; |
1329 | size_t size; | 1329 | size_t size; |
@@ -1433,9 +1433,9 @@ GNUNET_PSEUDONYM_derive_verification_key (struct GNUNET_PseudonymIdentifier *pse | |||
1433 | * GNUNET_SYSERR if the signature is invalid | 1433 | * GNUNET_SYSERR if the signature is invalid |
1434 | */ | 1434 | */ |
1435 | int | 1435 | int |
1436 | GNUNET_PSEUDONYM_verify (const struct GNUNET_PseudonymSignaturePurpose *purpose, | 1436 | GNUNET_FS_pseudonym_verify (const struct GNUNET_FS_PseudonymSignaturePurpose *purpose, |
1437 | const struct GNUNET_PseudonymSignature *signature, | 1437 | const struct GNUNET_FS_PseudonymSignature *signature, |
1438 | const struct GNUNET_PseudonymIdentifier *verification_key) | 1438 | const struct GNUNET_FS_PseudonymIdentifier *verification_key) |
1439 | { | 1439 | { |
1440 | gcry_sexp_t data; | 1440 | gcry_sexp_t data; |
1441 | gcry_sexp_t sig_sexpr; | 1441 | gcry_sexp_t sig_sexpr; |
@@ -1557,11 +1557,11 @@ exit (1); | |||
1557 | * @param pseudonym pseudonym identifier (set based on 'ph') | 1557 | * @param pseudonym pseudonym identifier (set based on 'ph') |
1558 | */ | 1558 | */ |
1559 | void | 1559 | void |
1560 | GNUNET_PSEUDONYM_get_identifier (struct GNUNET_PseudonymHandle *ph, | 1560 | GNUNET_FS_pseudonym_get_identifier (struct GNUNET_FS_PseudonymHandle *ph, |
1561 | struct GNUNET_PseudonymIdentifier *pseudonym) | 1561 | struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
1562 | { | 1562 | { |
1563 | memcpy (pseudonym, &ph->public_key, | 1563 | memcpy (pseudonym, &ph->public_key, |
1564 | sizeof (struct GNUNET_PseudonymIdentifier)); | 1564 | sizeof (struct GNUNET_FS_PseudonymIdentifier)); |
1565 | } | 1565 | } |
1566 | 1566 | ||
1567 | 1567 | ||
@@ -1573,8 +1573,8 @@ GNUNET_PSEUDONYM_get_identifier (struct GNUNET_PseudonymHandle *ph, | |||
1573 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 1573 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
1574 | */ | 1574 | */ |
1575 | int | 1575 | int |
1576 | GNUNET_PSEUDONYM_remove (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1576 | GNUNET_FS_pseudonym_remove (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1577 | const struct GNUNET_PseudonymIdentifier *id) | 1577 | const struct GNUNET_FS_PseudonymIdentifier *id) |
1578 | { | 1578 | { |
1579 | char *fn; | 1579 | char *fn; |
1580 | int result; | 1580 | int result; |
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c index bbbbdc1d6..93eee7d72 100644 --- a/src/fs/fs_publish_ksk.c +++ b/src/fs/fs_publish_ksk.c | |||
@@ -172,8 +172,8 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
172 | struct GNUNET_HashCode query; | 172 | struct GNUNET_HashCode query; |
173 | struct GNUNET_CRYPTO_AesSessionKey skey; | 173 | struct GNUNET_CRYPTO_AesSessionKey skey; |
174 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 174 | struct GNUNET_CRYPTO_AesInitializationVector iv; |
175 | struct GNUNET_PseudonymHandle *ph; | 175 | struct GNUNET_FS_PseudonymHandle *ph; |
176 | struct GNUNET_PseudonymIdentifier pseudonym; | 176 | struct GNUNET_FS_PseudonymIdentifier pseudonym; |
177 | 177 | ||
178 | pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK; | 178 | pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK; |
179 | if ((pkc->i == pkc->ksk_uri->data.ksk.keywordCount) || (NULL == pkc->dsh)) | 179 | if ((pkc->i == pkc->ksk_uri->data.ksk.keywordCount) || (NULL == pkc->dsh)) |
@@ -198,24 +198,24 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
198 | 1 + pkc->slen + pkc->mdsize, | 198 | 1 + pkc->slen + pkc->mdsize, |
199 | &skey, &iv, | 199 | &skey, &iv, |
200 | &pkc->cpy[1]); | 200 | &pkc->cpy[1]); |
201 | ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (); | 201 | ph = GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle (); |
202 | GNUNET_CRYPTO_hash (&key, sizeof (key), &signing_key); | 202 | GNUNET_CRYPTO_hash (&key, sizeof (key), &signing_key); |
203 | pkc->cpy->purpose.size = htonl (1 + pkc->slen + pkc->mdsize + sizeof (struct UBlock) | 203 | pkc->cpy->purpose.size = htonl (1 + pkc->slen + pkc->mdsize + sizeof (struct UBlock) |
204 | - sizeof (struct GNUNET_PseudonymSignature)); | 204 | - sizeof (struct GNUNET_FS_PseudonymSignature)); |
205 | pkc->cpy->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); | 205 | pkc->cpy->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); |
206 | GNUNET_PSEUDONYM_sign (ph, | 206 | GNUNET_FS_pseudonym_sign (ph, |
207 | &pkc->cpy->purpose, | 207 | &pkc->cpy->purpose, |
208 | &seed, | 208 | &seed, |
209 | &signing_key, | 209 | &signing_key, |
210 | &pkc->cpy->signature); | 210 | &pkc->cpy->signature); |
211 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym); | 211 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym); |
212 | GNUNET_PSEUDONYM_derive_verification_key (&pseudonym, | 212 | GNUNET_FS_pseudonym_derive_verification_key (&pseudonym, |
213 | &signing_key, | 213 | &signing_key, |
214 | &pkc->cpy->verification_key); | 214 | &pkc->cpy->verification_key); |
215 | GNUNET_CRYPTO_hash (&pkc->cpy->verification_key, | 215 | GNUNET_CRYPTO_hash (&pkc->cpy->verification_key, |
216 | sizeof (pkc->cpy->verification_key), | 216 | sizeof (pkc->cpy->verification_key), |
217 | &query); | 217 | &query); |
218 | GNUNET_PSEUDONYM_destroy (ph); | 218 | GNUNET_FS_pseudonym_destroy (ph); |
219 | pkc->qre = | 219 | pkc->qre = |
220 | GNUNET_DATASTORE_put (pkc->dsh, 0, &query, | 220 | GNUNET_DATASTORE_put (pkc->dsh, 0, &query, |
221 | 1 + pkc->slen + pkc->mdsize + sizeof (struct UBlock), | 221 | 1 + pkc->slen + pkc->mdsize + sizeof (struct UBlock), |
@@ -311,7 +311,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
311 | 311 | ||
312 | pkc->cpy = GNUNET_malloc (size); | 312 | pkc->cpy = GNUNET_malloc (size); |
313 | pkc->cpy->purpose.size = | 313 | pkc->cpy->purpose.size = |
314 | htonl (sizeof (struct GNUNET_PseudonymSignaturePurpose) + | 314 | htonl (sizeof (struct GNUNET_FS_PseudonymSignaturePurpose) + |
315 | pkc->mdsize + pkc->slen + 1); | 315 | pkc->mdsize + pkc->slen + 1); |
316 | pkc->cpy->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); | 316 | pkc->cpy->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); |
317 | pkc->ksk_uri = GNUNET_FS_uri_dup (ksk_uri); | 317 | pkc->ksk_uri = GNUNET_FS_uri_dup (ksk_uri); |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index eaf26f73f..25b34d99c 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -589,7 +589,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update, | |||
589 | */ | 589 | */ |
590 | static int | 590 | static int |
591 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | 591 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, |
592 | const struct GNUNET_PseudonymIdentifier *verification_key, | 592 | const struct GNUNET_FS_PseudonymIdentifier *verification_key, |
593 | const void *edata, | 593 | const void *edata, |
594 | size_t edata_size, | 594 | size_t edata_size, |
595 | char *data) | 595 | char *data) |
@@ -600,7 +600,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
600 | int i; | 600 | int i; |
601 | 601 | ||
602 | GNUNET_CRYPTO_hash (verification_key, | 602 | GNUNET_CRYPTO_hash (verification_key, |
603 | sizeof (struct GNUNET_PseudonymIdentifier), | 603 | sizeof (struct GNUNET_FS_PseudonymIdentifier), |
604 | &q); | 604 | &q); |
605 | /* find key */ | 605 | /* find key */ |
606 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) | 606 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) |
@@ -965,7 +965,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
965 | struct GNUNET_HashCode signing_key; | 965 | struct GNUNET_HashCode signing_key; |
966 | struct GNUNET_HashCode ns_hash; | 966 | struct GNUNET_HashCode ns_hash; |
967 | struct GNUNET_HashCode id_hash; | 967 | struct GNUNET_HashCode id_hash; |
968 | struct GNUNET_PseudonymIdentifier verification_key; | 968 | struct GNUNET_FS_PseudonymIdentifier verification_key; |
969 | unsigned int sqms; | 969 | unsigned int sqms; |
970 | uint32_t options; | 970 | uint32_t options; |
971 | 971 | ||
@@ -1039,7 +1039,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1039 | sizeof (sc->uri->data.sks.ns), &ns_hash); | 1039 | sizeof (sc->uri->data.sks.ns), &ns_hash); |
1040 | GNUNET_CRYPTO_hash_xor (&id_hash, &ns_hash, &key); | 1040 | GNUNET_CRYPTO_hash_xor (&id_hash, &ns_hash, &key); |
1041 | GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &signing_key); | 1041 | GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &signing_key); |
1042 | GNUNET_PSEUDONYM_derive_verification_key (&sc->uri->data.sks.ns, | 1042 | GNUNET_FS_pseudonym_derive_verification_key (&sc->uri->data.sks.ns, |
1043 | &signing_key, | 1043 | &signing_key, |
1044 | &verification_key); | 1044 | &verification_key); |
1045 | GNUNET_CRYPTO_hash (&verification_key, | 1045 | GNUNET_CRYPTO_hash (&verification_key, |
@@ -1208,17 +1208,17 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1208 | unsigned int i; | 1208 | unsigned int i; |
1209 | const char *keyword; | 1209 | const char *keyword; |
1210 | struct GNUNET_HashCode signing_key; | 1210 | struct GNUNET_HashCode signing_key; |
1211 | struct GNUNET_PseudonymHandle *ph; | 1211 | struct GNUNET_FS_PseudonymHandle *ph; |
1212 | struct GNUNET_PseudonymIdentifier anon; | 1212 | struct GNUNET_FS_PseudonymIdentifier anon; |
1213 | struct GNUNET_PseudonymIdentifier verification_key; | 1213 | struct GNUNET_FS_PseudonymIdentifier verification_key; |
1214 | 1214 | ||
1215 | GNUNET_assert (NULL == sc->client); | 1215 | GNUNET_assert (NULL == sc->client); |
1216 | if (GNUNET_FS_uri_test_ksk (sc->uri)) | 1216 | if (GNUNET_FS_uri_test_ksk (sc->uri)) |
1217 | { | 1217 | { |
1218 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); | 1218 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); |
1219 | ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (); | 1219 | ph = GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle (); |
1220 | GNUNET_PSEUDONYM_get_identifier (ph, &anon); | 1220 | GNUNET_FS_pseudonym_get_identifier (ph, &anon); |
1221 | GNUNET_PSEUDONYM_destroy (ph); | 1221 | GNUNET_FS_pseudonym_destroy (ph); |
1222 | sc->requests = | 1222 | sc->requests = |
1223 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * | 1223 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * |
1224 | sc->uri->data.ksk.keywordCount); | 1224 | sc->uri->data.ksk.keywordCount); |
@@ -1227,10 +1227,10 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1227 | keyword = &sc->uri->data.ksk.keywords[i][1]; | 1227 | keyword = &sc->uri->data.ksk.keywords[i][1]; |
1228 | GNUNET_CRYPTO_hash (keyword, strlen (keyword), &sc->requests[i].ukey); | 1228 | GNUNET_CRYPTO_hash (keyword, strlen (keyword), &sc->requests[i].ukey); |
1229 | GNUNET_CRYPTO_hash (&sc->requests[i].ukey, sizeof (struct GNUNET_HashCode), &signing_key); | 1229 | GNUNET_CRYPTO_hash (&sc->requests[i].ukey, sizeof (struct GNUNET_HashCode), &signing_key); |
1230 | GNUNET_PSEUDONYM_derive_verification_key (&anon, | 1230 | GNUNET_FS_pseudonym_derive_verification_key (&anon, |
1231 | &signing_key, | 1231 | &signing_key, |
1232 | &verification_key); | 1232 | &verification_key); |
1233 | GNUNET_CRYPTO_hash (&verification_key, sizeof (struct GNUNET_PseudonymIdentifier), | 1233 | GNUNET_CRYPTO_hash (&verification_key, sizeof (struct GNUNET_FS_PseudonymIdentifier), |
1234 | &sc->requests[i].uquery); | 1234 | &sc->requests[i].uquery); |
1235 | sc->requests[i].mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); | 1235 | sc->requests[i].mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); |
1236 | if (sc->requests[i].mandatory) | 1236 | if (sc->requests[i].mandatory) |
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index 17c3731fe..365698c4f 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -553,9 +553,9 @@ void | |||
553 | GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) | 553 | GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) |
554 | { | 554 | { |
555 | const char *keyword; | 555 | const char *keyword; |
556 | struct GNUNET_PseudonymHandle *ph; | 556 | struct GNUNET_FS_PseudonymHandle *ph; |
557 | struct GNUNET_PseudonymIdentifier anon; | 557 | struct GNUNET_FS_PseudonymIdentifier anon; |
558 | struct GNUNET_PseudonymIdentifier verification_key; | 558 | struct GNUNET_FS_PseudonymIdentifier verification_key; |
559 | struct GNUNET_HashCode signing_key; | 559 | struct GNUNET_HashCode signing_key; |
560 | 560 | ||
561 | if (NULL == uc->dsh) | 561 | if (NULL == uc->dsh) |
@@ -575,17 +575,17 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) | |||
575 | return; | 575 | return; |
576 | } | 576 | } |
577 | /* FIXME: code duplication with fs_search.c here... */ | 577 | /* FIXME: code duplication with fs_search.c here... */ |
578 | ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (); | 578 | ph = GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle (); |
579 | GNUNET_PSEUDONYM_get_identifier (ph, &anon); | 579 | GNUNET_FS_pseudonym_get_identifier (ph, &anon); |
580 | GNUNET_PSEUDONYM_destroy (ph); | 580 | GNUNET_FS_pseudonym_destroy (ph); |
581 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; | 581 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; |
582 | GNUNET_CRYPTO_hash (keyword, strlen (keyword), &uc->ukey); | 582 | GNUNET_CRYPTO_hash (keyword, strlen (keyword), &uc->ukey); |
583 | GNUNET_CRYPTO_hash (&uc->ukey, sizeof (struct GNUNET_HashCode), &signing_key); | 583 | GNUNET_CRYPTO_hash (&uc->ukey, sizeof (struct GNUNET_HashCode), &signing_key); |
584 | GNUNET_PSEUDONYM_derive_verification_key (&anon, | 584 | GNUNET_FS_pseudonym_derive_verification_key (&anon, |
585 | &signing_key, | 585 | &signing_key, |
586 | &verification_key); | 586 | &verification_key); |
587 | GNUNET_CRYPTO_hash (&verification_key, | 587 | GNUNET_CRYPTO_hash (&verification_key, |
588 | sizeof (struct GNUNET_PseudonymIdentifier), | 588 | sizeof (struct GNUNET_FS_PseudonymIdentifier), |
589 | &uc->uquery); | 589 | &uc->uquery); |
590 | uc->first_uid = 0; | 590 | uc->first_uid = 0; |
591 | uc->dqe = GNUNET_DATASTORE_get_key (uc->dsh, | 591 | uc->dqe = GNUNET_DATASTORE_get_key (uc->dsh, |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index a3a54227f..48c347a52 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -356,7 +356,7 @@ static struct GNUNET_FS_Uri * | |||
356 | uri_sks_parse (const char *s, char **emsg) | 356 | uri_sks_parse (const char *s, char **emsg) |
357 | { | 357 | { |
358 | struct GNUNET_FS_Uri *ret; | 358 | struct GNUNET_FS_Uri *ret; |
359 | struct GNUNET_PseudonymIdentifier id; | 359 | struct GNUNET_FS_PseudonymIdentifier id; |
360 | size_t pos; | 360 | size_t pos; |
361 | char *end; | 361 | char *end; |
362 | 362 | ||
@@ -969,7 +969,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, | |||
969 | * @return an FS URI for the given namespace and identifier | 969 | * @return an FS URI for the given namespace and identifier |
970 | */ | 970 | */ |
971 | struct GNUNET_FS_Uri * | 971 | struct GNUNET_FS_Uri * |
972 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_PseudonymIdentifier *pseudonym, | 972 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
973 | const char *id) | 973 | const char *id) |
974 | { | 974 | { |
975 | struct GNUNET_FS_Uri *ns_uri; | 975 | struct GNUNET_FS_Uri *ns_uri; |
@@ -1280,7 +1280,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
1280 | case GNUNET_FS_URI_SKS: | 1280 | case GNUNET_FS_URI_SKS: |
1281 | if ((0 == | 1281 | if ((0 == |
1282 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, | 1282 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, |
1283 | sizeof (struct GNUNET_PseudonymIdentifier))) && | 1283 | sizeof (struct GNUNET_FS_PseudonymIdentifier))) && |
1284 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) | 1284 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) |
1285 | 1285 | ||
1286 | return GNUNET_YES; | 1286 | return GNUNET_YES; |
@@ -1341,7 +1341,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) | |||
1341 | */ | 1341 | */ |
1342 | int | 1342 | int |
1343 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 1343 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
1344 | struct GNUNET_PseudonymIdentifier *pseudonym) | 1344 | struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
1345 | { | 1345 | { |
1346 | if (!GNUNET_FS_uri_test_sks (uri)) | 1346 | if (!GNUNET_FS_uri_test_sks (uri)) |
1347 | { | 1347 | { |
@@ -1389,9 +1389,9 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1389 | 1389 | ||
1390 | if (uri->type != GNUNET_FS_URI_SKS) | 1390 | if (uri->type != GNUNET_FS_URI_SKS) |
1391 | return NULL; | 1391 | return NULL; |
1392 | (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.ns, | 1392 | (void) GNUNET_FS_pseudonym_get_info (cfg, &uri->data.sks.ns, |
1393 | NULL, NULL, &name, NULL); | 1393 | NULL, NULL, &name, NULL); |
1394 | unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.ns, name, NULL); | 1394 | unique_name = GNUNET_FS_pseudonym_name_uniquify (cfg, &uri->data.sks.ns, name, NULL); |
1395 | GNUNET_free (name); | 1395 | GNUNET_free (name); |
1396 | GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier); | 1396 | GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier); |
1397 | GNUNET_free (unique_name); | 1397 | GNUNET_free (unique_name); |
@@ -1944,7 +1944,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri) | |||
1944 | if (GNUNET_FS_URI_SKS != uri->type) | 1944 | if (GNUNET_FS_URI_SKS != uri->type) |
1945 | return NULL; | 1945 | return NULL; |
1946 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, | 1946 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, |
1947 | sizeof (struct GNUNET_PseudonymIdentifier), | 1947 | sizeof (struct GNUNET_FS_PseudonymIdentifier), |
1948 | buf, | 1948 | buf, |
1949 | sizeof (buf)); | 1949 | sizeof (buf)); |
1950 | GNUNET_assert (NULL != ret); | 1950 | GNUNET_assert (NULL != ret); |
diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c index dd3c9d4a2..61975e463 100644 --- a/src/fs/gnunet-pseudonym.c +++ b/src/fs/gnunet-pseudonym.c | |||
@@ -95,13 +95,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
95 | 95 | ||
96 | 96 | ||
97 | static void | 97 | static void |
98 | ns_printer (void *cls, const char *name, const struct GNUNET_PseudonymIdentifier *pseudonym) | 98 | ns_printer (void *cls, const char *name, const struct GNUNET_FS_PseudonymIdentifier *pseudonym) |
99 | { | 99 | { |
100 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 100 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
101 | struct GNUNET_HashCode hc; | 101 | struct GNUNET_HashCode hc; |
102 | 102 | ||
103 | GNUNET_CRYPTO_hash (pseudonym, | 103 | GNUNET_CRYPTO_hash (pseudonym, |
104 | sizeof (struct GNUNET_PseudonymIdentifier), | 104 | sizeof (struct GNUNET_FS_PseudonymIdentifier), |
105 | &hc); | 105 | &hc); |
106 | GNUNET_CRYPTO_hash_to_enc (&hc, &enc); | 106 | GNUNET_CRYPTO_hash_to_enc (&hc, &enc); |
107 | FPRINTF (stdout, "%s (%s)\n", name, (const char *) &enc); | 107 | FPRINTF (stdout, "%s (%s)\n", name, (const char *) &enc); |
@@ -121,7 +121,7 @@ ns_printer (void *cls, const char *name, const struct GNUNET_PseudonymIdentifier | |||
121 | */ | 121 | */ |
122 | static int | 122 | static int |
123 | pseudo_printer (void *cls, | 123 | pseudo_printer (void *cls, |
124 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 124 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
125 | const char *name, | 125 | const char *name, |
126 | const char *unique_name, | 126 | const char *unique_name, |
127 | const struct GNUNET_CONTAINER_MetaData *md, | 127 | const struct GNUNET_CONTAINER_MetaData *md, |
@@ -132,16 +132,16 @@ pseudo_printer (void *cls, | |||
132 | int getinfo_result; | 132 | int getinfo_result; |
133 | 133 | ||
134 | /* While we get a name from the caller, it might be NULL. | 134 | /* While we get a name from the caller, it might be NULL. |
135 | * GNUNET_PSEUDONYM_get_info () never returns NULL. | 135 | * GNUNET_FS_pseudonym_get_info () never returns NULL. |
136 | */ | 136 | */ |
137 | getinfo_result = GNUNET_PSEUDONYM_get_info (cfg, pseudonym, | 137 | getinfo_result = GNUNET_FS_pseudonym_get_info (cfg, pseudonym, |
138 | NULL, NULL, &id, NULL); | 138 | NULL, NULL, &id, NULL); |
139 | if (getinfo_result != GNUNET_OK) | 139 | if (getinfo_result != GNUNET_OK) |
140 | { | 140 | { |
141 | GNUNET_break (0); | 141 | GNUNET_break (0); |
142 | return GNUNET_OK; | 142 | return GNUNET_OK; |
143 | } | 143 | } |
144 | unique_id = GNUNET_PSEUDONYM_name_uniquify (cfg, pseudonym, id, NULL); | 144 | unique_id = GNUNET_FS_pseudonym_name_uniquify (cfg, pseudonym, id, NULL); |
145 | GNUNET_free (id); | 145 | GNUNET_free (id); |
146 | FPRINTF (stdout, "%s (%d):\n", unique_id, rating); | 146 | FPRINTF (stdout, "%s (%d):\n", unique_id, rating); |
147 | GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout); | 147 | GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout); |
@@ -154,7 +154,7 @@ pseudo_printer (void *cls, | |||
154 | static void | 154 | static void |
155 | post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | 155 | post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) |
156 | { | 156 | { |
157 | struct GNUNET_PseudonymIdentifier nsid; | 157 | struct GNUNET_FS_PseudonymIdentifier nsid; |
158 | char *set; | 158 | char *set; |
159 | int delta; | 159 | int delta; |
160 | 160 | ||
@@ -183,9 +183,9 @@ post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
183 | *set = '\0'; | 183 | *set = '\0'; |
184 | delta = strtol (&set[1], NULL, /* no error handling yet */ | 184 | delta = strtol (&set[1], NULL, /* no error handling yet */ |
185 | 10); | 185 | 10); |
186 | if (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, rating_change, &nsid)) | 186 | if (GNUNET_OK == GNUNET_FS_pseudonym_name_to_id (cfg, rating_change, &nsid)) |
187 | { | 187 | { |
188 | (void) GNUNET_PSEUDONYM_rank (cfg, &nsid, delta); | 188 | (void) GNUNET_FS_pseudonym_rank (cfg, &nsid, delta); |
189 | } | 189 | } |
190 | else | 190 | else |
191 | { | 191 | { |
@@ -203,7 +203,7 @@ post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
203 | } | 203 | } |
204 | else if (0 == no_remote_printing) | 204 | else if (0 == no_remote_printing) |
205 | { | 205 | { |
206 | GNUNET_PSEUDONYM_list_all (cfg, &pseudo_printer, NULL); | 206 | GNUNET_FS_pseudonym_list_all (cfg, &pseudo_printer, NULL); |
207 | } | 207 | } |
208 | GNUNET_FS_stop (h); | 208 | GNUNET_FS_stop (h); |
209 | } | 209 | } |
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c index a05283f16..f41e0cd44 100644 --- a/src/fs/plugin_block_fs.c +++ b/src/fs/plugin_block_fs.c | |||
@@ -105,13 +105,13 @@ block_plugin_fs_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
105 | GNUNET_break_op (0); | 105 | GNUNET_break_op (0); |
106 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 106 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
107 | } | 107 | } |
108 | if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_PseudonymSignature)) | 108 | if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_FS_PseudonymSignature)) |
109 | { | 109 | { |
110 | GNUNET_break_op (0); | 110 | GNUNET_break_op (0); |
111 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 111 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
112 | } | 112 | } |
113 | if (GNUNET_OK != | 113 | if (GNUNET_OK != |
114 | GNUNET_PSEUDONYM_verify (&ub->purpose, | 114 | GNUNET_FS_pseudonym_verify (&ub->purpose, |
115 | &ub->signature, | 115 | &ub->signature, |
116 | &ub->verification_key)) | 116 | &ub->verification_key)) |
117 | { | 117 | { |
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index a72197e10..ddeab6dc9 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_fs_service.h" | 29 | #include "gnunet_fs_service.h" |
30 | 30 | ||
31 | 31 | ||
32 | static struct GNUNET_PseudonymIdentifier nsid; | 32 | static struct GNUNET_FS_PseudonymIdentifier nsid; |
33 | 33 | ||
34 | static struct GNUNET_FS_Uri *sks_expect_uri; | 34 | static struct GNUNET_FS_Uri *sks_expect_uri; |
35 | 35 | ||
@@ -269,7 +269,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
269 | 269 | ||
270 | 270 | ||
271 | static void | 271 | static void |
272 | ns_iterator (void *cls, const char *name, const struct GNUNET_PseudonymIdentifier *id) | 272 | ns_iterator (void *cls, const char *name, const struct GNUNET_FS_PseudonymIdentifier *id) |
273 | { | 273 | { |
274 | int *ok = cls; | 274 | int *ok = cls; |
275 | 275 | ||
diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c index 6d0bfdea9..d0aa26b79 100644 --- a/src/fs/test_fs_uri.c +++ b/src/fs/test_fs_uri.c | |||
@@ -162,8 +162,8 @@ testNamespace (int i) | |||
162 | char *uri; | 162 | char *uri; |
163 | struct GNUNET_FS_Uri *ret; | 163 | struct GNUNET_FS_Uri *ret; |
164 | char *emsg; | 164 | char *emsg; |
165 | struct GNUNET_PseudonymHandle *ph; | 165 | struct GNUNET_FS_PseudonymHandle *ph; |
166 | struct GNUNET_PseudonymIdentifier id; | 166 | struct GNUNET_FS_PseudonymIdentifier id; |
167 | char buf[1024]; | 167 | char buf[1024]; |
168 | char ubuf[1024]; | 168 | char ubuf[1024]; |
169 | char *sret; | 169 | char *sret; |
@@ -192,8 +192,8 @@ testNamespace (int i) | |||
192 | GNUNET_assert (0); | 192 | GNUNET_assert (0); |
193 | } | 193 | } |
194 | GNUNET_free (emsg); | 194 | GNUNET_free (emsg); |
195 | ph = GNUNET_PSEUDONYM_create (NULL); | 195 | ph = GNUNET_FS_pseudonym_create (NULL); |
196 | GNUNET_PSEUDONYM_get_identifier (ph, &id); | 196 | GNUNET_FS_pseudonym_get_identifier (ph, &id); |
197 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), | 197 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), |
198 | ubuf, sizeof (ubuf) - 1); | 198 | ubuf, sizeof (ubuf) - 1); |
199 | GNUNET_assert (NULL != sret); | 199 | GNUNET_assert (NULL != sret); |
diff --git a/src/fs/test_pseudonym.c b/src/fs/test_pseudonym.c index 5247d6dcc..0615f5a5b 100644 --- a/src/fs/test_pseudonym.c +++ b/src/fs/test_pseudonym.c | |||
@@ -33,17 +33,17 @@ | |||
33 | 33 | ||
34 | static struct GNUNET_CONTAINER_MetaData *meta; | 34 | static struct GNUNET_CONTAINER_MetaData *meta; |
35 | 35 | ||
36 | static struct GNUNET_PseudonymIdentifier id1; | 36 | static struct GNUNET_FS_PseudonymIdentifier id1; |
37 | 37 | ||
38 | 38 | ||
39 | static int | 39 | static int |
40 | iter (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, | 40 | iter (void *cls, const struct GNUNET_FS_PseudonymIdentifier * pseudonym, |
41 | const char *name, const char *unique_name, | 41 | const char *name, const char *unique_name, |
42 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) | 42 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) |
43 | { | 43 | { |
44 | int *ok = cls; | 44 | int *ok = cls; |
45 | 45 | ||
46 | if ((0 == memcmp (pseudonym, &id1, sizeof (struct GNUNET_PseudonymIdentifier))) && | 46 | if ((0 == memcmp (pseudonym, &id1, sizeof (struct GNUNET_FS_PseudonymIdentifier))) && |
47 | (!GNUNET_CONTAINER_meta_data_test_equal (md, meta))) | 47 | (!GNUNET_CONTAINER_meta_data_test_equal (md, meta))) |
48 | { | 48 | { |
49 | *ok = GNUNET_NO; | 49 | *ok = GNUNET_NO; |
@@ -54,7 +54,7 @@ iter (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, | |||
54 | 54 | ||
55 | 55 | ||
56 | static int | 56 | static int |
57 | noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, | 57 | noti_callback (void *cls, const struct GNUNET_FS_PseudonymIdentifier * pseudonym, |
58 | const char *name, const char *unique_name, | 58 | const char *name, const char *unique_name, |
59 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) | 59 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) |
60 | { | 60 | { |
@@ -66,7 +66,7 @@ noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, | |||
66 | 66 | ||
67 | 67 | ||
68 | static int | 68 | static int |
69 | fake_noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, | 69 | fake_noti_callback (void *cls, const struct GNUNET_FS_PseudonymIdentifier * pseudonym, |
70 | const char *name, const char *unique_name, | 70 | const char *name, const char *unique_name, |
71 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) | 71 | const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) |
72 | { | 72 | { |
@@ -78,13 +78,13 @@ fake_noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudon | |||
78 | 78 | ||
79 | 79 | ||
80 | static void | 80 | static void |
81 | create_pseu (struct GNUNET_PseudonymIdentifier *pseu) | 81 | create_pseu (struct GNUNET_FS_PseudonymIdentifier *pseu) |
82 | { | 82 | { |
83 | struct GNUNET_PseudonymHandle *ph; | 83 | struct GNUNET_FS_PseudonymHandle *ph; |
84 | 84 | ||
85 | ph = GNUNET_PSEUDONYM_create (NULL); | 85 | ph = GNUNET_FS_pseudonym_create (NULL); |
86 | GNUNET_PSEUDONYM_get_identifier (ph, pseu); | 86 | GNUNET_FS_pseudonym_get_identifier (ph, pseu); |
87 | GNUNET_PSEUDONYM_destroy (ph); | 87 | GNUNET_FS_pseudonym_destroy (ph); |
88 | } | 88 | } |
89 | 89 | ||
90 | 90 | ||
@@ -95,11 +95,11 @@ static int | |||
95 | test_io () | 95 | test_io () |
96 | { | 96 | { |
97 | int ok; | 97 | int ok; |
98 | struct GNUNET_PseudonymIdentifier rid1; | 98 | struct GNUNET_FS_PseudonymIdentifier rid1; |
99 | struct GNUNET_PseudonymIdentifier id2; | 99 | struct GNUNET_FS_PseudonymIdentifier id2; |
100 | struct GNUNET_PseudonymIdentifier rid2; | 100 | struct GNUNET_FS_PseudonymIdentifier rid2; |
101 | struct GNUNET_PseudonymIdentifier fid; | 101 | struct GNUNET_FS_PseudonymIdentifier fid; |
102 | struct GNUNET_PseudonymIdentifier id3; | 102 | struct GNUNET_FS_PseudonymIdentifier id3; |
103 | int old; | 103 | int old; |
104 | int newVal; | 104 | int newVal; |
105 | struct GNUNET_CONFIGURATION_Handle *cfg; | 105 | struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -112,8 +112,8 @@ test_io () | |||
112 | int noname_is_a_dup; | 112 | int noname_is_a_dup; |
113 | int notiCount, fakenotiCount; | 113 | int notiCount, fakenotiCount; |
114 | static char m[1024 * 1024 * 10]; | 114 | static char m[1024 * 1024 * 10]; |
115 | struct GNUNET_PSEUDONYM_DiscoveryHandle *dh1; | 115 | struct GNUNET_FS_pseudonym_DiscoveryHandle *dh1; |
116 | struct GNUNET_PSEUDONYM_DiscoveryHandle *dh2; | 116 | struct GNUNET_FS_pseudonym_DiscoveryHandle *dh2; |
117 | 117 | ||
118 | memset (m, 'b', sizeof (m)); | 118 | memset (m, 'b', sizeof (m)); |
119 | m[sizeof (m) - 1] = '\0'; | 119 | m[sizeof (m) - 1] = '\0'; |
@@ -130,30 +130,30 @@ test_io () | |||
130 | } | 130 | } |
131 | notiCount = 0; | 131 | notiCount = 0; |
132 | fakenotiCount = 0; | 132 | fakenotiCount = 0; |
133 | dh1 = GNUNET_PSEUDONYM_discovery_callback_register (cfg, &fake_noti_callback, | 133 | dh1 = GNUNET_FS_pseudonym_discovery_callback_register (cfg, &fake_noti_callback, |
134 | &fakenotiCount); | 134 | &fakenotiCount); |
135 | dh2 = GNUNET_PSEUDONYM_discovery_callback_register (cfg, ¬i_callback, | 135 | dh2 = GNUNET_FS_pseudonym_discovery_callback_register (cfg, ¬i_callback, |
136 | ¬iCount); | 136 | ¬iCount); |
137 | GNUNET_PSEUDONYM_discovery_callback_unregister (dh1); | 137 | GNUNET_FS_pseudonym_discovery_callback_unregister (dh1); |
138 | 138 | ||
139 | /* ACTUAL TEST CODE */ | 139 | /* ACTUAL TEST CODE */ |
140 | old = GNUNET_PSEUDONYM_list_all (cfg, NULL, NULL); | 140 | old = GNUNET_FS_pseudonym_list_all (cfg, NULL, NULL); |
141 | meta = GNUNET_CONTAINER_meta_data_create (); | 141 | meta = GNUNET_CONTAINER_meta_data_create (); |
142 | GNUNET_CONTAINER_meta_data_insert (meta, "<test>", EXTRACTOR_METATYPE_TITLE, | 142 | GNUNET_CONTAINER_meta_data_insert (meta, "<test>", EXTRACTOR_METATYPE_TITLE, |
143 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", | 143 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", |
144 | "test", strlen ("test") + 1); | 144 | "test", strlen ("test") + 1); |
145 | create_pseu (&id1); | 145 | create_pseu (&id1); |
146 | GNUNET_PSEUDONYM_add (cfg, &id1, meta); | 146 | GNUNET_FS_pseudonym_add (cfg, &id1, meta); |
147 | CHECK (notiCount == 1); | 147 | CHECK (notiCount == 1); |
148 | GNUNET_PSEUDONYM_add (cfg, &id1, meta); | 148 | GNUNET_FS_pseudonym_add (cfg, &id1, meta); |
149 | CHECK (notiCount == 2); | 149 | CHECK (notiCount == 2); |
150 | newVal = GNUNET_PSEUDONYM_list_all (cfg, &iter, &ok); | 150 | newVal = GNUNET_FS_pseudonym_list_all (cfg, &iter, &ok); |
151 | CHECK (old < newVal); | 151 | CHECK (old < newVal); |
152 | old = newVal; | 152 | old = newVal; |
153 | create_pseu (&id2); | 153 | create_pseu (&id2); |
154 | GNUNET_PSEUDONYM_add (cfg, &id2, meta); | 154 | GNUNET_FS_pseudonym_add (cfg, &id2, meta); |
155 | CHECK (notiCount == 3); | 155 | CHECK (notiCount == 3); |
156 | newVal = GNUNET_PSEUDONYM_list_all (cfg, &iter, &ok); | 156 | newVal = GNUNET_FS_pseudonym_list_all (cfg, &iter, &ok); |
157 | CHECK (old < newVal); | 157 | CHECK (old < newVal); |
158 | GNUNET_assert (GNUNET_OK == | 158 | GNUNET_assert (GNUNET_OK == |
159 | GNUNET_CONTAINER_meta_data_insert (meta, "<test>", | 159 | GNUNET_CONTAINER_meta_data_insert (meta, "<test>", |
@@ -162,36 +162,36 @@ test_io () | |||
162 | "text/plain", m, | 162 | "text/plain", m, |
163 | strlen (m) + 1)); | 163 | strlen (m) + 1)); |
164 | create_pseu (&id3); | 164 | create_pseu (&id3); |
165 | GNUNET_PSEUDONYM_add (cfg, &id3, meta); | 165 | GNUNET_FS_pseudonym_add (cfg, &id3, meta); |
166 | GNUNET_PSEUDONYM_get_info (cfg, &id3, NULL, NULL, &name3, NULL); | 166 | GNUNET_FS_pseudonym_get_info (cfg, &id3, NULL, NULL, &name3, NULL); |
167 | CHECK (name3 != NULL); | 167 | CHECK (name3 != NULL); |
168 | GNUNET_PSEUDONYM_get_info (cfg, &id2, NULL, NULL, &name2, NULL); | 168 | GNUNET_FS_pseudonym_get_info (cfg, &id2, NULL, NULL, &name2, NULL); |
169 | CHECK (name2 != NULL); | 169 | CHECK (name2 != NULL); |
170 | GNUNET_PSEUDONYM_get_info (cfg, &id1, NULL, NULL, &name1, NULL); | 170 | GNUNET_FS_pseudonym_get_info (cfg, &id1, NULL, NULL, &name1, NULL); |
171 | CHECK (name1 != NULL); | 171 | CHECK (name1 != NULL); |
172 | CHECK (0 == strcmp (name1, name2)); | 172 | CHECK (0 == strcmp (name1, name2)); |
173 | name1_unique = GNUNET_PSEUDONYM_name_uniquify (cfg, &id1, name1, NULL); | 173 | name1_unique = GNUNET_FS_pseudonym_name_uniquify (cfg, &id1, name1, NULL); |
174 | name2_unique = GNUNET_PSEUDONYM_name_uniquify (cfg, &id2, name2, NULL); | 174 | name2_unique = GNUNET_FS_pseudonym_name_uniquify (cfg, &id2, name2, NULL); |
175 | CHECK (0 != strcmp (name1_unique, name2_unique)); | 175 | CHECK (0 != strcmp (name1_unique, name2_unique)); |
176 | CHECK (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, "fake", &rid2)); | 176 | CHECK (GNUNET_SYSERR == GNUNET_FS_pseudonym_name_to_id (cfg, "fake", &rid2)); |
177 | CHECK (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, name2, &rid2)); | 177 | CHECK (GNUNET_SYSERR == GNUNET_FS_pseudonym_name_to_id (cfg, name2, &rid2)); |
178 | CHECK (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, name1, &rid1)); | 178 | CHECK (GNUNET_SYSERR == GNUNET_FS_pseudonym_name_to_id (cfg, name1, &rid1)); |
179 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name2_unique, &rid2)); | 179 | CHECK (GNUNET_OK == GNUNET_FS_pseudonym_name_to_id (cfg, name2_unique, &rid2)); |
180 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name1_unique, &rid1)); | 180 | CHECK (GNUNET_OK == GNUNET_FS_pseudonym_name_to_id (cfg, name1_unique, &rid1)); |
181 | CHECK (0 == memcmp (&id1, &rid1, sizeof (struct GNUNET_PseudonymIdentifier))); | 181 | CHECK (0 == memcmp (&id1, &rid1, sizeof (struct GNUNET_FS_PseudonymIdentifier))); |
182 | CHECK (0 == memcmp (&id2, &rid2, sizeof (struct GNUNET_PseudonymIdentifier))); | 182 | CHECK (0 == memcmp (&id2, &rid2, sizeof (struct GNUNET_FS_PseudonymIdentifier))); |
183 | 183 | ||
184 | create_pseu (&fid); | 184 | create_pseu (&fid); |
185 | GNUNET_log_skip (1, GNUNET_NO); | 185 | GNUNET_log_skip (1, GNUNET_NO); |
186 | CHECK (0 == GNUNET_PSEUDONYM_rank (cfg, &fid, 0)); | 186 | CHECK (0 == GNUNET_FS_pseudonym_rank (cfg, &fid, 0)); |
187 | GNUNET_log_skip (0, GNUNET_NO); | 187 | GNUNET_log_skip (0, GNUNET_NO); |
188 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_get_info (cfg, &fid, NULL, NULL, &noname, &noname_is_a_dup)); | 188 | CHECK (GNUNET_OK == GNUNET_FS_pseudonym_get_info (cfg, &fid, NULL, NULL, &noname, &noname_is_a_dup)); |
189 | CHECK (noname != NULL); | 189 | CHECK (noname != NULL); |
190 | CHECK (noname_is_a_dup == GNUNET_YES); | 190 | CHECK (noname_is_a_dup == GNUNET_YES); |
191 | CHECK (0 == GNUNET_PSEUDONYM_rank (cfg, &id1, 0)); | 191 | CHECK (0 == GNUNET_FS_pseudonym_rank (cfg, &id1, 0)); |
192 | CHECK (5 == GNUNET_PSEUDONYM_rank (cfg, &id1, 5)); | 192 | CHECK (5 == GNUNET_FS_pseudonym_rank (cfg, &id1, 5)); |
193 | CHECK (-5 == GNUNET_PSEUDONYM_rank (cfg, &id1, -10)); | 193 | CHECK (-5 == GNUNET_FS_pseudonym_rank (cfg, &id1, -10)); |
194 | CHECK (0 == GNUNET_PSEUDONYM_rank (cfg, &id1, 5)); | 194 | CHECK (0 == GNUNET_FS_pseudonym_rank (cfg, &id1, 5)); |
195 | GNUNET_free (name1); | 195 | GNUNET_free (name1); |
196 | GNUNET_free (name2); | 196 | GNUNET_free (name2); |
197 | GNUNET_free (name1_unique); | 197 | GNUNET_free (name1_unique); |
@@ -200,7 +200,7 @@ test_io () | |||
200 | GNUNET_free (noname); | 200 | GNUNET_free (noname); |
201 | /* END OF TEST CODE */ | 201 | /* END OF TEST CODE */ |
202 | FAILURE: | 202 | FAILURE: |
203 | GNUNET_PSEUDONYM_discovery_callback_unregister (dh2); | 203 | GNUNET_FS_pseudonym_discovery_callback_unregister (dh2); |
204 | GNUNET_CONTAINER_meta_data_destroy (meta); | 204 | GNUNET_CONTAINER_meta_data_destroy (meta); |
205 | GNUNET_CONFIGURATION_destroy (cfg); | 205 | GNUNET_CONFIGURATION_destroy (cfg); |
206 | return (ok == GNUNET_YES) ? 0 : 1; | 206 | return (ok == GNUNET_YES) ? 0 : 1; |
@@ -211,38 +211,38 @@ FAILURE: | |||
211 | * Use the given input to sign and check the resulting signature. | 211 | * Use the given input to sign and check the resulting signature. |
212 | */ | 212 | */ |
213 | static void | 213 | static void |
214 | test_signature (struct GNUNET_PseudonymHandle *ph, | 214 | test_signature (struct GNUNET_FS_PseudonymHandle *ph, |
215 | struct GNUNET_PseudonymSignaturePurpose *purpose, | 215 | struct GNUNET_FS_PseudonymSignaturePurpose *purpose, |
216 | struct GNUNET_HashCode *seed, | 216 | struct GNUNET_HashCode *seed, |
217 | struct GNUNET_HashCode *signing_key, | 217 | struct GNUNET_HashCode *signing_key, |
218 | char *bit) | 218 | char *bit) |
219 | { | 219 | { |
220 | struct GNUNET_PseudonymSignature signature; | 220 | struct GNUNET_FS_PseudonymSignature signature; |
221 | struct GNUNET_PseudonymSignature signature2; | 221 | struct GNUNET_FS_PseudonymSignature signature2; |
222 | struct GNUNET_PseudonymIdentifier pseudonym; | 222 | struct GNUNET_FS_PseudonymIdentifier pseudonym; |
223 | struct GNUNET_PseudonymIdentifier verification_key; | 223 | struct GNUNET_FS_PseudonymIdentifier verification_key; |
224 | 224 | ||
225 | GNUNET_PSEUDONYM_sign (ph, purpose, seed, signing_key, &signature); | 225 | GNUNET_FS_pseudonym_sign (ph, purpose, seed, signing_key, &signature); |
226 | if (0) | 226 | if (0) |
227 | { | 227 | { |
228 | GNUNET_PSEUDONYM_sign (ph, purpose, seed, signing_key, &signature2); | 228 | GNUNET_FS_pseudonym_sign (ph, purpose, seed, signing_key, &signature2); |
229 | /* with seed, two sigs must be identical, without, they must be different! */ | 229 | /* with seed, two sigs must be identical, without, they must be different! */ |
230 | if (NULL != seed) | 230 | if (NULL != seed) |
231 | GNUNET_break (0 == memcmp (&signature, &signature2, sizeof (signature))); | 231 | GNUNET_break (0 == memcmp (&signature, &signature2, sizeof (signature))); |
232 | else /* crypto not implemented, thus for now 'break' */ | 232 | else /* crypto not implemented, thus for now 'break' */ |
233 | GNUNET_break (0 != memcmp (&signature, &signature2, sizeof (signature))); | 233 | GNUNET_break (0 != memcmp (&signature, &signature2, sizeof (signature))); |
234 | } | 234 | } |
235 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym); | 235 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym); |
236 | GNUNET_PSEUDONYM_derive_verification_key (&pseudonym, | 236 | GNUNET_FS_pseudonym_derive_verification_key (&pseudonym, |
237 | signing_key, | 237 | signing_key, |
238 | &verification_key); | 238 | &verification_key); |
239 | GNUNET_break (GNUNET_OK == | 239 | GNUNET_break (GNUNET_OK == |
240 | GNUNET_PSEUDONYM_verify (purpose, &signature, &verification_key)); | 240 | GNUNET_FS_pseudonym_verify (purpose, &signature, &verification_key)); |
241 | /* also check that if the data is changed, the signature no longer matches */ | 241 | /* also check that if the data is changed, the signature no longer matches */ |
242 | (*bit)++; | 242 | (*bit)++; |
243 | /* crypto not implemented, thus for now 'break' */ | 243 | /* crypto not implemented, thus for now 'break' */ |
244 | GNUNET_break (GNUNET_OK != | 244 | GNUNET_break (GNUNET_OK != |
245 | GNUNET_PSEUDONYM_verify (purpose, &signature, &verification_key)); | 245 | GNUNET_FS_pseudonym_verify (purpose, &signature, &verification_key)); |
246 | (*bit)--; | 246 | (*bit)--; |
247 | } | 247 | } |
248 | 248 | ||
@@ -253,21 +253,21 @@ test_signature (struct GNUNET_PseudonymHandle *ph, | |||
253 | * @param ph private key to test | 253 | * @param ph private key to test |
254 | */ | 254 | */ |
255 | static void | 255 | static void |
256 | test_crypto_ops (struct GNUNET_PseudonymHandle *ph) | 256 | test_crypto_ops (struct GNUNET_FS_PseudonymHandle *ph) |
257 | { | 257 | { |
258 | char data[16]; | 258 | char data[16]; |
259 | struct GNUNET_PseudonymSignaturePurpose *purpose; | 259 | struct GNUNET_FS_PseudonymSignaturePurpose *purpose; |
260 | struct GNUNET_HashCode seed; | 260 | struct GNUNET_HashCode seed; |
261 | struct GNUNET_HashCode signing_key; | 261 | struct GNUNET_HashCode signing_key; |
262 | 262 | ||
263 | memset (data, 42, sizeof (data)); | 263 | memset (data, 42, sizeof (data)); |
264 | purpose = (struct GNUNET_PseudonymSignaturePurpose *) data; | 264 | purpose = (struct GNUNET_FS_PseudonymSignaturePurpose *) data; |
265 | purpose->size = htonl (sizeof (data)); | 265 | purpose->size = htonl (sizeof (data)); |
266 | purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); | 266 | purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); |
267 | memset (&seed, 41, sizeof (seed)); | 267 | memset (&seed, 41, sizeof (seed)); |
268 | memset (&signing_key, 40, sizeof (signing_key)); | 268 | memset (&signing_key, 40, sizeof (signing_key)); |
269 | test_signature (ph, purpose, &seed, &signing_key, &data[sizeof (struct GNUNET_PseudonymSignaturePurpose)]); | 269 | test_signature (ph, purpose, &seed, &signing_key, &data[sizeof (struct GNUNET_FS_PseudonymSignaturePurpose)]); |
270 | test_signature (ph, purpose, NULL, &signing_key, &data[sizeof (struct GNUNET_PseudonymSignaturePurpose)]); | 270 | test_signature (ph, purpose, NULL, &signing_key, &data[sizeof (struct GNUNET_FS_PseudonymSignaturePurpose)]); |
271 | } | 271 | } |
272 | 272 | ||
273 | 273 | ||
@@ -277,36 +277,36 @@ test_crypto_ops (struct GNUNET_PseudonymHandle *ph) | |||
277 | static int | 277 | static int |
278 | test_crypto () | 278 | test_crypto () |
279 | { | 279 | { |
280 | struct GNUNET_PseudonymHandle *ph; | 280 | struct GNUNET_FS_PseudonymHandle *ph; |
281 | struct GNUNET_PseudonymIdentifier pseudonym; | 281 | struct GNUNET_FS_PseudonymIdentifier pseudonym; |
282 | struct GNUNET_PseudonymIdentifier pseudonym2; | 282 | struct GNUNET_FS_PseudonymIdentifier pseudonym2; |
283 | 283 | ||
284 | /* check writing to and reading from disk */ | 284 | /* check writing to and reading from disk */ |
285 | ph = GNUNET_PSEUDONYM_create ("/tmp/gnunet-pseudonym-test/pseu.dsa"); | 285 | ph = GNUNET_FS_pseudonym_create ("/tmp/gnunet-pseudonym-test/pseu.dsa"); |
286 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym); | 286 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym); |
287 | GNUNET_PSEUDONYM_destroy (ph); | 287 | GNUNET_FS_pseudonym_destroy (ph); |
288 | ph = GNUNET_PSEUDONYM_create ("/tmp/gnunet-pseudonym-test/pseu.dsa"); | 288 | ph = GNUNET_FS_pseudonym_create ("/tmp/gnunet-pseudonym-test/pseu.dsa"); |
289 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym2); | 289 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym2); |
290 | test_crypto_ops (ph); | 290 | test_crypto_ops (ph); |
291 | GNUNET_PSEUDONYM_destroy (ph); | 291 | GNUNET_FS_pseudonym_destroy (ph); |
292 | if (0 != memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) | 292 | if (0 != memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) |
293 | return 1; | 293 | return 1; |
294 | 294 | ||
295 | /* check in-memory generation */ | 295 | /* check in-memory generation */ |
296 | ph = GNUNET_PSEUDONYM_create (NULL); | 296 | ph = GNUNET_FS_pseudonym_create (NULL); |
297 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym2); | 297 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym2); |
298 | if (0 == memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) | 298 | if (0 == memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) |
299 | return 1; | 299 | return 1; |
300 | test_crypto_ops (ph); | 300 | test_crypto_ops (ph); |
301 | GNUNET_PSEUDONYM_destroy (ph); | 301 | GNUNET_FS_pseudonym_destroy (ph); |
302 | 302 | ||
303 | /* check anonymous pseudonym operations generation */ | 303 | /* check anonymous pseudonym operations generation */ |
304 | ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (); | 304 | ph = GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle (); |
305 | GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym2); | 305 | GNUNET_FS_pseudonym_get_identifier (ph, &pseudonym2); |
306 | if (0 == memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) | 306 | if (0 == memcmp (&pseudonym, &pseudonym2, sizeof (pseudonym))) |
307 | return 1; | 307 | return 1; |
308 | test_crypto_ops (ph); | 308 | test_crypto_ops (ph); |
309 | GNUNET_PSEUDONYM_destroy (ph); | 309 | GNUNET_FS_pseudonym_destroy (ph); |
310 | return 0; | 310 | return 0; |
311 | } | 311 | } |
312 | 312 | ||
diff --git a/src/include/block_fs.h b/src/include/block_fs.h index 233d8035e..4806bf7b1 100644 --- a/src/include/block_fs.h +++ b/src/include/block_fs.h | |||
@@ -48,18 +48,18 @@ struct UBlock | |||
48 | /** | 48 | /** |
49 | * Signature using pseudonym and search keyword / identifier. | 49 | * Signature using pseudonym and search keyword / identifier. |
50 | */ | 50 | */ |
51 | struct GNUNET_PseudonymSignature signature; | 51 | struct GNUNET_FS_PseudonymSignature signature; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * What is being signed and why? | 54 | * What is being signed and why? |
55 | */ | 55 | */ |
56 | struct GNUNET_PseudonymSignaturePurpose purpose; | 56 | struct GNUNET_FS_PseudonymSignaturePurpose purpose; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Public key used to sign this block. Hash of this value | 59 | * Public key used to sign this block. Hash of this value |
60 | * is the query. | 60 | * is the query. |
61 | */ | 61 | */ |
62 | struct GNUNET_PseudonymIdentifier verification_key; | 62 | struct GNUNET_FS_PseudonymIdentifier verification_key; |
63 | 63 | ||
64 | /* rest of the data is encrypted */ | 64 | /* rest of the data is encrypted */ |
65 | 65 | ||
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 6143f0630..83279cb08 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -84,7 +84,7 @@ struct GNUNET_FS_Uri; | |||
84 | * Identifier for a GNUnet pseudonym (the public key). | 84 | * Identifier for a GNUnet pseudonym (the public key). |
85 | * Q-point, Q=dp. | 85 | * Q-point, Q=dp. |
86 | */ | 86 | */ |
87 | struct GNUNET_PseudonymIdentifier | 87 | struct GNUNET_FS_PseudonymIdentifier |
88 | { | 88 | { |
89 | /** | 89 | /** |
90 | * Q consists of an x- and a y-value, each mod p (256 bits), | 90 | * Q consists of an x- and a y-value, each mod p (256 bits), |
@@ -104,7 +104,7 @@ struct GNUNET_PseudonymIdentifier | |||
104 | /** | 104 | /** |
105 | * Handle for a pseudonym (private key). | 105 | * Handle for a pseudonym (private key). |
106 | */ | 106 | */ |
107 | struct GNUNET_PseudonymHandle; | 107 | struct GNUNET_FS_PseudonymHandle; |
108 | 108 | ||
109 | 109 | ||
110 | /** | 110 | /** |
@@ -114,13 +114,13 @@ struct GNUNET_PseudonymHandle; | |||
114 | * where z is derived from the hash of the message that is being | 114 | * where z is derived from the hash of the message that is being |
115 | * signed. | 115 | * signed. |
116 | */ | 116 | */ |
117 | struct GNUNET_PseudonymSignature | 117 | struct GNUNET_FS_PseudonymSignature |
118 | { | 118 | { |
119 | 119 | ||
120 | /** | 120 | /** |
121 | * Who created the signature? (public key of the signer), 'd' value in NIST P-256. | 121 | * Who created the signature? (public key of the signer), 'd' value in NIST P-256. |
122 | */ | 122 | */ |
123 | struct GNUNET_PseudonymIdentifier signer; | 123 | struct GNUNET_FS_PseudonymIdentifier signer; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * Binary ECDSA signature data, r-value. Value is mod n, and n is 256 bits. | 126 | * Binary ECDSA signature data, r-value. Value is mod n, and n is 256 bits. |
@@ -137,7 +137,7 @@ struct GNUNET_PseudonymSignature | |||
137 | /** | 137 | /** |
138 | * Purpose for signature made with a pseudonym. | 138 | * Purpose for signature made with a pseudonym. |
139 | */ | 139 | */ |
140 | struct GNUNET_PseudonymSignaturePurpose | 140 | struct GNUNET_FS_PseudonymSignaturePurpose |
141 | { | 141 | { |
142 | /** | 142 | /** |
143 | * How many bytes are being signed (including this header)? | 143 | * How many bytes are being signed (including this header)? |
@@ -171,8 +171,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, | |||
171 | * @param filename name of the file to use for storage, NULL for in-memory only | 171 | * @param filename name of the file to use for storage, NULL for in-memory only |
172 | * @return handle to the private key of the pseudonym | 172 | * @return handle to the private key of the pseudonym |
173 | */ | 173 | */ |
174 | struct GNUNET_PseudonymHandle * | 174 | struct GNUNET_FS_PseudonymHandle * |
175 | GNUNET_PSEUDONYM_create (const char *filename); | 175 | GNUNET_FS_pseudonym_create (const char *filename); |
176 | 176 | ||
177 | 177 | ||
178 | /** | 178 | /** |
@@ -181,8 +181,8 @@ GNUNET_PSEUDONYM_create (const char *filename); | |||
181 | * @param filename name of the file to use for storage, NULL for in-memory only | 181 | * @param filename name of the file to use for storage, NULL for in-memory only |
182 | * @return handle to the private key of the pseudonym | 182 | * @return handle to the private key of the pseudonym |
183 | */ | 183 | */ |
184 | struct GNUNET_PseudonymHandle * | 184 | struct GNUNET_FS_PseudonymHandle * |
185 | GNUNET_PSEUDONYM_create_from_existing_file (const char *filename); | 185 | GNUNET_FS_pseudonym_create_from_existing_file (const char *filename); |
186 | 186 | ||
187 | 187 | ||
188 | /** | 188 | /** |
@@ -193,8 +193,8 @@ GNUNET_PSEUDONYM_create_from_existing_file (const char *filename); | |||
193 | * | 193 | * |
194 | * @return handle to the (non-secret) private key of the 'anonymous' pseudonym | 194 | * @return handle to the (non-secret) private key of the 'anonymous' pseudonym |
195 | */ | 195 | */ |
196 | struct GNUNET_PseudonymHandle * | 196 | struct GNUNET_FS_PseudonymHandle * |
197 | GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (void); | 197 | GNUNET_FS_pseudonym_get_anonymous_pseudonym_handle (void); |
198 | 198 | ||
199 | 199 | ||
200 | /** | 200 | /** |
@@ -204,7 +204,7 @@ GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle (void); | |||
204 | * @param ph pseudonym handle to destroy | 204 | * @param ph pseudonym handle to destroy |
205 | */ | 205 | */ |
206 | void | 206 | void |
207 | GNUNET_PSEUDONYM_destroy (struct GNUNET_PseudonymHandle *ph); | 207 | GNUNET_FS_pseudonym_destroy (struct GNUNET_FS_PseudonymHandle *ph); |
208 | 208 | ||
209 | 209 | ||
210 | /** | 210 | /** |
@@ -221,11 +221,11 @@ GNUNET_PSEUDONYM_destroy (struct GNUNET_PseudonymHandle *ph); | |||
221 | * @return GNUNET_SYSERR on failure | 221 | * @return GNUNET_SYSERR on failure |
222 | */ | 222 | */ |
223 | int | 223 | int |
224 | GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, | 224 | GNUNET_FS_pseudonym_sign (struct GNUNET_FS_PseudonymHandle *ph, |
225 | const struct GNUNET_PseudonymSignaturePurpose *purpose, | 225 | const struct GNUNET_FS_PseudonymSignaturePurpose *purpose, |
226 | const struct GNUNET_HashCode *seed, | 226 | const struct GNUNET_HashCode *seed, |
227 | const struct GNUNET_HashCode *signing_key, | 227 | const struct GNUNET_HashCode *signing_key, |
228 | struct GNUNET_PseudonymSignature *signature); | 228 | struct GNUNET_FS_PseudonymSignature *signature); |
229 | 229 | ||
230 | 230 | ||
231 | /** | 231 | /** |
@@ -236,13 +236,13 @@ GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, | |||
236 | * @param signing_key input to derive 'h' (see section 2.4 of #2564) | 236 | * @param signing_key input to derive 'h' (see section 2.4 of #2564) |
237 | * @param verification_key resulting public key to verify the signature | 237 | * @param verification_key resulting public key to verify the signature |
238 | * created from the 'ph' of 'pseudonym' and the 'signing_key'; | 238 | * created from the 'ph' of 'pseudonym' and the 'signing_key'; |
239 | * the value stored here can then be given to GNUNET_PSEUDONYM_verify. | 239 | * the value stored here can then be given to GNUNET_FS_pseudonym_verify. |
240 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 240 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
241 | */ | 241 | */ |
242 | int | 242 | int |
243 | GNUNET_PSEUDONYM_derive_verification_key (struct GNUNET_PseudonymIdentifier *pseudonym, | 243 | GNUNET_FS_pseudonym_derive_verification_key (struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
244 | const struct GNUNET_HashCode *signing_key, | 244 | const struct GNUNET_HashCode *signing_key, |
245 | struct GNUNET_PseudonymIdentifier *verification_key); | 245 | struct GNUNET_FS_PseudonymIdentifier *verification_key); |
246 | 246 | ||
247 | 247 | ||
248 | /** | 248 | /** |
@@ -256,9 +256,9 @@ GNUNET_PSEUDONYM_derive_verification_key (struct GNUNET_PseudonymIdentifier *pse | |||
256 | * GNUNET_SYSERR if the signature is invalid | 256 | * GNUNET_SYSERR if the signature is invalid |
257 | */ | 257 | */ |
258 | int | 258 | int |
259 | GNUNET_PSEUDONYM_verify (const struct GNUNET_PseudonymSignaturePurpose *purpose, | 259 | GNUNET_FS_pseudonym_verify (const struct GNUNET_FS_PseudonymSignaturePurpose *purpose, |
260 | const struct GNUNET_PseudonymSignature *signature, | 260 | const struct GNUNET_FS_PseudonymSignature *signature, |
261 | const struct GNUNET_PseudonymIdentifier *verification_key); | 261 | const struct GNUNET_FS_PseudonymIdentifier *verification_key); |
262 | 262 | ||
263 | 263 | ||
264 | /** | 264 | /** |
@@ -268,8 +268,8 @@ GNUNET_PSEUDONYM_verify (const struct GNUNET_PseudonymSignaturePurpose *purpose, | |||
268 | * @param pseudonym pseudonym identifier (set based on 'ph') | 268 | * @param pseudonym pseudonym identifier (set based on 'ph') |
269 | */ | 269 | */ |
270 | void | 270 | void |
271 | GNUNET_PSEUDONYM_get_identifier (struct GNUNET_PseudonymHandle *ph, | 271 | GNUNET_FS_pseudonym_get_identifier (struct GNUNET_FS_PseudonymHandle *ph, |
272 | struct GNUNET_PseudonymIdentifier *pseudonym); | 272 | struct GNUNET_FS_PseudonymIdentifier *pseudonym); |
273 | 273 | ||
274 | 274 | ||
275 | 275 | ||
@@ -284,12 +284,12 @@ GNUNET_PSEUDONYM_get_identifier (struct GNUNET_PseudonymHandle *ph, | |||
284 | * @param rating the local rating of the pseudonym | 284 | * @param rating the local rating of the pseudonym |
285 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 285 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
286 | */ | 286 | */ |
287 | typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | 287 | typedef int (*GNUNET_FS_PseudonymIterator) (void *cls, |
288 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 288 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
289 | const char *name, | 289 | const char *name, |
290 | const char *unique_name, | 290 | const char *unique_name, |
291 | const struct GNUNET_CONTAINER_MetaData *md, | 291 | const struct GNUNET_CONTAINER_MetaData *md, |
292 | int32_t rating); | 292 | int32_t rating); |
293 | 293 | ||
294 | 294 | ||
295 | /** | 295 | /** |
@@ -301,9 +301,9 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | |||
301 | * @return new rating of the pseudonym | 301 | * @return new rating of the pseudonym |
302 | */ | 302 | */ |
303 | int | 303 | int |
304 | GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | 304 | GNUNET_FS_pseudonym_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, |
305 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 305 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
306 | int32_t delta); | 306 | int32_t delta); |
307 | 307 | ||
308 | 308 | ||
309 | /** | 309 | /** |
@@ -317,9 +317,9 @@ GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
317 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 317 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
318 | */ | 318 | */ |
319 | int | 319 | int |
320 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | 320 | GNUNET_FS_pseudonym_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |
321 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 321 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
322 | const struct GNUNET_CONTAINER_MetaData *meta); | 322 | const struct GNUNET_CONTAINER_MetaData *meta); |
323 | 323 | ||
324 | 324 | ||
325 | /** | 325 | /** |
@@ -331,15 +331,15 @@ GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
331 | * @return number of pseudonyms found | 331 | * @return number of pseudonyms found |
332 | */ | 332 | */ |
333 | int | 333 | int |
334 | GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, | 334 | GNUNET_FS_pseudonym_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
335 | GNUNET_PSEUDONYM_Iterator iterator, | 335 | GNUNET_FS_PseudonymIterator iterator, |
336 | void *iterator_cls); | 336 | void *iterator_cls); |
337 | 337 | ||
338 | 338 | ||
339 | /** | 339 | /** |
340 | * Handle for a discovery callback registration. | 340 | * Handle for a discovery callback registration. |
341 | */ | 341 | */ |
342 | struct GNUNET_PSEUDONYM_DiscoveryHandle; | 342 | struct GNUNET_FS_pseudonym_DiscoveryHandle; |
343 | 343 | ||
344 | 344 | ||
345 | /** | 345 | /** |
@@ -351,10 +351,10 @@ struct GNUNET_PSEUDONYM_DiscoveryHandle; | |||
351 | * @param iterator_cls closure for iterator | 351 | * @param iterator_cls closure for iterator |
352 | * @return registration handle | 352 | * @return registration handle |
353 | */ | 353 | */ |
354 | struct GNUNET_PSEUDONYM_DiscoveryHandle * | 354 | struct GNUNET_FS_pseudonym_DiscoveryHandle * |
355 | GNUNET_PSEUDONYM_discovery_callback_register (const struct GNUNET_CONFIGURATION_Handle *cfg, | 355 | GNUNET_FS_pseudonym_discovery_callback_register (const struct GNUNET_CONFIGURATION_Handle *cfg, |
356 | GNUNET_PSEUDONYM_Iterator iterator, | 356 | GNUNET_FS_PseudonymIterator iterator, |
357 | void *iterator_cls); | 357 | void *iterator_cls); |
358 | 358 | ||
359 | 359 | ||
360 | /** | 360 | /** |
@@ -363,12 +363,12 @@ GNUNET_PSEUDONYM_discovery_callback_register (const struct GNUNET_CONFIGURATION_ | |||
363 | * @param dh registration to unregister | 363 | * @param dh registration to unregister |
364 | */ | 364 | */ |
365 | void | 365 | void |
366 | GNUNET_PSEUDONYM_discovery_callback_unregister (struct GNUNET_PSEUDONYM_DiscoveryHandle *dh); | 366 | GNUNET_FS_pseudonym_discovery_callback_unregister (struct GNUNET_FS_pseudonym_DiscoveryHandle *dh); |
367 | 367 | ||
368 | 368 | ||
369 | /** | 369 | /** |
370 | * Return unique variant of the pseudonym name. Use after | 370 | * Return unique variant of the pseudonym name. Use after |
371 | * GNUNET_PSEUDONYM_id_to_name() to make sure that name is unique. | 371 | * GNUNET_FS_pseudonym_id_to_name() to make sure that name is unique. |
372 | * | 372 | * |
373 | * @param cfg configuration | 373 | * @param cfg configuration |
374 | * @param pseudonym cryptographic ID of the pseudonym | 374 | * @param pseudonym cryptographic ID of the pseudonym |
@@ -378,10 +378,10 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (struct GNUNET_PSEUDONYM_Discover | |||
378 | * Free the name with GNUNET_free(). | 378 | * Free the name with GNUNET_free(). |
379 | */ | 379 | */ |
380 | char * | 380 | char * |
381 | GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | 381 | GNUNET_FS_pseudonym_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, |
382 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 382 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
383 | const char *name, | 383 | const char *name, |
384 | unsigned int *suffix); | 384 | unsigned int *suffix); |
385 | 385 | ||
386 | 386 | ||
387 | /** | 387 | /** |
@@ -405,12 +405,12 @@ GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
405 | * empty metadata container, rank -1 and a "no-name" name). | 405 | * empty metadata container, rank -1 and a "no-name" name). |
406 | */ | 406 | */ |
407 | int | 407 | int |
408 | GNUNET_PSEUDONYM_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | 408 | GNUNET_FS_pseudonym_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, |
409 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 409 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
410 | struct GNUNET_CONTAINER_MetaData **ret_meta, | 410 | struct GNUNET_CONTAINER_MetaData **ret_meta, |
411 | int32_t *ret_rank, | 411 | int32_t *ret_rank, |
412 | char **ret_name, | 412 | char **ret_name, |
413 | int *name_is_a_dup); | 413 | int *name_is_a_dup); |
414 | 414 | ||
415 | 415 | ||
416 | /** | 416 | /** |
@@ -422,9 +422,9 @@ GNUNET_PSEUDONYM_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
422 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 422 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
423 | */ | 423 | */ |
424 | int | 424 | int |
425 | GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | 425 | GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, |
426 | const char *ns_uname, | 426 | const char *ns_uname, |
427 | struct GNUNET_PseudonymIdentifier *pseudonym); | 427 | struct GNUNET_FS_PseudonymIdentifier *pseudonym); |
428 | 428 | ||
429 | 429 | ||
430 | /** | 430 | /** |
@@ -440,11 +440,11 @@ GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
440 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 440 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
441 | */ | 441 | */ |
442 | int | 442 | int |
443 | GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | 443 | GNUNET_FS_pseudonym_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, |
444 | const struct GNUNET_PseudonymIdentifier *pseudonym, | 444 | const struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
445 | const char *name, | 445 | const char *name, |
446 | const struct GNUNET_CONTAINER_MetaData *md, | 446 | const struct GNUNET_CONTAINER_MetaData *md, |
447 | int32_t rank); | 447 | int32_t rank); |
448 | 448 | ||
449 | 449 | ||
450 | /** | 450 | /** |
@@ -455,8 +455,8 @@ GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
455 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 455 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
456 | */ | 456 | */ |
457 | int | 457 | int |
458 | GNUNET_PSEUDONYM_remove (const struct GNUNET_CONFIGURATION_Handle *cfg, | 458 | GNUNET_FS_pseudonym_remove (const struct GNUNET_CONFIGURATION_Handle *cfg, |
459 | const struct GNUNET_PseudonymIdentifier *id); | 459 | const struct GNUNET_FS_PseudonymIdentifier *id); |
460 | 460 | ||
461 | 461 | ||
462 | /** | 462 | /** |
@@ -719,7 +719,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, | |||
719 | * @return an FS URI for the given namespace and identifier | 719 | * @return an FS URI for the given namespace and identifier |
720 | */ | 720 | */ |
721 | struct GNUNET_FS_Uri * | 721 | struct GNUNET_FS_Uri * |
722 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_PseudonymIdentifier *pseudonym, | 722 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_FS_PseudonymIdentifier *pseudonym, |
723 | const char *id); | 723 | const char *id); |
724 | 724 | ||
725 | 725 | ||
@@ -733,7 +733,7 @@ GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_PseudonymIdentifier *pseudonym | |||
733 | */ | 733 | */ |
734 | int | 734 | int |
735 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 735 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
736 | struct GNUNET_PseudonymIdentifier *pseudonym); | 736 | struct GNUNET_FS_PseudonymIdentifier *pseudonym); |
737 | 737 | ||
738 | 738 | ||
739 | /** | 739 | /** |
@@ -1778,7 +1778,7 @@ struct GNUNET_FS_ProgressInfo | |||
1778 | /** | 1778 | /** |
1779 | * Public key of the namespace. | 1779 | * Public key of the namespace. |
1780 | */ | 1780 | */ |
1781 | struct GNUNET_PseudonymIdentifier pseudonym; | 1781 | struct GNUNET_FS_PseudonymIdentifier pseudonym; |
1782 | 1782 | ||
1783 | } ns; | 1783 | } ns; |
1784 | 1784 | ||
@@ -2619,7 +2619,7 @@ GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns); | |||
2619 | */ | 2619 | */ |
2620 | int | 2620 | int |
2621 | GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, | 2621 | GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, |
2622 | struct GNUNET_PseudonymIdentifier *id); | 2622 | struct GNUNET_FS_PseudonymIdentifier *id); |
2623 | 2623 | ||
2624 | 2624 | ||
2625 | /** | 2625 | /** |
@@ -2647,7 +2647,7 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *ns, int freeze); | |||
2647 | * @param id identifier for the namespace | 2647 | * @param id identifier for the namespace |
2648 | */ | 2648 | */ |
2649 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, | 2649 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, |
2650 | const struct GNUNET_PseudonymIdentifier *id); | 2650 | const struct GNUNET_FS_PseudonymIdentifier *id); |
2651 | 2651 | ||
2652 | 2652 | ||
2653 | /** | 2653 | /** |