aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-01-16 17:19:49 +0000
committerJulius Bünger <buenger@mytum.de>2015-01-16 17:19:49 +0000
commitb1d1f2b1d9e58d1b4b91299c7a48b30bd730d4c4 (patch)
tree5068ddf04356d8300f6ee940ac2910b59d2f2833 /src/rps
parent5fccbdfde56f3c2207afb047d3fd7760268e4a93 (diff)
downloadgnunet-b1d1f2b1d9e58d1b4b91299c7a48b30bd730d4c4.tar.gz
gnunet-b1d1f2b1d9e58d1b4b91299c7a48b30bd730d4c4.zip
corrected message size check
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index c34569ace..ef7a031c5 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -688,12 +688,6 @@ handle_peer_push (void *cls,
688 688
689 // (check the proof of work) 689 // (check the proof of work)
690 690
691 if (ntohs(msg->size) != sizeof (struct GNUNET_MessageHeader))
692 {
693 GNUNET_break_op (0);
694 return GNUNET_SYSERR;
695 }
696
697 peer = (const struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER); 691 peer = (const struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER);
698 // FIXME wait for cadet to change this function 692 // FIXME wait for cadet to change this function
699 LOG (GNUNET_ERROR_TYPE_DEBUG, "PUSH received (%s)\n", GNUNET_i2s (peer)); 693 LOG (GNUNET_ERROR_TYPE_DEBUG, "PUSH received (%s)\n", GNUNET_i2s (peer));
@@ -727,12 +721,6 @@ handle_peer_pull_request (void *cls,
727 struct GNUNET_RPS_P2P_PullReplyMessage *out_msg; 721 struct GNUNET_RPS_P2P_PullReplyMessage *out_msg;
728 722
729 723
730 if (ntohs(msg->size) != sizeof (struct GNUNET_MessageHeader))
731 {
732 GNUNET_break_op (0); // At the moment our own implementation seems to break that.
733 return GNUNET_SYSERR;
734 }
735
736 peer = (struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER); 724 peer = (struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER);
737 // FIXME wait for cadet to change this function 725 // FIXME wait for cadet to change this function
738 LOG (GNUNET_ERROR_TYPE_DEBUG, 726 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1288,8 +1276,10 @@ run (void *cls,
1288 1276
1289 /* Initialise cadet */ 1277 /* Initialise cadet */
1290 static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = { 1278 static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
1291 {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH , 0}, 1279 {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH ,
1292 {&handle_peer_pull_request, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST, 0}, 1280 sizeof (struct GNUNET_MessageHeader)},
1281 {&handle_peer_pull_request, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST,
1282 sizeof (struct GNUNET_MessageHeader)},
1293 {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, 1283 {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0},
1294 {NULL, 0, 0} 1284 {NULL, 0, 0}
1295 }; 1285 };