aboutsummaryrefslogtreecommitdiff
path: root/src/hello
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-13 12:00:01 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-13 12:00:01 +0000
commita35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae (patch)
treeb7768c5cb22e8a4f84d51cbd06dc04861fdb8510 /src/hello
parent95d42fdcb47eedcf2747614a22dacd676bc7faae (diff)
downloadgnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.tar.gz
gnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.zip
splitting 'struct GNUNET_CRYPTO_EccPublicKey' into one struct for signing and another for encryption
Diffstat (limited to 'src/hello')
-rw-r--r--src/hello/gnunet-hello.c2
-rw-r--r--src/hello/hello.c16
-rw-r--r--src/hello/test_friend_hello.c4
-rw-r--r--src/hello/test_hello.c4
4 files changed, 13 insertions, 13 deletions
diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c
index f73d3245a..f96a999b8 100644
--- a/src/hello/gnunet-hello.c
+++ b/src/hello/gnunet-hello.c
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
111 struct GNUNET_DISK_FileHandle *fh; 111 struct GNUNET_DISK_FileHandle *fh;
112 struct GNUNET_HELLO_Message *orig; 112 struct GNUNET_HELLO_Message *orig;
113 struct GNUNET_HELLO_Message *result; 113 struct GNUNET_HELLO_Message *result;
114 struct GNUNET_CRYPTO_EccPublicKey pk; 114 struct GNUNET_CRYPTO_EccPublicSignKey pk;
115 uint64_t fsize; 115 uint64_t fsize;
116 address_count = 0; 116 address_count = 0;
117 117
diff --git a/src/hello/hello.c b/src/hello/hello.c
index a6fe6102f..780c1f127 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_EccPublicKey publicKey; 62 struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
63 63
64}; 64};
65GNUNET_NETWORK_STRUCT_END 65GNUNET_NETWORK_STRUCT_END
@@ -216,7 +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 */
218struct GNUNET_HELLO_Message * 218struct GNUNET_HELLO_Message *
219GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, 219GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey,
220 GNUNET_HELLO_GenerateAddressListCallback addrgen, 220 GNUNET_HELLO_GenerateAddressListCallback addrgen,
221 void *addrgen_cls, 221 void *addrgen_cls,
222 int friend_only) 222 int friend_only)
@@ -247,7 +247,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey,
247 hello->friend_only = htonl (friend_only); 247 hello->friend_only = htonl (friend_only);
248 248
249 memcpy (&hello->publicKey, publicKey, 249 memcpy (&hello->publicKey, publicKey,
250 sizeof (struct GNUNET_CRYPTO_EccPublicKey)); 250 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
251 memcpy (&hello[1], buffer, used); 251 memcpy (&hello[1], buffer, used);
252 return hello; 252 return hello;
253} 253}
@@ -295,7 +295,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
295 wpos = 0; 295 wpos = 0;
296 woff = (ret != NULL) ? (char *) &ret[1] : NULL; 296 woff = (ret != NULL) ? (char *) &ret[1] : NULL;
297 GNUNET_CRYPTO_hash (&msg->publicKey, 297 GNUNET_CRYPTO_hash (&msg->publicKey,
298 sizeof (struct GNUNET_CRYPTO_EccPublicKey), 298 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
299 &address.peer.hashPubKey); 299 &address.peer.hashPubKey);
300 while (insize > 0) 300 while (insize > 0)
301 { 301 {
@@ -530,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello)
530 */ 530 */
531int 531int
532GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, 532GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
533 struct GNUNET_CRYPTO_EccPublicKey *publicKey) 533 struct GNUNET_CRYPTO_EccPublicSignKey *publicKey)
534{ 534{
535 uint16_t ret = ntohs (hello->header.size); 535 uint16_t ret = ntohs (hello->header.size);
536 536
@@ -559,7 +559,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
559 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) 559 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO))
560 return GNUNET_SYSERR; 560 return GNUNET_SYSERR;
561 GNUNET_CRYPTO_hash (&hello->publicKey, 561 GNUNET_CRYPTO_hash (&hello->publicKey,
562 sizeof (struct GNUNET_CRYPTO_EccPublicKey), 562 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
563 &peer->hashPubKey); 563 &peer->hashPubKey);
564 return GNUNET_OK; 564 return GNUNET_OK;
565} 565}
@@ -671,7 +671,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
671 671
672 if (0 != 672 if (0 !=
673 memcmp (&h1->publicKey, &h2->publicKey, 673 memcmp (&h1->publicKey, &h2->publicKey,
674 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) 674 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))
675 return GNUNET_TIME_UNIT_ZERO_ABS; 675 return GNUNET_TIME_UNIT_ZERO_ABS;
676 ec.expiration_limit = now; 676 ec.expiration_limit = now;
677 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; 677 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -1046,7 +1046,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer)
1046 */ 1046 */
1047int 1047int
1048GNUNET_HELLO_parse_uri (const char *uri, 1048GNUNET_HELLO_parse_uri (const char *uri,
1049 struct GNUNET_CRYPTO_EccPublicKey *pubkey, 1049 struct GNUNET_CRYPTO_EccPublicSignKey *pubkey,
1050 struct GNUNET_HELLO_Message **hello, 1050 struct GNUNET_HELLO_Message **hello,
1051 GNUNET_HELLO_TransportPluginsFind plugins_find) 1051 GNUNET_HELLO_TransportPluginsFind plugins_find)
1052{ 1052{
diff --git a/src/hello/test_friend_hello.c b/src/hello/test_friend_hello.c
index 7d0348339..d5f75c824 100644
--- a/src/hello/test_friend_hello.c
+++ b/src/hello/test_friend_hello.c
@@ -93,8 +93,8 @@ main (int argc, char *argv[])
93 struct GNUNET_HELLO_Message *msg1; 93 struct GNUNET_HELLO_Message *msg1;
94 struct GNUNET_HELLO_Message *msg2; 94 struct GNUNET_HELLO_Message *msg2;
95 struct GNUNET_HELLO_Message *msg3; 95 struct GNUNET_HELLO_Message *msg3;
96 struct GNUNET_CRYPTO_EccPublicKey publicKey; 96 struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
97 struct GNUNET_CRYPTO_EccPublicKey pk; 97 struct GNUNET_CRYPTO_EccPublicSignKey pk;
98 struct GNUNET_TIME_Absolute startup_time; 98 struct GNUNET_TIME_Absolute startup_time;
99 unsigned int i; 99 unsigned int i;
100 100
diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c
index 67f7318b2..f1fa8234a 100644
--- a/src/hello/test_hello.c
+++ b/src/hello/test_hello.c
@@ -93,8 +93,8 @@ main (int argc, char *argv[])
93 struct GNUNET_HELLO_Message *msg1; 93 struct GNUNET_HELLO_Message *msg1;
94 struct GNUNET_HELLO_Message *msg2; 94 struct GNUNET_HELLO_Message *msg2;
95 struct GNUNET_HELLO_Message *msg3; 95 struct GNUNET_HELLO_Message *msg3;
96 struct GNUNET_CRYPTO_EccPublicKey publicKey; 96 struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
97 struct GNUNET_CRYPTO_EccPublicKey pk; 97 struct GNUNET_CRYPTO_EccPublicSignKey pk;
98 struct GNUNET_TIME_Absolute startup_time; 98 struct GNUNET_TIME_Absolute startup_time;
99 unsigned int i; 99 unsigned int i;
100 100