aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/gnunet-service-scalarproduct_bob.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_bob.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_bob.c')
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_bob.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index cd2a9ee6e..2001c39e8 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -513,7 +513,7 @@ bob_cadet_done_cb (void *cls)
513/** 513/**
514 * Maximum count of elements we can put into a multipart message 514 * Maximum count of elements we can put into a multipart message
515 */ 515 */
516#define ELEMENT_CAPACITY ((GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct MultipartMessage)) / sizeof (struct GNUNET_CRYPTO_PaillierCiphertext)) 516#define ELEMENT_CAPACITY ((GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct BobCryptodataMultipartMessage)) / sizeof (struct GNUNET_CRYPTO_PaillierCiphertext))
517 517
518 518
519/** 519/**
@@ -526,7 +526,7 @@ static void
526transmit_bobs_cryptodata_message_multipart (struct BobServiceSession *s) 526transmit_bobs_cryptodata_message_multipart (struct BobServiceSession *s)
527{ 527{
528 struct GNUNET_CRYPTO_PaillierCiphertext *payload; 528 struct GNUNET_CRYPTO_PaillierCiphertext *payload;
529 struct MultipartMessage *msg; 529 struct BobCryptodataMultipartMessage *msg;
530 struct GNUNET_MQ_Envelope *e; 530 struct GNUNET_MQ_Envelope *e;
531 unsigned int i; 531 unsigned int i;
532 unsigned int j; 532 unsigned int j;
@@ -581,12 +581,12 @@ transmit_bobs_cryptodata_message_multipart (struct BobServiceSession *s)
581static void 581static void
582transmit_bobs_cryptodata_message (struct BobServiceSession *s) 582transmit_bobs_cryptodata_message (struct BobServiceSession *s)
583{ 583{
584 struct ServiceResponseMessage *msg; 584 struct BobCryptodataMessage *msg;
585 struct GNUNET_MQ_Envelope *e; 585 struct GNUNET_MQ_Envelope *e;
586 struct GNUNET_CRYPTO_PaillierCiphertext *payload; 586 struct GNUNET_CRYPTO_PaillierCiphertext *payload;
587 unsigned int i; 587 unsigned int i;
588 588
589 s->cadet_transmitted_element_count = (GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct ServiceResponseMessage)) / 589 s->cadet_transmitted_element_count = (GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct BobCryptodataMessage)) /
590 (sizeof (struct GNUNET_CRYPTO_PaillierCiphertext) * 2) - 2; 590 (sizeof (struct GNUNET_CRYPTO_PaillierCiphertext) * 2) - 2;
591 if (s->cadet_transmitted_element_count > s->used_element_count) 591 if (s->cadet_transmitted_element_count > s->used_element_count)
592 s->cadet_transmitted_element_count = s->used_element_count; 592 s->cadet_transmitted_element_count = s->used_element_count;
@@ -598,7 +598,6 @@ transmit_bobs_cryptodata_message (struct BobServiceSession *s)
598 msg->reserved = htonl (0); 598 msg->reserved = htonl (0);
599 msg->intersection_element_count = htonl (s->used_element_count); 599 msg->intersection_element_count = htonl (s->used_element_count);
600 msg->contained_element_count = htonl (s->cadet_transmitted_element_count); 600 msg->contained_element_count = htonl (s->cadet_transmitted_element_count);
601 msg->key = s->session_id;
602 601
603 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 602 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
604 "Sending %u/%u crypto values to Alice\n", 603 "Sending %u/%u crypto values to Alice\n",
@@ -1148,7 +1147,7 @@ GSS_handle_bob_client_message_multipart (void *cls,
1148 struct GNUNET_SERVER_Client *client, 1147 struct GNUNET_SERVER_Client *client,
1149 const struct GNUNET_MessageHeader *message) 1148 const struct GNUNET_MessageHeader *message)
1150{ 1149{
1151 const struct ComputationMultipartMessage * msg; 1150 const struct ComputationBobCryptodataMultipartMessage * msg;
1152 struct BobServiceSession *s; 1151 struct BobServiceSession *s;
1153 uint32_t contained_count; 1152 uint32_t contained_count;
1154 const struct GNUNET_SCALARPRODUCT_Element *elements; 1153 const struct GNUNET_SCALARPRODUCT_Element *elements;
@@ -1168,17 +1167,17 @@ GSS_handle_bob_client_message_multipart (void *cls,
1168 return; 1167 return;
1169 } 1168 }
1170 msize = ntohs (message->size); 1169 msize = ntohs (message->size);
1171 if (msize < sizeof (struct ComputationMultipartMessage)) 1170 if (msize < sizeof (struct ComputationBobCryptodataMultipartMessage))
1172 { 1171 {
1173 GNUNET_break (0); 1172 GNUNET_break (0);
1174 GNUNET_SERVER_receive_done (client, 1173 GNUNET_SERVER_receive_done (client,
1175 GNUNET_SYSERR); 1174 GNUNET_SYSERR);
1176 return; 1175 return;
1177 } 1176 }
1178 msg = (const struct ComputationMultipartMessage *) message; 1177 msg = (const struct ComputationBobCryptodataMultipartMessage *) message;
1179 contained_count = ntohl (msg->element_count_contained); 1178 contained_count = ntohl (msg->element_count_contained);
1180 1179
1181 if ( (msize != (sizeof (struct ComputationMultipartMessage) + 1180 if ( (msize != (sizeof (struct ComputationBobCryptodataMultipartMessage) +
1182 contained_count * sizeof (struct GNUNET_SCALARPRODUCT_Element))) || 1181 contained_count * sizeof (struct GNUNET_SCALARPRODUCT_Element))) ||
1183 (0 == contained_count) || 1182 (0 == contained_count) ||
1184 (UINT16_MAX < contained_count) || 1183 (UINT16_MAX < contained_count) ||