aboutsummaryrefslogtreecommitdiff
path: root/src/hello/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hello/hello.c')
-rw-r--r--src/hello/hello.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c
index becc4da96..a20e8992c 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -59,7 +59,7 @@ struct GNUNET_HELLO_Message
59 /** 59 /**
60 * The public key of the peer. 60 * The public key of the peer.
61 */ 61 */
62 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey; 62 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded publicKey;
63 63
64}; 64};
65GNUNET_NETWORK_STRUCT_END 65GNUNET_NETWORK_STRUCT_END
@@ -201,7 +201,7 @@ get_hello_address_size (const char *buf, size_t max, uint16_t * ralen)
201 * @return the hello message 201 * @return the hello message
202 */ 202 */
203struct GNUNET_HELLO_Message * 203struct GNUNET_HELLO_Message *
204GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 204GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
205 *publicKey, 205 *publicKey,
206 GNUNET_HELLO_GenerateAddressListCallback addrgen, 206 GNUNET_HELLO_GenerateAddressListCallback addrgen,
207 void *addrgen_cls) 207 void *addrgen_cls)
@@ -227,7 +227,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
227 hello->header.type = htons (GNUNET_MESSAGE_TYPE_HELLO); 227 hello->header.type = htons (GNUNET_MESSAGE_TYPE_HELLO);
228 hello->header.size = htons (sizeof (struct GNUNET_HELLO_Message) + used); 228 hello->header.size = htons (sizeof (struct GNUNET_HELLO_Message) + used);
229 memcpy (&hello->publicKey, publicKey, 229 memcpy (&hello->publicKey, publicKey,
230 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)); 230 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded));
231 memcpy (&hello[1], buffer, used); 231 memcpy (&hello[1], buffer, used);
232 return hello; 232 return hello;
233} 233}
@@ -274,7 +274,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
274 wpos = 0; 274 wpos = 0;
275 woff = (ret != NULL) ? (char *) &ret[1] : NULL; 275 woff = (ret != NULL) ? (char *) &ret[1] : NULL;
276 GNUNET_CRYPTO_hash (&msg->publicKey, 276 GNUNET_CRYPTO_hash (&msg->publicKey,
277 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 277 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
278 &address.peer.hashPubKey); 278 &address.peer.hashPubKey);
279 while (insize > 0) 279 while (insize > 0)
280 { 280 {
@@ -503,7 +503,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello)
503 */ 503 */
504int 504int
505GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, 505GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
506 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey) 506 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *publicKey)
507{ 507{
508 uint16_t ret = ntohs (hello->header.size); 508 uint16_t ret = ntohs (hello->header.size);
509 509
@@ -532,7 +532,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
532 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) 532 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO))
533 return GNUNET_SYSERR; 533 return GNUNET_SYSERR;
534 GNUNET_CRYPTO_hash (&hello->publicKey, 534 GNUNET_CRYPTO_hash (&hello->publicKey,
535 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 535 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
536 &peer->hashPubKey); 536 &peer->hashPubKey);
537 return GNUNET_OK; 537 return GNUNET_OK;
538} 538}
@@ -641,7 +641,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
641 641
642 if (0 != 642 if (0 !=
643 memcmp (&h1->publicKey, &h2->publicKey, 643 memcmp (&h1->publicKey, &h2->publicKey,
644 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) 644 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))
645 return GNUNET_TIME_UNIT_ZERO_ABS; 645 return GNUNET_TIME_UNIT_ZERO_ABS;
646 ec.expiration_limit = now; 646 ec.expiration_limit = now;
647 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; 647 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -833,7 +833,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
833 struct GNUNET_HELLO_ComposeUriContext ctx; 833 struct GNUNET_HELLO_ComposeUriContext ctx;
834 ctx.plugins_find = plugins_find; 834 ctx.plugins_find = plugins_find;
835 835
836 char *pkey = GNUNET_CRYPTO_rsa_public_key_to_string (&(hello->publicKey)); 836 char *pkey = GNUNET_CRYPTO_ecc_public_key_to_string (&(hello->publicKey));
837 GNUNET_asprintf (&(ctx.uri), 837 GNUNET_asprintf (&(ctx.uri),
838 "%s%s", 838 "%s%s",
839 GNUNET_HELLO_URI_PREFIX, 839 GNUNET_HELLO_URI_PREFIX,
@@ -1005,7 +1005,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer)
1005 */ 1005 */
1006int 1006int
1007GNUNET_HELLO_parse_uri (const char *uri, 1007GNUNET_HELLO_parse_uri (const char *uri,
1008 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey, 1008 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *pubkey,
1009 struct GNUNET_HELLO_Message **hello, 1009 struct GNUNET_HELLO_Message **hello,
1010 GNUNET_HELLO_TransportPluginsFind plugins_find) 1010 GNUNET_HELLO_TransportPluginsFind plugins_find)
1011{ 1011{