aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-02-15 13:58:52 +0000
committerChristian Grothoff <christian@grothoff.org>2013-02-15 13:58:52 +0000
commitbdeb59bc30331d6fd9f05d56d44a30f281b46195 (patch)
tree4ed1830fec733e90ac15323b4e4851f704a35c64 /src/fs
parent140fdac7581295bd7d9dd90ead81bf31f8473cbf (diff)
downloadgnunet-bdeb59bc30331d6fd9f05d56d44a30f281b46195.tar.gz
gnunet-bdeb59bc30331d6fd9f05d56d44a30f281b46195.zip
-fixes to make stream tests pass with ecc in core
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c4
-rw-r--r--src/fs/fs_api.h17
-rw-r--r--src/fs/fs_download.c2
-rw-r--r--src/fs/fs_getopt.c4
-rw-r--r--src/fs/fs_namespace.c2
-rw-r--r--src/fs/fs_search.c6
-rw-r--r--src/fs/fs_tree.c2
-rw-r--r--src/fs/fs_uri.c136
8 files changed, 87 insertions, 86 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 2770e8650..b7ae05527 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -2004,7 +2004,7 @@ GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr)
2004 goto cleanup; 2004 goto cleanup;
2005 } 2005 }
2006 if ( (NULL != sr->uri) && 2006 if ( (NULL != sr->uri) &&
2007 (ksk == sr->sc->uri->type) && 2007 (GNUNET_FS_URI_KSK == sr->sc->uri->type) &&
2008 (GNUNET_OK != GNUNET_BIO_write (wh, sr->keyword_bitmap, 2008 (GNUNET_OK != GNUNET_BIO_write (wh, sr->keyword_bitmap,
2009 (sr->sc->uri->data.ksk.keywordCount + 7) / 8)) ) 2009 (sr->sc->uri->data.ksk.keywordCount + 7) / 8)) )
2010 { 2010 {
@@ -2340,7 +2340,7 @@ deserialize_search_result (void *cls, const char *filename)
2340 GNUNET_break (0); 2340 GNUNET_break (0);
2341 goto cleanup; 2341 goto cleanup;
2342 } 2342 }
2343 if (ksk == sr->sc->uri->type) 2343 if (GNUNET_FS_URI_KSK == sr->sc->uri->type)
2344 { 2344 {
2345 sr->keyword_bitmap = GNUNET_malloc ((sr->sc->uri->data.ksk.keywordCount + 7) / 8); /* round up, count bits */ 2345 sr->keyword_bitmap = GNUNET_malloc ((sr->sc->uri->data.ksk.keywordCount + 7) / 8); /* round up, count bits */
2346 if (GNUNET_OK != GNUNET_BIO_read (rh, "keyword-bitmap", 2346 if (GNUNET_OK != GNUNET_BIO_read (rh, "keyword-bitmap",
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 12d4ae44b..61a568fa0 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -125,7 +125,7 @@ struct Location
125 /** 125 /**
126 * Identity of the peer sharing the file. 126 * Identity of the peer sharing the file.
127 */ 127 */
128 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded peer; 128 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded peer;
129 129
130 /** 130 /**
131 * Time when this location URI expires. 131 * Time when this location URI expires.
@@ -136,36 +136,37 @@ struct Location
136 * RSA signature over the GNUNET_EC_FileIdentifier, 136 * RSA signature over the GNUNET_EC_FileIdentifier,
137 * GNUNET_hash of the peer and expiration time. 137 * GNUNET_hash of the peer and expiration time.
138 */ 138 */
139 struct GNUNET_CRYPTO_RsaSignature contentSignature; 139 struct GNUNET_CRYPTO_EccSignature contentSignature;
140 140
141}; 141};
142 142
143/** 143/**
144 * Types of URIs. 144 * Types of URIs.
145 */ 145 */
146enum uri_types 146enum GNUNET_FS_UriType
147{ 147{
148 /** 148 /**
149 * Content-hash-key (simple file). 149 * Content-hash-key (simple file).
150 */ 150 */
151 chk, 151 GNUNET_FS_URI_CHK,
152 152
153 /** 153 /**
154 * Signed key space (file in namespace). 154 * Signed key space (file in namespace).
155 */ 155 */
156 sks, 156 GNUNET_FS_URI_SKS,
157 157
158 /** 158 /**
159 * Keyword search key (query with keywords). 159 * Keyword search key (query with keywords).
160 */ 160 */
161 ksk, 161 GNUNET_FS_URI_KSK,
162 162
163 /** 163 /**
164 * Location (chk with identity of hosting peer). 164 * Location (chk with identity of hosting peer).
165 */ 165 */
166 loc 166 GNUNET_FS_URI_LOC
167}; 167};
168 168
169
169/** 170/**
170 * A Universal Resource Identifier (URI), opaque. 171 * A Universal Resource Identifier (URI), opaque.
171 */ 172 */
@@ -174,7 +175,7 @@ struct GNUNET_FS_Uri
174 /** 175 /**
175 * Type of the URI. 176 * Type of the URI.
176 */ 177 */
177 enum uri_types type; 178 enum GNUNET_FS_UriType type;
178 179
179 union 180 union
180 { 181 {
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 82fc39113..dc4d6723b 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -1884,7 +1884,7 @@ GNUNET_FS_download_start_task_ (void *cls,
1884 dc->top_request->state = BRS_CHK_SET; 1884 dc->top_request->state = BRS_CHK_SET;
1885 dc->top_request->chk = 1885 dc->top_request->chk =
1886 (dc->uri->type == 1886 (dc->uri->type ==
1887 chk) ? dc->uri->data.chk.chk : dc->uri->data.loc.fi.chk; 1887 GNUNET_FS_URI_CHK) ? dc->uri->data.chk.chk : dc->uri->data.loc.fi.chk;
1888 /* signal start */ 1888 /* signal start */
1889 GNUNET_FS_download_sync_ (dc); 1889 GNUNET_FS_download_sync_ (dc);
1890 if (NULL != dc->search) 1890 if (NULL != dc->search)
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index 6cc402115..d7ff97c6b 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -55,13 +55,13 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
55 { 55 {
56 u = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 56 u = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
57 *uri = u; 57 *uri = u;
58 u->type = ksk; 58 u->type = GNUNET_FS_URI_KSK;
59 u->data.ksk.keywordCount = 0; 59 u->data.ksk.keywordCount = 0;
60 u->data.ksk.keywords = NULL; 60 u->data.ksk.keywords = NULL;
61 } 61 }
62 else 62 else
63 { 63 {
64 GNUNET_assert (u->type == ksk); 64 GNUNET_assert (u->type == GNUNET_FS_URI_KSK);
65 } 65 }
66 slen = strlen (value); 66 slen = strlen (value);
67 if (slen == 0) 67 if (slen == 0)
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 5c16ea4ae..d84fdc5b1 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -598,7 +598,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
598 GNUNET_CRYPTO_hash (identifier, idlen, &key); 598 GNUNET_CRYPTO_hash (identifier, idlen, &key);
599 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &id); 599 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &id);
600 sks_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 600 sks_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
601 sks_uri->type = sks; 601 sks_uri->type = GNUNET_FS_URI_SKS;
602 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &sb_enc->subspace); 602 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &sb_enc->subspace);
603 GNUNET_CRYPTO_hash (&sb_enc->subspace, 603 GNUNET_CRYPTO_hash (&sb_enc->subspace,
604 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 604 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 3f0a4a374..ffa2d61aa 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -400,7 +400,7 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr)
400 return; 400 return;
401 if (sr->availability_trials > AVAILABILITY_TRIALS_MAX) 401 if (sr->availability_trials > AVAILABILITY_TRIALS_MAX)
402 return; 402 return;
403 if ( (chk != sr->uri->type) && (loc != sr->uri->type)) 403 if ( (GNUNET_FS_URI_CHK != sr->uri->type) && (GNUNET_FS_URI_LOC != sr->uri->type))
404 return; 404 return;
405 len = GNUNET_FS_uri_chk_get_file_size (sr->uri); 405 len = GNUNET_FS_uri_chk_get_file_size (sr->uri);
406 if (0 == len) 406 if (0 == len)
@@ -566,7 +566,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update,
566 /* search for updates */ 566 /* search for updates */
567 if (0 == strlen (id_update)) 567 if (0 == strlen (id_update))
568 return; /* no updates */ 568 return; /* no updates */
569 uu.type = sks; 569 uu.type = GNUNET_FS_URI_SKS;
570 uu.data.sks.ns = sc->uri->data.sks.ns; 570 uu.data.sks.ns = sc->uri->data.sks.ns;
571 uu.data.sks.identifier = GNUNET_strdup (id_update); 571 uu.data.sks.identifier = GNUNET_strdup (id_update);
572 (void) search_start (sc->h, &uu, sc->anonymity, sc->options, NULL, sr); 572 (void) search_start (sc->h, &uu, sc->anonymity, sc->options, NULL, sr);
@@ -729,7 +729,7 @@ process_nblock (struct GNUNET_FS_SearchContext *sc, const struct NBlock *nb,
729 } 729 }
730 730
731 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 731 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
732 uri->type = sks; 732 uri->type = GNUNET_FS_URI_SKS;
733 uri->data.sks.identifier = GNUNET_strdup (pt); 733 uri->data.sks.identifier = GNUNET_strdup (pt);
734 GNUNET_CRYPTO_hash (&nb->subspace, 734 GNUNET_CRYPTO_hash (&nb->subspace,
735 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 735 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 30cdded67..3a697c539 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -347,7 +347,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
347 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n", 347 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n",
348 GNUNET_h2s (&te->chk_tree[off].query), off); 348 GNUNET_h2s (&te->chk_tree[off].query), off);
349 te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 349 te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
350 te->uri->type = chk; 350 te->uri->type = GNUNET_FS_URI_CHK;
351 te->uri->data.chk.chk = te->chk_tree[off]; 351 te->uri->data.chk.chk = te->chk_tree[off];
352 te->uri->data.chk.file_length = GNUNET_htonll (te->size); 352 te->uri->data.chk.file_length = GNUNET_htonll (te->size);
353 te->in_next = GNUNET_NO; 353 te->in_next = GNUNET_NO;
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index fa6d411db..d38a5354d 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -102,22 +102,22 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *
102{ 102{
103 switch (uri->type) 103 switch (uri->type)
104 { 104 {
105 case chk: 105 case GNUNET_FS_URI_CHK:
106 *key = uri->data.chk.chk.query; 106 *key = uri->data.chk.chk.query;
107 return; 107 return;
108 case sks: 108 case GNUNET_FS_URI_SKS:
109 GNUNET_CRYPTO_hash (uri->data.sks.identifier, 109 GNUNET_CRYPTO_hash (uri->data.sks.identifier,
110 strlen (uri->data.sks.identifier), key); 110 strlen (uri->data.sks.identifier), key);
111 break; 111 break;
112 case ksk: 112 case GNUNET_FS_URI_KSK:
113 if (uri->data.ksk.keywordCount > 0) 113 if (uri->data.ksk.keywordCount > 0)
114 GNUNET_CRYPTO_hash (uri->data.ksk.keywords[0], 114 GNUNET_CRYPTO_hash (uri->data.ksk.keywords[0],
115 strlen (uri->data.ksk.keywords[0]), key); 115 strlen (uri->data.ksk.keywords[0]), key);
116 break; 116 break;
117 case loc: 117 case GNUNET_FS_URI_LOC:
118 GNUNET_CRYPTO_hash (&uri->data.loc.fi, 118 GNUNET_CRYPTO_hash (&uri->data.loc.fi,
119 sizeof (struct FileIdentifier) + 119 sizeof (struct FileIdentifier) +
120 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 120 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
121 key); 121 key);
122 break; 122 break;
123 default: 123 default:
@@ -144,7 +144,7 @@ GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri)
144 char **keywords; 144 char **keywords;
145 unsigned int keywordCount; 145 unsigned int keywordCount;
146 146
147 if ((uri == NULL) || (uri->type != ksk)) 147 if ((uri == NULL) || (uri->type != GNUNET_FS_URI_KSK))
148 { 148 {
149 GNUNET_break (0); 149 GNUNET_break (0);
150 return NULL; 150 return NULL;
@@ -330,7 +330,7 @@ uri_ksk_parse (const char *s, char **emsg)
330 GNUNET_assert (max == 0); 330 GNUNET_assert (max == 0);
331 GNUNET_free (dup); 331 GNUNET_free (dup);
332 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 332 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
333 ret->type = ksk; 333 ret->type = GNUNET_FS_URI_KSK;
334 ret->data.ksk.keywordCount = iret; 334 ret->data.ksk.keywordCount = iret;
335 ret->data.ksk.keywords = keywords; 335 ret->data.ksk.keywords = keywords;
336 return ret; 336 return ret;
@@ -383,7 +383,7 @@ uri_sks_parse (const char *s, char **emsg)
383 identifier = 383 identifier =
384 GNUNET_strdup (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)]); 384 GNUNET_strdup (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)]);
385 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 385 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
386 ret->type = sks; 386 ret->type = GNUNET_FS_URI_SKS;
387 ret->data.sks.ns = ns; 387 ret->data.sks.ns = ns;
388 ret->data.sks.identifier = identifier; 388 ret->data.sks.identifier = identifier;
389 return ret; 389 return ret;
@@ -441,7 +441,7 @@ uri_chk_parse (const char *s, char **emsg)
441 } 441 }
442 fi.file_length = GNUNET_htonll (flen); 442 fi.file_length = GNUNET_htonll (flen);
443 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 443 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
444 ret->type = chk; 444 ret->type = GNUNET_FS_URI_CHK;
445 ret->data.chk = fi; 445 ret->data.chk = fi;
446 return ret; 446 return ret;
447} 447}
@@ -520,13 +520,13 @@ enc2bin (const char *input, void *data, size_t size)
520 */ 520 */
521struct LocUriAssembly 521struct LocUriAssembly
522{ 522{
523 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; 523 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
524 524
525 struct GNUNET_TIME_AbsoluteNBO exptime; 525 struct GNUNET_TIME_AbsoluteNBO exptime;
526 526
527 struct FileIdentifier fi; 527 struct FileIdentifier fi;
528 528
529 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded peer; 529 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded peer;
530 530
531}; 531};
532 532
@@ -552,7 +552,7 @@ uri_loc_parse (const char *s, char **emsg)
552 unsigned long long exptime; 552 unsigned long long exptime;
553 unsigned long long flen; 553 unsigned long long flen;
554 struct GNUNET_TIME_Absolute et; 554 struct GNUNET_TIME_Absolute et;
555 struct GNUNET_CRYPTO_RsaSignature sig; 555 struct GNUNET_CRYPTO_EccSignature sig;
556 struct LocUriAssembly ass; 556 struct LocUriAssembly ass;
557 int ret; 557 int ret;
558 size_t slen; 558 size_t slen;
@@ -597,7 +597,7 @@ uri_loc_parse (const char *s, char **emsg)
597 npos++; 597 npos++;
598 ret = 598 ret =
599 enc2bin (&s[npos], &ass.peer, 599 enc2bin (&s[npos], &ass.peer,
600 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)); 600 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded));
601 if (ret == -1) 601 if (ret == -1)
602 { 602 {
603 *emsg = 603 *emsg =
@@ -610,7 +610,7 @@ uri_loc_parse (const char *s, char **emsg)
610 *emsg = GNUNET_strdup (_("SKS URI malformed (could not find signature)")); 610 *emsg = GNUNET_strdup (_("SKS URI malformed (could not find signature)"));
611 goto ERR; 611 goto ERR;
612 } 612 }
613 ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_RsaSignature)); 613 ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_EccSignature));
614 if (ret == -1) 614 if (ret == -1)
615 { 615 {
616 *emsg = GNUNET_strdup (_("SKS URI malformed (could not decode signature)")); 616 *emsg = GNUNET_strdup (_("SKS URI malformed (could not decode signature)"));
@@ -634,7 +634,7 @@ uri_loc_parse (const char *s, char **emsg)
634 et.abs_value = exptime; 634 et.abs_value = exptime;
635 ass.exptime = GNUNET_TIME_absolute_hton (et); 635 ass.exptime = GNUNET_TIME_absolute_hton (et);
636 if (GNUNET_OK != 636 if (GNUNET_OK !=
637 GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, 637 GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT,
638 &ass.purpose, &sig, &ass.peer)) 638 &ass.purpose, &sig, &ass.peer))
639 { 639 {
640 *emsg = 640 *emsg =
@@ -642,7 +642,7 @@ uri_loc_parse (const char *s, char **emsg)
642 goto ERR; 642 goto ERR;
643 } 643 }
644 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 644 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
645 uri->type = loc; 645 uri->type = GNUNET_FS_URI_LOC;
646 uri->data.loc.fi = ass.fi; 646 uri->data.loc.fi = ass.fi;
647 uri->data.loc.peer = ass.peer; 647 uri->data.loc.peer = ass.peer;
648 uri->data.loc.expirationTime = et; 648 uri->data.loc.expirationTime = et;
@@ -696,15 +696,15 @@ GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri)
696 GNUNET_assert (uri != NULL); 696 GNUNET_assert (uri != NULL);
697 switch (uri->type) 697 switch (uri->type)
698 { 698 {
699 case ksk: 699 case GNUNET_FS_URI_KSK:
700 for (i = 0; i < uri->data.ksk.keywordCount; i++) 700 for (i = 0; i < uri->data.ksk.keywordCount; i++)
701 GNUNET_free (uri->data.ksk.keywords[i]); 701 GNUNET_free (uri->data.ksk.keywords[i]);
702 GNUNET_array_grow (uri->data.ksk.keywords, uri->data.ksk.keywordCount, 0); 702 GNUNET_array_grow (uri->data.ksk.keywords, uri->data.ksk.keywordCount, 0);
703 break; 703 break;
704 case sks: 704 case GNUNET_FS_URI_SKS:
705 GNUNET_free (uri->data.sks.identifier); 705 GNUNET_free (uri->data.sks.identifier);
706 break; 706 break;
707 case loc: 707 case GNUNET_FS_URI_LOC:
708 break; 708 break;
709 default: 709 default:
710 /* do nothing */ 710 /* do nothing */
@@ -722,7 +722,7 @@ GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri)
722unsigned int 722unsigned int
723GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri) 723GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri)
724{ 724{
725 if (uri->type != ksk) 725 if (uri->type != GNUNET_FS_URI_KSK)
726 return 0; 726 return 0;
727 return uri->data.ksk.keywordCount; 727 return uri->data.ksk.keywordCount;
728} 728}
@@ -745,7 +745,7 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
745 unsigned int i; 745 unsigned int i;
746 char *keyword; 746 char *keyword;
747 747
748 if (uri->type != ksk) 748 if (uri->type != GNUNET_FS_URI_KSK)
749 return -1; 749 return -1;
750 if (iterator == NULL) 750 if (iterator == NULL)
751 return uri->data.ksk.keywordCount; 751 return uri->data.ksk.keywordCount;
@@ -777,7 +777,7 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword,
777 const char *old; 777 const char *old;
778 char *n; 778 char *n;
779 779
780 GNUNET_assert (uri->type == ksk); 780 GNUNET_assert (uri->type == GNUNET_FS_URI_KSK);
781 for (i = 0; i < uri->data.ksk.keywordCount; i++) 781 for (i = 0; i < uri->data.ksk.keywordCount; i++)
782 { 782 {
783 old = uri->data.ksk.keywords[i]; 783 old = uri->data.ksk.keywords[i];
@@ -803,7 +803,7 @@ GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
803 unsigned int i; 803 unsigned int i;
804 char *old; 804 char *old;
805 805
806 GNUNET_assert (uri->type == ksk); 806 GNUNET_assert (uri->type == GNUNET_FS_URI_KSK);
807 for (i = 0; i < uri->data.ksk.keywordCount; i++) 807 for (i = 0; i < uri->data.ksk.keywordCount; i++)
808 { 808 {
809 old = uri->data.ksk.keywords[i]; 809 old = uri->data.ksk.keywords[i];
@@ -831,10 +831,10 @@ int
831GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, 831GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
832 struct GNUNET_PeerIdentity *peer) 832 struct GNUNET_PeerIdentity *peer)
833{ 833{
834 if (uri->type != loc) 834 if (uri->type != GNUNET_FS_URI_LOC)
835 return GNUNET_SYSERR; 835 return GNUNET_SYSERR;
836 GNUNET_CRYPTO_hash (&uri->data.loc.peer, 836 GNUNET_CRYPTO_hash (&uri->data.loc.peer,
837 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 837 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
838 &peer->hashPubKey); 838 &peer->hashPubKey);
839 return GNUNET_OK; 839 return GNUNET_OK;
840} 840}
@@ -849,7 +849,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
849struct GNUNET_TIME_Absolute 849struct GNUNET_TIME_Absolute
850GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri) 850GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri)
851{ 851{
852 GNUNET_assert (uri->type == loc); 852 GNUNET_assert (uri->type == GNUNET_FS_URI_LOC);
853 return uri->data.loc.expirationTime; 853 return uri->data.loc.expirationTime;
854} 854}
855 855
@@ -866,10 +866,10 @@ GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri)
866{ 866{
867 struct GNUNET_FS_Uri *ret; 867 struct GNUNET_FS_Uri *ret;
868 868
869 if (uri->type != loc) 869 if (uri->type != GNUNET_FS_URI_LOC)
870 return NULL; 870 return NULL;
871 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 871 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
872 ret->type = chk; 872 ret->type = GNUNET_FS_URI_CHK;
873 ret->data.chk = uri->data.loc.fi; 873 ret->data.chk = uri->data.loc.fi;
874 return ret; 874 return ret;
875} 875}
@@ -889,22 +889,22 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
889 struct GNUNET_TIME_Absolute expiration_time) 889 struct GNUNET_TIME_Absolute expiration_time)
890{ 890{
891 struct GNUNET_FS_Uri *uri; 891 struct GNUNET_FS_Uri *uri;
892 struct GNUNET_CRYPTO_RsaPrivateKey *my_private_key; 892 struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
893 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key; 893 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded my_public_key;
894 char *keyfile; 894 char *keyfile;
895 struct LocUriAssembly ass; 895 struct LocUriAssembly ass;
896 896
897 if (baseUri->type != chk) 897 if (baseUri->type != GNUNET_FS_URI_CHK)
898 return NULL; 898 return NULL;
899 if (GNUNET_OK != 899 if (GNUNET_OK !=
900 GNUNET_CONFIGURATION_get_value_filename (cfg, "GNUNETD", "HOSTKEY", 900 GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER", "PRIVATE_KEY",
901 &keyfile)) 901 &keyfile))
902 { 902 {
903 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 903 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
904 _("Lacking key configuration settings.\n")); 904 _("Lacking key configuration settings.\n"));
905 return NULL; 905 return NULL;
906 } 906 }
907 if (NULL == (my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile))) 907 if (NULL == (my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile)))
908 { 908 {
909 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 909 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
910 _("Could not access hostkey file `%s'.\n"), keyfile); 910 _("Could not access hostkey file `%s'.\n"), keyfile);
@@ -912,21 +912,21 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
912 return NULL; 912 return NULL;
913 } 913 }
914 GNUNET_free (keyfile); 914 GNUNET_free (keyfile);
915 GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); 915 GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key);
916 ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); 916 ass.purpose.size = htonl (sizeof (struct LocUriAssembly));
917 ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); 917 ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT);
918 ass.exptime = GNUNET_TIME_absolute_hton (expiration_time); 918 ass.exptime = GNUNET_TIME_absolute_hton (expiration_time);
919 ass.fi = baseUri->data.chk; 919 ass.fi = baseUri->data.chk;
920 ass.peer = my_public_key; 920 ass.peer = my_public_key;
921 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 921 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
922 uri->type = loc; 922 uri->type = GNUNET_FS_URI_LOC;
923 uri->data.loc.fi = baseUri->data.chk; 923 uri->data.loc.fi = baseUri->data.chk;
924 uri->data.loc.expirationTime = expiration_time; 924 uri->data.loc.expirationTime = expiration_time;
925 uri->data.loc.peer = my_public_key; 925 uri->data.loc.peer = my_public_key;
926 GNUNET_assert (GNUNET_OK == 926 GNUNET_assert (GNUNET_OK ==
927 GNUNET_CRYPTO_rsa_sign (my_private_key, &ass.purpose, 927 GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose,
928 &uri->data.loc.contentSignature)); 928 &uri->data.loc.contentSignature));
929 GNUNET_CRYPTO_rsa_key_free (my_private_key); 929 GNUNET_CRYPTO_ecc_key_free (my_private_key);
930 return uri; 930 return uri;
931} 931}
932 932
@@ -947,7 +947,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
947 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk; 947 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk;
948 948
949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
950 ns_uri->type = sks; 950 ns_uri->type = GNUNET_FS_URI_SKS;
951 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk); 951 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk);
952 GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns); 952 GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns);
953 ns_uri->data.sks.identifier = GNUNET_strdup (id); 953 ns_uri->data.sks.identifier = GNUNET_strdup (id);
@@ -968,7 +968,7 @@ GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_HashCode * nsid, const char *i
968 struct GNUNET_FS_Uri *ns_uri; 968 struct GNUNET_FS_Uri *ns_uri;
969 969
970 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 970 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
971 ns_uri->type = sks; 971 ns_uri->type = GNUNET_FS_URI_SKS;
972 ns_uri->data.sks.ns = *nsid; 972 ns_uri->data.sks.ns = *nsid;
973 ns_uri->data.sks.identifier = GNUNET_strdup (id); 973 ns_uri->data.sks.identifier = GNUNET_strdup (id);
974 return ns_uri; 974 return ns_uri;
@@ -1002,7 +1002,7 @@ GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
1002 return GNUNET_FS_uri_dup (u2); 1002 return GNUNET_FS_uri_dup (u2);
1003 if (u2 == NULL) 1003 if (u2 == NULL)
1004 return GNUNET_FS_uri_dup (u1); 1004 return GNUNET_FS_uri_dup (u1);
1005 if ((u1->type != ksk) || (u2->type != ksk)) 1005 if ((u1->type != GNUNET_FS_URI_KSK) || (u2->type != GNUNET_FS_URI_KSK))
1006 { 1006 {
1007 GNUNET_break (0); 1007 GNUNET_break (0);
1008 return NULL; 1008 return NULL;
@@ -1027,7 +1027,7 @@ GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
1027 kl[kc++] = GNUNET_strdup (kp); 1027 kl[kc++] = GNUNET_strdup (kp);
1028 } 1028 }
1029 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 1029 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
1030 ret->type = ksk; 1030 ret->type = GNUNET_FS_URI_KSK;
1031 ret->data.ksk.keywordCount = kc; 1031 ret->data.ksk.keywordCount = kc;
1032 ret->data.ksk.keywords = kl; 1032 ret->data.ksk.keywords = kl;
1033 return ret; 1033 return ret;
@@ -1052,7 +1052,7 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri)
1052 memcpy (ret, uri, sizeof (struct GNUNET_FS_Uri)); 1052 memcpy (ret, uri, sizeof (struct GNUNET_FS_Uri));
1053 switch (ret->type) 1053 switch (ret->type)
1054 { 1054 {
1055 case ksk: 1055 case GNUNET_FS_URI_KSK:
1056 if (ret->data.ksk.keywordCount >= 1056 if (ret->data.ksk.keywordCount >=
1057 GNUNET_MAX_MALLOC_CHECKED / sizeof (char *)) 1057 GNUNET_MAX_MALLOC_CHECKED / sizeof (char *))
1058 { 1058 {
@@ -1070,10 +1070,10 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri)
1070 else 1070 else
1071 ret->data.ksk.keywords = NULL; /* just to be sure */ 1071 ret->data.ksk.keywords = NULL; /* just to be sure */
1072 break; 1072 break;
1073 case sks: 1073 case GNUNET_FS_URI_SKS:
1074 ret->data.sks.identifier = GNUNET_strdup (uri->data.sks.identifier); 1074 ret->data.sks.identifier = GNUNET_strdup (uri->data.sks.identifier);
1075 break; 1075 break;
1076 case loc: 1076 case GNUNET_FS_URI_LOC:
1077 break; 1077 break;
1078 default: 1078 default:
1079 break; 1079 break;
@@ -1218,7 +1218,7 @@ GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv)
1218 return uri; 1218 return uri;
1219 GNUNET_free_non_null (emsg); 1219 GNUNET_free_non_null (emsg);
1220 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 1220 uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
1221 uri->type = ksk; 1221 uri->type = GNUNET_FS_URI_KSK;
1222 uri->data.ksk.keywordCount = argc; 1222 uri->data.ksk.keywordCount = argc;
1223 uri->data.ksk.keywords = GNUNET_malloc (argc * sizeof (char *)); 1223 uri->data.ksk.keywords = GNUNET_malloc (argc * sizeof (char *));
1224 for (i = 0; i < argc; i++) 1224 for (i = 0; i < argc; i++)
@@ -1265,12 +1265,12 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1265 return GNUNET_NO; 1265 return GNUNET_NO;
1266 switch (u1->type) 1266 switch (u1->type)
1267 { 1267 {
1268 case chk: 1268 case GNUNET_FS_URI_CHK:
1269 if (0 == 1269 if (0 ==
1270 memcmp (&u1->data.chk, &u2->data.chk, sizeof (struct FileIdentifier))) 1270 memcmp (&u1->data.chk, &u2->data.chk, sizeof (struct FileIdentifier)))
1271 return GNUNET_YES; 1271 return GNUNET_YES;
1272 return GNUNET_NO; 1272 return GNUNET_NO;
1273 case sks: 1273 case GNUNET_FS_URI_SKS:
1274 if ((0 == 1274 if ((0 ==
1275 memcmp (&u1->data.sks.ns, &u2->data.sks.ns, 1275 memcmp (&u1->data.sks.ns, &u2->data.sks.ns,
1276 sizeof (struct GNUNET_HashCode))) && 1276 sizeof (struct GNUNET_HashCode))) &&
@@ -1278,7 +1278,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1278 1278
1279 return GNUNET_YES; 1279 return GNUNET_YES;
1280 return GNUNET_NO; 1280 return GNUNET_NO;
1281 case ksk: 1281 case GNUNET_FS_URI_KSK:
1282 if (u1->data.ksk.keywordCount != u2->data.ksk.keywordCount) 1282 if (u1->data.ksk.keywordCount != u2->data.ksk.keywordCount)
1283 return GNUNET_NO; 1283 return GNUNET_NO;
1284 for (i = 0; i < u1->data.ksk.keywordCount; i++) 1284 for (i = 0; i < u1->data.ksk.keywordCount; i++)
@@ -1296,11 +1296,11 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1296 return GNUNET_NO; 1296 return GNUNET_NO;
1297 } 1297 }
1298 return GNUNET_YES; 1298 return GNUNET_YES;
1299 case loc: 1299 case GNUNET_FS_URI_LOC:
1300 if (memcmp 1300 if (memcmp
1301 (&u1->data.loc, &u2->data.loc, 1301 (&u1->data.loc, &u2->data.loc,
1302 sizeof (struct FileIdentifier) + 1302 sizeof (struct FileIdentifier) +
1303 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 1303 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) +
1304 sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + 1304 sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) +
1305 sizeof (unsigned short)) != 0) 1305 sizeof (unsigned short)) != 0)
1306 return GNUNET_NO; 1306 return GNUNET_NO;
@@ -1320,7 +1320,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1320int 1320int
1321GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) 1321GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri)
1322{ 1322{
1323 return uri->type == sks; 1323 return uri->type == GNUNET_FS_URI_SKS;
1324} 1324}
1325 1325
1326 1326
@@ -1380,7 +1380,7 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
1380 char *name; 1380 char *name;
1381 char *unique_name; 1381 char *unique_name;
1382 1382
1383 if (uri->type != sks) 1383 if (uri->type != GNUNET_FS_URI_SKS)
1384 return NULL; 1384 return NULL;
1385 (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.ns, 1385 (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.ns,
1386 NULL, NULL, &name, NULL); 1386 NULL, NULL, &name, NULL);
@@ -1404,13 +1404,13 @@ GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri)
1404#if EXTRA_CHECKS 1404#if EXTRA_CHECKS
1405 unsigned int i; 1405 unsigned int i;
1406 1406
1407 if (uri->type == ksk) 1407 if (uri->type == GNUNET_FS_URI_KSK)
1408 { 1408 {
1409 for (i=0;i < uri->data.ksk.keywordCount; i++) 1409 for (i=0;i < uri->data.ksk.keywordCount; i++)
1410 GNUNET_assert (uri->data.ksk.keywords[i] != NULL); 1410 GNUNET_assert (uri->data.ksk.keywords[i] != NULL);
1411 } 1411 }
1412#endif 1412#endif
1413 return uri->type == ksk; 1413 return uri->type == GNUNET_FS_URI_KSK;
1414} 1414}
1415 1415
1416 1416
@@ -1423,7 +1423,7 @@ GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri)
1423int 1423int
1424GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri) 1424GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri)
1425{ 1425{
1426 return uri->type == chk; 1426 return uri->type == GNUNET_FS_URI_CHK;
1427} 1427}
1428 1428
1429 1429
@@ -1439,9 +1439,9 @@ GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri * uri)
1439{ 1439{
1440 switch (uri->type) 1440 switch (uri->type)
1441 { 1441 {
1442 case chk: 1442 case GNUNET_FS_URI_CHK:
1443 return GNUNET_ntohll (uri->data.chk.file_length); 1443 return GNUNET_ntohll (uri->data.chk.file_length);
1444 case loc: 1444 case GNUNET_FS_URI_LOC:
1445 return GNUNET_ntohll (uri->data.loc.fi.file_length); 1445 return GNUNET_ntohll (uri->data.loc.fi.file_length);
1446 default: 1446 default:
1447 GNUNET_assert (0); 1447 GNUNET_assert (0);
@@ -1459,7 +1459,7 @@ GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri * uri)
1459int 1459int
1460GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri) 1460GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri)
1461{ 1461{
1462 return uri->type == loc; 1462 return uri->type == GNUNET_FS_URI_LOC;
1463} 1463}
1464 1464
1465 1465
@@ -1806,7 +1806,7 @@ GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
1806 if (md == NULL) 1806 if (md == NULL)
1807 return NULL; 1807 return NULL;
1808 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 1808 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
1809 ret->type = ksk; 1809 ret->type = GNUNET_FS_URI_KSK;
1810 ent = GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL); 1810 ent = GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL);
1811 if (ent > 0) 1811 if (ent > 0)
1812 { 1812 {
@@ -1871,7 +1871,7 @@ uri_ksk_to_string (const struct GNUNET_FS_Uri *uri)
1871 size_t slen; 1871 size_t slen;
1872 const char *keyword; 1872 const char *keyword;
1873 1873
1874 if (uri->type != ksk) 1874 if (uri->type != GNUNET_FS_URI_KSK)
1875 return NULL; 1875 return NULL;
1876 keywords = uri->data.ksk.keywords; 1876 keywords = uri->data.ksk.keywords;
1877 keywordCount = uri->data.ksk.keywordCount; 1877 keywordCount = uri->data.ksk.keywordCount;
@@ -1936,7 +1936,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
1936 char *ret; 1936 char *ret;
1937 struct GNUNET_CRYPTO_HashAsciiEncoded nsasc; 1937 struct GNUNET_CRYPTO_HashAsciiEncoded nsasc;
1938 1938
1939 if (uri->type != sks) 1939 if (uri->type != GNUNET_FS_URI_SKS)
1940 return NULL; 1940 return NULL;
1941 ns = &uri->data.sks.ns; 1941 ns = &uri->data.sks.ns;
1942 identifier = uri->data.sks.identifier; 1942 identifier = uri->data.sks.identifier;
@@ -1961,7 +1961,7 @@ uri_chk_to_string (const struct GNUNET_FS_Uri *uri)
1961 struct GNUNET_CRYPTO_HashAsciiEncoded keyhash; 1961 struct GNUNET_CRYPTO_HashAsciiEncoded keyhash;
1962 struct GNUNET_CRYPTO_HashAsciiEncoded queryhash; 1962 struct GNUNET_CRYPTO_HashAsciiEncoded queryhash;
1963 1963
1964 if (uri->type != chk) 1964 if (uri->type != GNUNET_FS_URI_CHK)
1965 return NULL; 1965 return NULL;
1966 fi = &uri->data.chk; 1966 fi = &uri->data.chk;
1967 GNUNET_CRYPTO_hash_to_enc (&fi->chk.key, &keyhash); 1967 GNUNET_CRYPTO_hash_to_enc (&fi->chk.key, &keyhash);
@@ -2040,10 +2040,10 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri)
2040 GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); 2040 GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash);
2041 peerId = 2041 peerId =
2042 bin2enc (&uri->data.loc.peer, 2042 bin2enc (&uri->data.loc.peer,
2043 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)); 2043 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded));
2044 peerSig = 2044 peerSig =
2045 bin2enc (&uri->data.loc.contentSignature, 2045 bin2enc (&uri->data.loc.contentSignature,
2046 sizeof (struct GNUNET_CRYPTO_RsaSignature)); 2046 sizeof (struct GNUNET_CRYPTO_EccSignature));
2047 GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, 2047 GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX,
2048 GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, 2048 GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash,
2049 (const char *) &queryhash, 2049 (const char *) &queryhash,
@@ -2073,13 +2073,13 @@ GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri)
2073 } 2073 }
2074 switch (uri->type) 2074 switch (uri->type)
2075 { 2075 {
2076 case ksk: 2076 case GNUNET_FS_URI_KSK:
2077 return uri_ksk_to_string (uri); 2077 return uri_ksk_to_string (uri);
2078 case sks: 2078 case GNUNET_FS_URI_SKS:
2079 return uri_sks_to_string (uri); 2079 return uri_sks_to_string (uri);
2080 case chk: 2080 case GNUNET_FS_URI_CHK:
2081 return uri_chk_to_string (uri); 2081 return uri_chk_to_string (uri);
2082 case loc: 2082 case GNUNET_FS_URI_LOC:
2083 return uri_loc_to_string (uri); 2083 return uri_loc_to_string (uri);
2084 default: 2084 default:
2085 GNUNET_break (0); 2085 GNUNET_break (0);