diff options
Diffstat (limited to 'src/hello/hello.c')
-rw-r--r-- | src/hello/hello.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c index a85a6ee97..d2e143579 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_EccPublicKeyBinaryEncoded publicKey; | 62 | struct GNUNET_CRYPTO_EccPublicKey publicKey; |
63 | 63 | ||
64 | }; | 64 | }; |
65 | GNUNET_NETWORK_STRUCT_END | 65 | GNUNET_NETWORK_STRUCT_END |
@@ -216,8 +216,7 @@ get_hello_address_size (const char *buf, size_t max, uint16_t * ralen) | |||
216 | * @return the hello message | 216 | * @return the hello message |
217 | */ | 217 | */ |
218 | struct GNUNET_HELLO_Message * | 218 | struct GNUNET_HELLO_Message * |
219 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded | 219 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, |
220 | *publicKey, | ||
221 | GNUNET_HELLO_GenerateAddressListCallback addrgen, | 220 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
222 | void *addrgen_cls, | 221 | void *addrgen_cls, |
223 | int friend_only) | 222 | int friend_only) |
@@ -248,7 +247,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded | |||
248 | hello->friend_only = htonl (friend_only); | 247 | hello->friend_only = htonl (friend_only); |
249 | 248 | ||
250 | memcpy (&hello->publicKey, publicKey, | 249 | memcpy (&hello->publicKey, publicKey, |
251 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)); | 250 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); |
252 | memcpy (&hello[1], buffer, used); | 251 | memcpy (&hello[1], buffer, used); |
253 | return hello; | 252 | return hello; |
254 | } | 253 | } |
@@ -296,7 +295,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, | |||
296 | wpos = 0; | 295 | wpos = 0; |
297 | woff = (ret != NULL) ? (char *) &ret[1] : NULL; | 296 | woff = (ret != NULL) ? (char *) &ret[1] : NULL; |
298 | GNUNET_CRYPTO_hash (&msg->publicKey, | 297 | GNUNET_CRYPTO_hash (&msg->publicKey, |
299 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), | 298 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), |
300 | &address.peer.hashPubKey); | 299 | &address.peer.hashPubKey); |
301 | while (insize > 0) | 300 | while (insize > 0) |
302 | { | 301 | { |
@@ -531,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello) | |||
531 | */ | 530 | */ |
532 | int | 531 | int |
533 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 532 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
534 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *publicKey) | 533 | struct GNUNET_CRYPTO_EccPublicKey *publicKey) |
535 | { | 534 | { |
536 | uint16_t ret = ntohs (hello->header.size); | 535 | uint16_t ret = ntohs (hello->header.size); |
537 | 536 | ||
@@ -560,7 +559,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | |||
560 | (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) | 559 | (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) |
561 | return GNUNET_SYSERR; | 560 | return GNUNET_SYSERR; |
562 | GNUNET_CRYPTO_hash (&hello->publicKey, | 561 | GNUNET_CRYPTO_hash (&hello->publicKey, |
563 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), | 562 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), |
564 | &peer->hashPubKey); | 563 | &peer->hashPubKey); |
565 | return GNUNET_OK; | 564 | return GNUNET_OK; |
566 | } | 565 | } |
@@ -672,7 +671,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | |||
672 | 671 | ||
673 | if (0 != | 672 | if (0 != |
674 | memcmp (&h1->publicKey, &h2->publicKey, | 673 | memcmp (&h1->publicKey, &h2->publicKey, |
675 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) | 674 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) |
676 | return GNUNET_TIME_UNIT_ZERO_ABS; | 675 | return GNUNET_TIME_UNIT_ZERO_ABS; |
677 | ec.expiration_limit = now; | 676 | ec.expiration_limit = now; |
678 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; | 677 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; |
@@ -1047,7 +1046,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer) | |||
1047 | */ | 1046 | */ |
1048 | int | 1047 | int |
1049 | GNUNET_HELLO_parse_uri (const char *uri, | 1048 | GNUNET_HELLO_parse_uri (const char *uri, |
1050 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *pubkey, | 1049 | struct GNUNET_CRYPTO_EccPublicKey *pubkey, |
1051 | struct GNUNET_HELLO_Message **hello, | 1050 | struct GNUNET_HELLO_Message **hello, |
1052 | GNUNET_HELLO_TransportPluginsFind plugins_find) | 1051 | GNUNET_HELLO_TransportPluginsFind plugins_find) |
1053 | { | 1052 | { |