diff options
Diffstat (limited to 'src/multicast')
-rw-r--r-- | src/multicast/gnunet-service-multicast.c | 72 | ||||
-rw-r--r-- | src/multicast/multicast.h | 12 | ||||
-rw-r--r-- | src/multicast/multicast_api.c | 18 | ||||
-rw-r--r-- | src/multicast/test_multicast.c | 2 |
4 files changed, 53 insertions, 51 deletions
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c index 4d2868669..39789360c 100644 --- a/src/multicast/gnunet-service-multicast.c +++ b/src/multicast/gnunet-service-multicast.c | |||
@@ -157,17 +157,17 @@ struct Channel | |||
157 | /** | 157 | /** |
158 | * Public key of the target group. | 158 | * Public key of the target group. |
159 | */ | 159 | */ |
160 | struct GNUNET_CRYPTO_EddsaPublicKey group_key; | 160 | struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; |
161 | 161 | ||
162 | /** | 162 | /** |
163 | * Hash of @a group_key. | 163 | * Hash of @a group_pub_key. |
164 | */ | 164 | */ |
165 | struct GNUNET_HashCode group_key_hash; | 165 | struct GNUNET_HashCode group_pub_hash; |
166 | 166 | ||
167 | /** | 167 | /** |
168 | * Public key of the joining member. | 168 | * Public key of the joining member. |
169 | */ | 169 | */ |
170 | struct GNUNET_CRYPTO_EcdsaPublicKey member_key; | 170 | struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * Remote peer identity. | 173 | * Remote peer identity. |
@@ -735,7 +735,7 @@ cadet_notify_transmit_ready (void *cls, size_t buf_size, void *buf) | |||
735 | } | 735 | } |
736 | else if (0 == --chn->msgs_pending) | 736 | else if (0 == --chn->msgs_pending) |
737 | { | 737 | { |
738 | client_send_ack (&chn->group_key_hash); | 738 | client_send_ack (&chn->group_pub_hash); |
739 | } | 739 | } |
740 | return msg_size; | 740 | return msg_size; |
741 | } | 741 | } |
@@ -770,10 +770,10 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg) | |||
770 | * | 770 | * |
771 | * @param peer | 771 | * @param peer |
772 | * Peer to connect to. | 772 | * Peer to connect to. |
773 | * @param group_key | 773 | * @param group_pub_key |
774 | * Public key of group the channel belongs to. | 774 | * Public key of group the channel belongs to. |
775 | * @param group_key_hash | 775 | * @param group_pub_hash |
776 | * Hash of @a group_key. | 776 | * Hash of @a group_pub_key. |
777 | * | 777 | * |
778 | * @return Channel. | 778 | * @return Channel. |
779 | */ | 779 | */ |
@@ -782,15 +782,15 @@ cadet_channel_create (struct Group *grp, struct GNUNET_PeerIdentity *peer) | |||
782 | { | 782 | { |
783 | struct Channel *chn = GNUNET_malloc (sizeof (*chn)); | 783 | struct Channel *chn = GNUNET_malloc (sizeof (*chn)); |
784 | chn->grp = grp; | 784 | chn->grp = grp; |
785 | chn->group_key = grp->pub_key; | 785 | chn->group_pub_key = grp->pub_key; |
786 | chn->group_key_hash = grp->pub_key_hash; | 786 | chn->group_pub_hash = grp->pub_key_hash; |
787 | chn->peer = *peer; | 787 | chn->peer = *peer; |
788 | chn->direction = DIR_OUTGOING; | 788 | chn->direction = DIR_OUTGOING; |
789 | chn->join_status = JOIN_WAITING; | 789 | chn->join_status = JOIN_WAITING; |
790 | chn->channel = GNUNET_CADET_channel_create (cadet, chn, &chn->peer, | 790 | chn->channel = GNUNET_CADET_channel_create (cadet, chn, &chn->peer, |
791 | GNUNET_APPLICATION_TYPE_MULTICAST, | 791 | GNUNET_APPLICATION_TYPE_MULTICAST, |
792 | GNUNET_CADET_OPTION_RELIABLE); | 792 | GNUNET_CADET_OPTION_RELIABLE); |
793 | GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_key_hash, chn, | 793 | GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_pub_hash, chn, |
794 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 794 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
795 | return chn; | 795 | return chn; |
796 | } | 796 | } |
@@ -817,13 +817,13 @@ cadet_send_join_request (struct Member *mem) | |||
817 | 817 | ||
818 | static int | 818 | static int |
819 | cadet_send_join_decision_cb (void *cls, | 819 | cadet_send_join_decision_cb (void *cls, |
820 | const struct GNUNET_HashCode *group_key_hash, | 820 | const struct GNUNET_HashCode *group_pub_hash, |
821 | void *channel) | 821 | void *channel) |
822 | { | 822 | { |
823 | const struct MulticastJoinDecisionMessageHeader *hdcsn = cls; | 823 | const struct MulticastJoinDecisionMessageHeader *hdcsn = cls; |
824 | struct Channel *chn = channel; | 824 | struct Channel *chn = channel; |
825 | 825 | ||
826 | if (0 == memcmp (&hdcsn->member_key, &chn->member_key, sizeof (chn->member_key)) | 826 | if (0 == memcmp (&hdcsn->member_pub_key, &chn->member_pub_key, sizeof (chn->member_pub_key)) |
827 | && 0 == memcmp (&hdcsn->peer, &chn->peer, sizeof (chn->peer))) | 827 | && 0 == memcmp (&hdcsn->peer, &chn->peer, sizeof (chn->peer))) |
828 | { | 828 | { |
829 | cadet_send_channel (chn, &hdcsn->header); | 829 | cadet_send_channel (chn, &hdcsn->header); |
@@ -958,7 +958,7 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, | |||
958 | 958 | ||
959 | GNUNET_CRYPTO_ecdsa_key_get_public (&msg->member_key, &mem_pub_key); | 959 | GNUNET_CRYPTO_ecdsa_key_get_public (&msg->member_key, &mem_pub_key); |
960 | GNUNET_CRYPTO_hash (&mem_pub_key, sizeof (mem_pub_key), &mem_pub_key_hash); | 960 | GNUNET_CRYPTO_hash (&mem_pub_key, sizeof (mem_pub_key), &mem_pub_key_hash); |
961 | GNUNET_CRYPTO_hash (&msg->group_key, sizeof (msg->group_key), &pub_key_hash); | 961 | GNUNET_CRYPTO_hash (&msg->group_pub_key, sizeof (msg->group_pub_key), &pub_key_hash); |
962 | 962 | ||
963 | struct GNUNET_CONTAINER_MultiHashMap * | 963 | struct GNUNET_CONTAINER_MultiHashMap * |
964 | grp_mem = GNUNET_CONTAINER_multihashmap_get (group_members, &pub_key_hash); | 964 | grp_mem = GNUNET_CONTAINER_multihashmap_get (group_members, &pub_key_hash); |
@@ -979,7 +979,7 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, | |||
979 | 979 | ||
980 | grp = &mem->grp; | 980 | grp = &mem->grp; |
981 | grp->is_origin = GNUNET_NO; | 981 | grp->is_origin = GNUNET_NO; |
982 | grp->pub_key = msg->group_key; | 982 | grp->pub_key = msg->group_pub_key; |
983 | grp->pub_key_hash = pub_key_hash; | 983 | grp->pub_key_hash = pub_key_hash; |
984 | 984 | ||
985 | if (NULL == grp_mem) | 985 | if (NULL == grp_mem) |
@@ -1046,13 +1046,13 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, | |||
1046 | req = GNUNET_malloc (sizeof (*req) + join_msg_size); | 1046 | req = GNUNET_malloc (sizeof (*req) + join_msg_size); |
1047 | req->header.size = htons (sizeof (*req) + join_msg_size); | 1047 | req->header.size = htons (sizeof (*req) + join_msg_size); |
1048 | req->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST); | 1048 | req->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST); |
1049 | req->group_key = grp->pub_key; | 1049 | req->group_pub_key = grp->pub_key; |
1050 | req->peer = this_peer; | 1050 | req->peer = this_peer; |
1051 | GNUNET_CRYPTO_ecdsa_key_get_public (&mem->priv_key, &req->member_key); | 1051 | GNUNET_CRYPTO_ecdsa_key_get_public (&mem->priv_key, &req->member_pub_key); |
1052 | if (0 < join_msg_size) | 1052 | if (0 < join_msg_size) |
1053 | memcpy (&req[1], join_msg, join_msg_size); | 1053 | memcpy (&req[1], join_msg, join_msg_size); |
1054 | 1054 | ||
1055 | req->member_key = mem->pub_key; | 1055 | req->member_pub_key = mem->pub_key; |
1056 | req->purpose.size = htonl (msg_size | 1056 | req->purpose.size = htonl (msg_size |
1057 | - sizeof (req->header) | 1057 | - sizeof (req->header) |
1058 | - sizeof (req->reserved) | 1058 | - sizeof (req->reserved) |
@@ -1128,7 +1128,7 @@ client_recv_join_decision (void *cls, struct GNUNET_SERVER_Client *client, | |||
1128 | if (NULL != grp_mem) | 1128 | if (NULL != grp_mem) |
1129 | { | 1129 | { |
1130 | struct GNUNET_HashCode member_key_hash; | 1130 | struct GNUNET_HashCode member_key_hash; |
1131 | GNUNET_CRYPTO_hash (&hdcsn->member_key, sizeof (hdcsn->member_key), | 1131 | GNUNET_CRYPTO_hash (&hdcsn->member_pub_key, sizeof (hdcsn->member_pub_key), |
1132 | &member_key_hash); | 1132 | &member_key_hash); |
1133 | mem = GNUNET_CONTAINER_multihashmap_get (grp_mem, &member_key_hash); | 1133 | mem = GNUNET_CONTAINER_multihashmap_get (grp_mem, &member_key_hash); |
1134 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1134 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1215,11 +1215,11 @@ client_recv_multicast_request (void *cls, struct GNUNET_SERVER_Client *client, | |||
1215 | 1215 | ||
1216 | /* FIXME: yucky, should use separate message structs for P2P and CS! */ | 1216 | /* FIXME: yucky, should use separate message structs for P2P and CS! */ |
1217 | out = (struct GNUNET_MULTICAST_RequestHeader *) GNUNET_copy_message (m); | 1217 | out = (struct GNUNET_MULTICAST_RequestHeader *) GNUNET_copy_message (m); |
1218 | out->member_key = mem->pub_key; | 1218 | out->member_pub_key = mem->pub_key; |
1219 | out->fragment_id = GNUNET_ntohll (++mem->max_fragment_id); | 1219 | out->fragment_id = GNUNET_ntohll (++mem->max_fragment_id); |
1220 | out->purpose.size = htonl (ntohs (out->header.size) | 1220 | out->purpose.size = htonl (ntohs (out->header.size) |
1221 | - sizeof (out->header) | 1221 | - sizeof (out->header) |
1222 | - sizeof (out->member_key) | 1222 | - sizeof (out->member_pub_key) |
1223 | - sizeof (out->signature)); | 1223 | - sizeof (out->signature)); |
1224 | out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST); | 1224 | out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST); |
1225 | 1225 | ||
@@ -1551,26 +1551,26 @@ cadet_recv_join_request (void *cls, | |||
1551 | if (GNUNET_OK != | 1551 | if (GNUNET_OK != |
1552 | GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, | 1552 | GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, |
1553 | &req->purpose, &req->signature, | 1553 | &req->purpose, &req->signature, |
1554 | &req->member_key)) | 1554 | &req->member_pub_key)) |
1555 | { | 1555 | { |
1556 | GNUNET_break_op (0); | 1556 | GNUNET_break_op (0); |
1557 | return GNUNET_SYSERR; | 1557 | return GNUNET_SYSERR; |
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | struct GNUNET_HashCode group_key_hash; | 1560 | struct GNUNET_HashCode group_pub_hash; |
1561 | GNUNET_CRYPTO_hash (&req->group_key, sizeof (req->group_key), &group_key_hash); | 1561 | GNUNET_CRYPTO_hash (&req->group_pub_key, sizeof (req->group_pub_key), &group_pub_hash); |
1562 | 1562 | ||
1563 | struct Channel *chn = GNUNET_malloc (sizeof *chn); | 1563 | struct Channel *chn = GNUNET_malloc (sizeof *chn); |
1564 | chn->channel = channel; | 1564 | chn->channel = channel; |
1565 | chn->group_key = req->group_key; | 1565 | chn->group_pub_key = req->group_pub_key; |
1566 | chn->group_key_hash = group_key_hash; | 1566 | chn->group_pub_hash = group_pub_hash; |
1567 | chn->member_key = req->member_key; | 1567 | chn->member_pub_key = req->member_pub_key; |
1568 | chn->peer = req->peer; | 1568 | chn->peer = req->peer; |
1569 | chn->join_status = JOIN_WAITING; | 1569 | chn->join_status = JOIN_WAITING; |
1570 | GNUNET_CONTAINER_multihashmap_put (channels_in, &chn->group_key_hash, chn, | 1570 | GNUNET_CONTAINER_multihashmap_put (channels_in, &chn->group_pub_hash, chn, |
1571 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 1571 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
1572 | 1572 | ||
1573 | client_send_all (&group_key_hash, m); | 1573 | client_send_all (&group_pub_hash, m); |
1574 | return GNUNET_OK; | 1574 | return GNUNET_OK; |
1575 | } | 1575 | } |
1576 | 1576 | ||
@@ -1670,13 +1670,13 @@ cadet_recv_message (void *cls, | |||
1670 | if (GNUNET_OK != | 1670 | if (GNUNET_OK != |
1671 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE, | 1671 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE, |
1672 | &msg->purpose, &msg->signature, | 1672 | &msg->purpose, &msg->signature, |
1673 | &chn->group_key)) | 1673 | &chn->group_pub_key)) |
1674 | { | 1674 | { |
1675 | GNUNET_break_op (0); | 1675 | GNUNET_break_op (0); |
1676 | return GNUNET_SYSERR; | 1676 | return GNUNET_SYSERR; |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | client_send_all (&chn->group_key_hash, m); | 1679 | client_send_all (&chn->group_pub_hash, m); |
1680 | return GNUNET_OK; | 1680 | return GNUNET_OK; |
1681 | } | 1681 | } |
1682 | 1682 | ||
@@ -1706,7 +1706,7 @@ cadet_recv_request (void *cls, | |||
1706 | } | 1706 | } |
1707 | if (ntohl (req->purpose.size) != (size | 1707 | if (ntohl (req->purpose.size) != (size |
1708 | - sizeof (req->header) | 1708 | - sizeof (req->header) |
1709 | - sizeof (req->member_key) | 1709 | - sizeof (req->member_pub_key) |
1710 | - sizeof (req->signature))) | 1710 | - sizeof (req->signature))) |
1711 | { | 1711 | { |
1712 | GNUNET_break_op (0); | 1712 | GNUNET_break_op (0); |
@@ -1715,13 +1715,13 @@ cadet_recv_request (void *cls, | |||
1715 | if (GNUNET_OK != | 1715 | if (GNUNET_OK != |
1716 | GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, | 1716 | GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, |
1717 | &req->purpose, &req->signature, | 1717 | &req->purpose, &req->signature, |
1718 | &req->member_key)) | 1718 | &req->member_pub_key)) |
1719 | { | 1719 | { |
1720 | GNUNET_break_op (0); | 1720 | GNUNET_break_op (0); |
1721 | return GNUNET_SYSERR; | 1721 | return GNUNET_SYSERR; |
1722 | } | 1722 | } |
1723 | 1723 | ||
1724 | client_send_origin (&chn->group_key_hash, m); | 1724 | client_send_origin (&chn->group_pub_hash, m); |
1725 | return GNUNET_OK; | 1725 | return GNUNET_OK; |
1726 | } | 1726 | } |
1727 | 1727 | ||
@@ -1745,7 +1745,7 @@ cadet_recv_replay_request (void *cls, | |||
1745 | struct Channel *chn = *ctx; | 1745 | struct Channel *chn = *ctx; |
1746 | 1746 | ||
1747 | memcpy (&rep, m, sizeof (rep)); | 1747 | memcpy (&rep, m, sizeof (rep)); |
1748 | memcpy (&rep.member_key, &chn->member_key, sizeof (chn->member_key)); | 1748 | memcpy (&rep.member_pub_key, &chn->member_pub_key, sizeof (chn->member_pub_key)); |
1749 | 1749 | ||
1750 | struct GNUNET_CONTAINER_MultiHashMap * | 1750 | struct GNUNET_CONTAINER_MultiHashMap * |
1751 | grp_replay_req = GNUNET_CONTAINER_multihashmap_get (replay_req_cadet, | 1751 | grp_replay_req = GNUNET_CONTAINER_multihashmap_get (replay_req_cadet, |
@@ -1763,7 +1763,7 @@ cadet_recv_replay_request (void *cls, | |||
1763 | GNUNET_CONTAINER_multihashmap_put (grp_replay_req, &key_hash, chn, | 1763 | GNUNET_CONTAINER_multihashmap_put (grp_replay_req, &key_hash, chn, |
1764 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 1764 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
1765 | 1765 | ||
1766 | client_send_random (&chn->group_key_hash, &rep.header); | 1766 | client_send_random (&chn->group_pub_hash, &rep.header); |
1767 | return GNUNET_OK; | 1767 | return GNUNET_OK; |
1768 | } | 1768 | } |
1769 | 1769 | ||
diff --git a/src/multicast/multicast.h b/src/multicast/multicast.h index 207f9f729..2d32bd6cf 100644 --- a/src/multicast/multicast.h +++ b/src/multicast/multicast.h | |||
@@ -63,12 +63,12 @@ struct MulticastJoinRequestMessage | |||
63 | /** | 63 | /** |
64 | * Public key of the target group. | 64 | * Public key of the target group. |
65 | */ | 65 | */ |
66 | struct GNUNET_CRYPTO_EddsaPublicKey group_key; | 66 | struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Public key of the joining member. | 69 | * Public key of the joining member. |
70 | */ | 70 | */ |
71 | struct GNUNET_CRYPTO_EcdsaPublicKey member_key; | 71 | struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Peer identity of the joining member. | 74 | * Peer identity of the joining member. |
@@ -128,7 +128,7 @@ struct MulticastJoinDecisionMessageHeader | |||
128 | * C->S: Public key of the member requesting join. | 128 | * C->S: Public key of the member requesting join. |
129 | * S->C: Unused. | 129 | * S->C: Unused. |
130 | */ | 130 | */ |
131 | struct GNUNET_CRYPTO_EcdsaPublicKey member_key; | 131 | struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; |
132 | 132 | ||
133 | /* Followed by struct MulticastJoinDecisionMessage */ | 133 | /* Followed by struct MulticastJoinDecisionMessage */ |
134 | }; | 134 | }; |
@@ -176,7 +176,7 @@ struct MulticastReplayRequestMessage | |||
176 | * S->C: Public key of the member requesting replay. | 176 | * S->C: Public key of the member requesting replay. |
177 | * C->S: Unused. | 177 | * C->S: Unused. |
178 | */ | 178 | */ |
179 | struct GNUNET_CRYPTO_EcdsaPublicKey member_key; | 179 | struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; |
180 | 180 | ||
181 | /** | 181 | /** |
182 | * ID of the message that is being requested. | 182 | * ID of the message that is being requested. |
@@ -286,7 +286,7 @@ struct MulticastMemberJoinMessage | |||
286 | 286 | ||
287 | uint32_t relay_count GNUNET_PACKED; | 287 | uint32_t relay_count GNUNET_PACKED; |
288 | 288 | ||
289 | struct GNUNET_CRYPTO_EddsaPublicKey group_key; | 289 | struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; |
290 | 290 | ||
291 | struct GNUNET_CRYPTO_EcdsaPrivateKey member_key; | 291 | struct GNUNET_CRYPTO_EcdsaPrivateKey member_key; |
292 | 292 | ||
@@ -354,7 +354,7 @@ struct MulticastJoinMessage | |||
354 | /** | 354 | /** |
355 | * Public non-ephemeral key of the mutlicast group. | 355 | * Public non-ephemeral key of the mutlicast group. |
356 | */ | 356 | */ |
357 | struct GNUNET_CRYPTO_EddsaPublicKey group_key; | 357 | struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; |
358 | 358 | ||
359 | /** | 359 | /** |
360 | * Our private key for the group. | 360 | * Our private key for the group. |
diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c index 774a8bf70..e50711060 100644 --- a/src/multicast/multicast_api.c +++ b/src/multicast/multicast_api.c | |||
@@ -163,7 +163,7 @@ struct GNUNET_MULTICAST_JoinHandle | |||
163 | /** | 163 | /** |
164 | * Public key of the member requesting join. | 164 | * Public key of the member requesting join. |
165 | */ | 165 | */ |
166 | struct GNUNET_CRYPTO_EcdsaPublicKey member_key; | 166 | struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * Peer identity of the member requesting join. | 169 | * Peer identity of the member requesting join. |
@@ -254,9 +254,9 @@ group_recv_join_request (void *cls, | |||
254 | jmsg = NULL; | 254 | jmsg = NULL; |
255 | jh = GNUNET_malloc (sizeof (*jh)); | 255 | jh = GNUNET_malloc (sizeof (*jh)); |
256 | jh->group = grp; | 256 | jh->group = grp; |
257 | jh->member_key = jreq->member_key; | 257 | jh->member_pub_key = jreq->member_pub_key; |
258 | jh->peer = jreq->peer; | 258 | jh->peer = jreq->peer; |
259 | grp->join_req_cb (grp->cb_cls, &jreq->member_key, jmsg, jh); | 259 | grp->join_req_cb (grp->cb_cls, &jreq->member_pub_key, jmsg, jh); |
260 | } | 260 | } |
261 | 261 | ||
262 | 262 | ||
@@ -366,7 +366,7 @@ group_recv_replay_request (void *cls, | |||
366 | struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); | 366 | struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); |
367 | rh->grp = grp; | 367 | rh->grp = grp; |
368 | rh->req = *rep; | 368 | rh->req = *rep; |
369 | grp->replay_frag_cb (grp->cb_cls, &rep->member_key, | 369 | grp->replay_frag_cb (grp->cb_cls, &rep->member_pub_key, |
370 | GNUNET_ntohll (rep->fragment_id), | 370 | GNUNET_ntohll (rep->fragment_id), |
371 | GNUNET_ntohll (rep->flags), rh); | 371 | GNUNET_ntohll (rep->flags), rh); |
372 | } | 372 | } |
@@ -378,7 +378,7 @@ group_recv_replay_request (void *cls, | |||
378 | struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); | 378 | struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); |
379 | rh->grp = grp; | 379 | rh->grp = grp; |
380 | rh->req = *rep; | 380 | rh->req = *rep; |
381 | grp->replay_msg_cb (grp->cb_cls, &rep->member_key, | 381 | grp->replay_msg_cb (grp->cb_cls, &rep->member_pub_key, |
382 | GNUNET_ntohll (rep->message_id), | 382 | GNUNET_ntohll (rep->message_id), |
383 | GNUNET_ntohll (rep->fragment_offset), | 383 | GNUNET_ntohll (rep->fragment_offset), |
384 | GNUNET_ntohll (rep->flags), rh); | 384 | GNUNET_ntohll (rep->flags), rh); |
@@ -615,7 +615,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *join, | |||
615 | hdcsn->header.size = htons (sizeof (*hdcsn) + sizeof (*dcsn) | 615 | hdcsn->header.size = htons (sizeof (*hdcsn) + sizeof (*dcsn) |
616 | + relay_size + join_resp_size); | 616 | + relay_size + join_resp_size); |
617 | hdcsn->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION); | 617 | hdcsn->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION); |
618 | hdcsn->member_key = join->member_key; | 618 | hdcsn->member_pub_key = join->member_pub_key; |
619 | hdcsn->peer = join->peer; | 619 | hdcsn->peer = join->peer; |
620 | 620 | ||
621 | dcsn = (struct MulticastJoinDecisionMessage *) &hdcsn[1]; | 621 | dcsn = (struct MulticastJoinDecisionMessage *) &hdcsn[1]; |
@@ -995,7 +995,7 @@ GNUNET_MULTICAST_origin_to_all_cancel (struct GNUNET_MULTICAST_OriginTransmitHan | |||
995 | */ | 995 | */ |
996 | struct GNUNET_MULTICAST_Member * | 996 | struct GNUNET_MULTICAST_Member * |
997 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 997 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
998 | const struct GNUNET_CRYPTO_EddsaPublicKey *group_key, | 998 | const struct GNUNET_CRYPTO_EddsaPublicKey *group_pub_key, |
999 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key, | 999 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key, |
1000 | const struct GNUNET_PeerIdentity *origin, | 1000 | const struct GNUNET_PeerIdentity *origin, |
1001 | uint16_t relay_count, | 1001 | uint16_t relay_count, |
@@ -1017,7 +1017,7 @@ GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1017 | join = GNUNET_malloc (sizeof (*join) + relay_size + join_msg_size); | 1017 | join = GNUNET_malloc (sizeof (*join) + relay_size + join_msg_size); |
1018 | join->header.size = htons (sizeof (*join) + relay_size + join_msg_size); | 1018 | join->header.size = htons (sizeof (*join) + relay_size + join_msg_size); |
1019 | join->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN); | 1019 | join->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN); |
1020 | join->group_key = *group_key; | 1020 | join->group_pub_key = *group_pub_key; |
1021 | join->member_key = *member_key; | 1021 | join->member_key = *member_key; |
1022 | join->origin = *origin; | 1022 | join->origin = *origin; |
1023 | join->relay_count = ntohl (relay_count); | 1023 | join->relay_count = ntohl (relay_count); |
@@ -1122,6 +1122,7 @@ GNUNET_MULTICAST_member_replay_fragment (struct GNUNET_MULTICAST_Member *mem, | |||
1122 | uint64_t flags) | 1122 | uint64_t flags) |
1123 | { | 1123 | { |
1124 | member_replay_request (mem, fragment_id, 0, 0, flags); | 1124 | member_replay_request (mem, fragment_id, 0, 0, flags); |
1125 | // FIXME: return | ||
1125 | } | 1126 | } |
1126 | 1127 | ||
1127 | 1128 | ||
@@ -1150,6 +1151,7 @@ GNUNET_MULTICAST_member_replay_message (struct GNUNET_MULTICAST_Member *mem, | |||
1150 | uint64_t flags) | 1151 | uint64_t flags) |
1151 | { | 1152 | { |
1152 | member_replay_request (mem, 0, message_id, fragment_offset, flags); | 1153 | member_replay_request (mem, 0, message_id, fragment_offset, flags); |
1154 | // FIXME: return | ||
1153 | } | 1155 | } |
1154 | 1156 | ||
1155 | 1157 | ||
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c index 083af2ecc..4aa944df1 100644 --- a/src/multicast/test_multicast.c +++ b/src/multicast/test_multicast.c | |||
@@ -432,7 +432,7 @@ origin_recv_request (void *cls, | |||
432 | if (++ocls->n != ocls->msgs_expected) | 432 | if (++ocls->n != ocls->msgs_expected) |
433 | return; | 433 | return; |
434 | 434 | ||
435 | GNUNET_assert (0 == memcmp (&req->member_key, | 435 | GNUNET_assert (0 == memcmp (&req->member_pub_key, |
436 | &member_pub_key, sizeof (member_pub_key))); | 436 | &member_pub_key, sizeof (member_pub_key))); |
437 | 437 | ||
438 | 438 | ||