aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-04-14 20:21:41 +0000
committerChristian Grothoff <christian@grothoff.org>2013-04-14 20:21:41 +0000
commitce52e258a28a17f5c319549fda1b5fbb8f6169a7 (patch)
treea1198190a418df4c35f2ccd19139f4f67e0c240b /src/fs
parentacc6f8a81932a50650ab2aa2d52d6f873f8a2060 (diff)
downloadgnunet-ce52e258a28a17f5c319549fda1b5fbb8f6169a7.tar.gz
gnunet-ce52e258a28a17f5c319549fda1b5fbb8f6169a7.zip
renaming GNUNET_PSEUDONYM_-API to GNUNET_FS_pseudonym-API
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.h4
-rw-r--r--src/fs/fs_namespace.c26
-rw-r--r--src/fs/fs_pseudonym.c182
-rw-r--r--src/fs/fs_publish_ksk.c18
-rw-r--r--src/fs/fs_search.c24
-rw-r--r--src/fs/fs_unindex.c16
-rw-r--r--src/fs/fs_uri.c14
-rw-r--r--src/fs/gnunet-pseudonym.c20
-rw-r--r--src/fs/plugin_block_fs.c4
-rw-r--r--src/fs/test_fs_namespace.c4
-rw-r--r--src/fs/test_fs_uri.c8
-rw-r--r--src/fs/test_pseudonym.c156
12 files changed, 238 insertions, 238 deletions
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 */
434int 434int
435GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, 435GNUNET_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
455process_namespace (void *cls, const char *filename) 455process_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 */
70struct GNUNET_PSEUDONYM_DiscoveryHandle 70struct 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 */
98static struct GNUNET_PSEUDONYM_DiscoveryHandle *disco_head; 98static 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 */
104static struct GNUNET_PSEUDONYM_DiscoveryHandle *disco_tail; 104static 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 */
114static void 114static void
115internal_notify (const struct GNUNET_PseudonymIdentifier *pseudonym, 115internal_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 */
136struct GNUNET_PSEUDONYM_DiscoveryHandle * 136struct GNUNET_FS_pseudonym_DiscoveryHandle *
137GNUNET_PSEUDONYM_discovery_callback_register (const struct 137GNUNET_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 */
158void 158void
159GNUNET_PSEUDONYM_discovery_callback_unregister (struct GNUNET_PSEUDONYM_DiscoveryHandle *dh) 159GNUNET_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
175static char * 175static char *
176get_data_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, 176get_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 */
239int 239int
240GNUNET_PSEUDONYM_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, 240GNUNET_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 */
291static int 291static int
292read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, 292read_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 */
363char * 363char *
364GNUNET_PSEUDONYM_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg, 364GNUNET_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 */
438int 438int
439GNUNET_PSEUDONYM_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg, 439GNUNET_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 */
516int 516int
517GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, 517GNUNET_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
605list_pseudonym_helper (void *cls, const char *fullname) 605list_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 */
666int 666int
667GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, 667GNUNET_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 */
695int 695int
696GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, 696GNUNET_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 */
730int 730int
731GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, 731GNUNET_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 */
769struct GNUNET_PseudonymHandle 769struct 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 */
865struct GNUNET_PseudonymHandle * 865struct GNUNET_FS_PseudonymHandle *
866GNUNET_PSEUDONYM_create (const char *filename) 866GNUNET_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 (&params, NULL, 890 if (0 != (rc = gcry_sexp_build (&params, 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 */
983struct GNUNET_PseudonymHandle * 983struct GNUNET_FS_PseudonymHandle *
984GNUNET_PSEUDONYM_create_from_existing_file (const char *filename) 984GNUNET_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 */
1010struct GNUNET_PseudonymHandle * 1010struct GNUNET_FS_PseudonymHandle *
1011GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle () 1011GNUNET_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 */
1031void 1031void
1032GNUNET_PSEUDONYM_destroy (struct GNUNET_PseudonymHandle *ph) 1032GNUNET_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 */
1045static gcry_sexp_t 1045static gcry_sexp_t
1046data_to_pkcs1 (const struct GNUNET_PseudonymSignaturePurpose *purpose) 1046data_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 */
1086int 1086int
1087GNUNET_PSEUDONYM_sign (struct GNUNET_PseudonymHandle *ph, 1087GNUNET_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 */
1265static gcry_ctx_t 1265static gcry_ctx_t
1266get_context_from_pseudonym (struct GNUNET_PseudonymIdentifier *pseudonym) 1266get_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 */
1323int 1323int
1324GNUNET_PSEUDONYM_derive_verification_key (struct GNUNET_PseudonymIdentifier *pseudonym, 1324GNUNET_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 */
1435int 1435int
1436GNUNET_PSEUDONYM_verify (const struct GNUNET_PseudonymSignaturePurpose *purpose, 1436GNUNET_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 */
1559void 1559void
1560GNUNET_PSEUDONYM_get_identifier (struct GNUNET_PseudonymHandle *ph, 1560GNUNET_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 */
1575int 1575int
1576GNUNET_PSEUDONYM_remove (const struct GNUNET_CONFIGURATION_Handle *cfg, 1576GNUNET_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 */
590static int 590static int
591decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, 591decrypt_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
553GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) 553GNUNET_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 *
356uri_sks_parse (const char *s, char **emsg) 356uri_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 */
971struct GNUNET_FS_Uri * 971struct GNUNET_FS_Uri *
972GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_PseudonymIdentifier *pseudonym, 972GNUNET_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 */
1342int 1342int
1343GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, 1343GNUNET_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
97static void 97static void
98ns_printer (void *cls, const char *name, const struct GNUNET_PseudonymIdentifier *pseudonym) 98ns_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 */
122static int 122static int
123pseudo_printer (void *cls, 123pseudo_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,
154static void 154static void
155post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) 155post_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
32static struct GNUNET_PseudonymIdentifier nsid; 32static struct GNUNET_FS_PseudonymIdentifier nsid;
33 33
34static struct GNUNET_FS_Uri *sks_expect_uri; 34static 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
271static void 271static void
272ns_iterator (void *cls, const char *name, const struct GNUNET_PseudonymIdentifier *id) 272ns_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
34static struct GNUNET_CONTAINER_MetaData *meta; 34static struct GNUNET_CONTAINER_MetaData *meta;
35 35
36static struct GNUNET_PseudonymIdentifier id1; 36static struct GNUNET_FS_PseudonymIdentifier id1;
37 37
38 38
39static int 39static int
40iter (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, 40iter (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
56static int 56static int
57noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, 57noti_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
68static int 68static int
69fake_noti_callback (void *cls, const struct GNUNET_PseudonymIdentifier * pseudonym, 69fake_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
80static void 80static void
81create_pseu (struct GNUNET_PseudonymIdentifier *pseu) 81create_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
95test_io () 95test_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, &noti_callback, 135 dh2 = GNUNET_FS_pseudonym_discovery_callback_register (cfg, &noti_callback,
136 &notiCount); 136 &notiCount);
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 */
202FAILURE: 202FAILURE:
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 */
213static void 213static void
214test_signature (struct GNUNET_PseudonymHandle *ph, 214test_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 */
255static void 255static void
256test_crypto_ops (struct GNUNET_PseudonymHandle *ph) 256test_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)
277static int 277static int
278test_crypto () 278test_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