aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/fs_uri.c')
-rw-r--r--src/fs/fs_uri.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 23a368261..67ce6d530 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -118,7 +118,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
118 case GNUNET_FS_URI_LOC: 118 case GNUNET_FS_URI_LOC:
119 GNUNET_CRYPTO_hash (&uri->data.loc.fi, 119 GNUNET_CRYPTO_hash (&uri->data.loc.fi,
120 sizeof (struct FileIdentifier) + 120 sizeof (struct FileIdentifier) +
121 sizeof (struct GNUNET_CRYPTO_EccPublicKey), 121 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
122 key); 122 key);
123 break; 123 break;
124 default: 124 default:
@@ -357,7 +357,7 @@ static struct GNUNET_FS_Uri *
357uri_sks_parse (const char *s, char **emsg) 357uri_sks_parse (const char *s, char **emsg)
358{ 358{
359 struct GNUNET_FS_Uri *ret; 359 struct GNUNET_FS_Uri *ret;
360 struct GNUNET_CRYPTO_EccPublicKey ns; 360 struct GNUNET_CRYPTO_EccPublicSignKey ns;
361 size_t pos; 361 size_t pos;
362 char *end; 362 char *end;
363 363
@@ -532,7 +532,7 @@ struct LocUriAssembly
532 /** 532 /**
533 * Peer offering the file. 533 * Peer offering the file.
534 */ 534 */
535 struct GNUNET_CRYPTO_EccPublicKey peer; 535 struct GNUNET_CRYPTO_EccPublicSignKey peer;
536 536
537}; 537};
538GNUNET_NETWORK_STRUCT_END 538GNUNET_NETWORK_STRUCT_END
@@ -604,7 +604,7 @@ uri_loc_parse (const char *s, char **emsg)
604 npos++; 604 npos++;
605 ret = 605 ret =
606 enc2bin (&s[npos], &ass.peer, 606 enc2bin (&s[npos], &ass.peer,
607 sizeof (struct GNUNET_CRYPTO_EccPublicKey)); 607 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
608 if (ret == -1) 608 if (ret == -1)
609 { 609 {
610 *emsg = 610 *emsg =
@@ -841,7 +841,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
841 if (uri->type != GNUNET_FS_URI_LOC) 841 if (uri->type != GNUNET_FS_URI_LOC)
842 return GNUNET_SYSERR; 842 return GNUNET_SYSERR;
843 GNUNET_CRYPTO_hash (&uri->data.loc.peer, 843 GNUNET_CRYPTO_hash (&uri->data.loc.peer,
844 sizeof (struct GNUNET_CRYPTO_EccPublicKey), 844 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
845 &peer->hashPubKey); 845 &peer->hashPubKey);
846 return GNUNET_OK; 846 return GNUNET_OK;
847} 847}
@@ -897,7 +897,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
897{ 897{
898 struct GNUNET_FS_Uri *uri; 898 struct GNUNET_FS_Uri *uri;
899 struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; 899 struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
900 struct GNUNET_CRYPTO_EccPublicKey my_public_key; 900 struct GNUNET_CRYPTO_EccPublicSignKey my_public_key;
901 char *keyfile; 901 char *keyfile;
902 struct LocUriAssembly ass; 902 struct LocUriAssembly ass;
903 struct GNUNET_TIME_Absolute et; 903 struct GNUNET_TIME_Absolute et;
@@ -922,7 +922,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
922 GNUNET_free (keyfile); 922 GNUNET_free (keyfile);
923 /* we round expiration time to full seconds for SKS URIs */ 923 /* we round expiration time to full seconds for SKS URIs */
924 et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; 924 et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL;
925 GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); 925 GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key);
926 ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); 926 ass.purpose.size = htonl (sizeof (struct LocUriAssembly));
927 ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); 927 ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT);
928 ass.exptime = GNUNET_TIME_absolute_hton (et); 928 ass.exptime = GNUNET_TIME_absolute_hton (et);
@@ -949,7 +949,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
949 * @return an FS URI for the given namespace and identifier 949 * @return an FS URI for the given namespace and identifier
950 */ 950 */
951struct GNUNET_FS_Uri * 951struct GNUNET_FS_Uri *
952GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, 952GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
953 const char *id) 953 const char *id)
954{ 954{
955 struct GNUNET_FS_Uri *ns_uri; 955 struct GNUNET_FS_Uri *ns_uri;
@@ -1260,7 +1260,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1260 case GNUNET_FS_URI_SKS: 1260 case GNUNET_FS_URI_SKS:
1261 if ((0 == 1261 if ((0 ==
1262 memcmp (&u1->data.sks.ns, &u2->data.sks.ns, 1262 memcmp (&u1->data.sks.ns, &u2->data.sks.ns,
1263 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) && 1263 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) &&
1264 (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) 1264 (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier)))
1265 1265
1266 return GNUNET_YES; 1266 return GNUNET_YES;
@@ -1287,7 +1287,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1287 if (memcmp 1287 if (memcmp
1288 (&u1->data.loc, &u2->data.loc, 1288 (&u1->data.loc, &u2->data.loc,
1289 sizeof (struct FileIdentifier) + 1289 sizeof (struct FileIdentifier) +
1290 sizeof (struct GNUNET_CRYPTO_EccPublicKey) + 1290 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
1291 sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + 1291 sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) +
1292 sizeof (unsigned short)) != 0) 1292 sizeof (unsigned short)) != 0)
1293 return GNUNET_NO; 1293 return GNUNET_NO;
@@ -1321,7 +1321,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri)
1321 */ 1321 */
1322int 1322int
1323GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, 1323GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
1324 struct GNUNET_CRYPTO_EccPublicKey *pseudonym) 1324 struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym)
1325{ 1325{
1326 if (!GNUNET_FS_uri_test_sks (uri)) 1326 if (!GNUNET_FS_uri_test_sks (uri))
1327 { 1327 {
@@ -1896,7 +1896,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
1896 if (GNUNET_FS_URI_SKS != uri->type) 1896 if (GNUNET_FS_URI_SKS != uri->type)
1897 return NULL; 1897 return NULL;
1898 ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, 1898 ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns,
1899 sizeof (struct GNUNET_CRYPTO_EccPublicKey), 1899 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
1900 buf, 1900 buf,
1901 sizeof (buf)); 1901 sizeof (buf));
1902 GNUNET_assert (NULL != ret); 1902 GNUNET_assert (NULL != ret);
@@ -2001,7 +2001,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri)
2001 GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); 2001 GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash);
2002 peerId = 2002 peerId =
2003 bin2enc (&uri->data.loc.peer, 2003 bin2enc (&uri->data.loc.peer,
2004 sizeof (struct GNUNET_CRYPTO_EccPublicKey)); 2004 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
2005 peerSig = 2005 peerSig =
2006 bin2enc (&uri->data.loc.contentSignature, 2006 bin2enc (&uri->data.loc.contentSignature,
2007 sizeof (struct GNUNET_CRYPTO_EccSignature)); 2007 sizeof (struct GNUNET_CRYPTO_EccSignature));