aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/gnunet-service-scalarproduct_alice.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-07 21:53:44 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-07 21:53:44 +0000
commit67eeadf357c24abec2dd790a54be74b7db71560d (patch)
tree01046bd16d390d420597797471adfb614c5073ea /src/scalarproduct/gnunet-service-scalarproduct_alice.c
parenta46808363beba27ad2c7e52246ef1ec694f8bf3a (diff)
downloadgnunet-67eeadf357c24abec2dd790a54be74b7db71560d.tar.gz
gnunet-67eeadf357c24abec2dd790a54be74b7db71560d.zip
-sending session ID back over same CADET channel is redundant
Diffstat (limited to 'src/scalarproduct/gnunet-service-scalarproduct_alice.c')
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_alice.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index 3bfb4ffe0..522af201d 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -640,7 +640,7 @@ handle_bobs_cryptodata_multipart (void *cls,
640 const struct GNUNET_MessageHeader *message) 640 const struct GNUNET_MessageHeader *message)
641{ 641{
642 struct AliceServiceSession *s = *channel_ctx; 642 struct AliceServiceSession *s = *channel_ctx;
643 const struct MultipartMessage *msg; 643 const struct BobCryptodataMultipartMessage *msg;
644 const struct GNUNET_CRYPTO_PaillierCiphertext *payload; 644 const struct GNUNET_CRYPTO_PaillierCiphertext *payload;
645 size_t i; 645 size_t i;
646 uint32_t contained; 646 uint32_t contained;
@@ -653,14 +653,14 @@ handle_bobs_cryptodata_multipart (void *cls,
653 return GNUNET_SYSERR; 653 return GNUNET_SYSERR;
654 } 654 }
655 msg_size = ntohs (message->size); 655 msg_size = ntohs (message->size);
656 if (sizeof (struct MultipartMessage) > msg_size) 656 if (sizeof (struct BobCryptodataMultipartMessage) > msg_size)
657 { 657 {
658 GNUNET_break_op (0); 658 GNUNET_break_op (0);
659 return GNUNET_SYSERR; 659 return GNUNET_SYSERR;
660 } 660 }
661 msg = (const struct MultipartMessage *) message; 661 msg = (const struct BobCryptodataMultipartMessage *) message;
662 contained = ntohl (msg->contained_element_count); 662 contained = ntohl (msg->contained_element_count);
663 required_size = sizeof (struct MultipartMessage) 663 required_size = sizeof (struct BobCryptodataMultipartMessage)
664 + 2 * contained * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext); 664 + 2 * contained * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext);
665 if ( (required_size != msg_size) || 665 if ( (required_size != msg_size) ||
666 (s->transferred_element_count + contained > s->used_element_count) ) 666 (s->transferred_element_count + contained > s->used_element_count) )
@@ -712,7 +712,7 @@ handle_bobs_cryptodata_message (void *cls,
712 const struct GNUNET_MessageHeader *message) 712 const struct GNUNET_MessageHeader *message)
713{ 713{
714 struct AliceServiceSession *s = *channel_ctx; 714 struct AliceServiceSession *s = *channel_ctx;
715 const struct ServiceResponseMessage *msg; 715 const struct BobCryptodataMessage *msg;
716 const struct GNUNET_CRYPTO_PaillierCiphertext *payload; 716 const struct GNUNET_CRYPTO_PaillierCiphertext *payload;
717 uint32_t i; 717 uint32_t i;
718 uint32_t contained; 718 uint32_t contained;
@@ -725,12 +725,12 @@ handle_bobs_cryptodata_message (void *cls,
725 return GNUNET_SYSERR; 725 return GNUNET_SYSERR;
726 } 726 }
727 msg_size = ntohs (message->size); 727 msg_size = ntohs (message->size);
728 if (sizeof (struct ServiceResponseMessage) > msg_size) 728 if (sizeof (struct BobCryptodataMessage) > msg_size)
729 { 729 {
730 GNUNET_break_op (0); 730 GNUNET_break_op (0);
731 return GNUNET_SYSERR; 731 return GNUNET_SYSERR;
732 } 732 }
733 msg = (const struct ServiceResponseMessage *) message; 733 msg = (const struct BobCryptodataMessage *) message;
734 GNUNET_break_op (0 == ntohl (msg->reserved)); 734 GNUNET_break_op (0 == ntohl (msg->reserved));
735 if (s->used_element_count != ntohl (msg->intersection_element_count)) 735 if (s->used_element_count != ntohl (msg->intersection_element_count))
736 { 736 {
@@ -739,7 +739,7 @@ handle_bobs_cryptodata_message (void *cls,
739 return GNUNET_SYSERR; 739 return GNUNET_SYSERR;
740 } 740 }
741 contained = ntohl (msg->contained_element_count); 741 contained = ntohl (msg->contained_element_count);
742 required_size = sizeof (struct ServiceResponseMessage) 742 required_size = sizeof (struct BobCryptodataMessage)
743 + 2 * contained * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext) 743 + 2 * contained * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext)
744 + 2 * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext); 744 + 2 * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext);
745 if ( (msg_size != required_size) || 745 if ( (msg_size != required_size) ||
@@ -1099,7 +1099,7 @@ GSS_handle_alice_client_message_multipart (void *cls,
1099 struct GNUNET_SERVER_Client *client, 1099 struct GNUNET_SERVER_Client *client,
1100 const struct GNUNET_MessageHeader *message) 1100 const struct GNUNET_MessageHeader *message)
1101{ 1101{
1102 const struct ComputationMultipartMessage * msg; 1102 const struct ComputationBobCryptodataMultipartMessage * msg;
1103 struct AliceServiceSession *s; 1103 struct AliceServiceSession *s;
1104 uint32_t contained_count; 1104 uint32_t contained_count;
1105 const struct GNUNET_SCALARPRODUCT_Element *elements; 1105 const struct GNUNET_SCALARPRODUCT_Element *elements;
@@ -1119,17 +1119,17 @@ GSS_handle_alice_client_message_multipart (void *cls,
1119 return; 1119 return;
1120 } 1120 }
1121 msize = ntohs (message->size); 1121 msize = ntohs (message->size);
1122 if (msize < sizeof (struct ComputationMultipartMessage)) 1122 if (msize < sizeof (struct ComputationBobCryptodataMultipartMessage))
1123 { 1123 {
1124 GNUNET_break (0); 1124 GNUNET_break (0);
1125 GNUNET_SERVER_receive_done (client, 1125 GNUNET_SERVER_receive_done (client,
1126 GNUNET_SYSERR); 1126 GNUNET_SYSERR);
1127 return; 1127 return;
1128 } 1128 }
1129 msg = (const struct ComputationMultipartMessage *) message; 1129 msg = (const struct ComputationBobCryptodataMultipartMessage *) message;
1130 contained_count = ntohl (msg->element_count_contained); 1130 contained_count = ntohl (msg->element_count_contained);
1131 1131
1132 if ( (msize != (sizeof (struct ComputationMultipartMessage) + 1132 if ( (msize != (sizeof (struct ComputationBobCryptodataMultipartMessage) +
1133 contained_count * sizeof (struct GNUNET_SCALARPRODUCT_Element))) || 1133 contained_count * sizeof (struct GNUNET_SCALARPRODUCT_Element))) ||
1134 (0 == contained_count) || 1134 (0 == contained_count) ||
1135 (s->total == s->transferred_element_count) || 1135 (s->total == s->transferred_element_count) ||