aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-20 13:23:45 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-20 13:23:45 +0100
commit311f47494f931aefd9dc1e247831d88a3bcebdb4 (patch)
treed673be28629296ab33ed7f43ae7140e88967fc09 /src/rps/gnunet-service-rps.c
parent1173f89823cd4cb1ff6c8afdbc33ea9397bbeee2 (diff)
downloadgnunet-311f47494f931aefd9dc1e247831d88a3bcebdb4.tar.gz
gnunet-311f47494f931aefd9dc1e247831d88a3bcebdb4.zip
fix enable_malicous check
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 9dba04316..e3e25342e 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -261,7 +261,7 @@ struct ChannelCtx
261}; 261};
262 262
263 263
264#ifdef ENABLE_MALICIOUS 264#if ENABLE_MALICIOUS
265 265
266/** 266/**
267 * If type is 2 This struct is used to store the attacked peers in a DLL 267 * If type is 2 This struct is used to store the attacked peers in a DLL
@@ -492,7 +492,7 @@ static struct GNUNET_PEERINFO_Handle *peerinfo_handle;
492static struct GNUNET_PEERINFO_NotifyContext *peerinfo_notify_handle; 492static struct GNUNET_PEERINFO_NotifyContext *peerinfo_notify_handle;
493 493
494 494
495#ifdef ENABLE_MALICIOUS 495#if ENABLE_MALICIOUS
496/** 496/**
497 * Type of malicious peer 497 * Type of malicious peer
498 * 498 *
@@ -2701,7 +2701,7 @@ clean_peer (struct Sub *sub,
2701 LOG (GNUNET_ERROR_TYPE_DEBUG, 2701 LOG (GNUNET_ERROR_TYPE_DEBUG,
2702 "Going to remove send channel to peer %s\n", 2702 "Going to remove send channel to peer %s\n",
2703 GNUNET_i2s (peer)); 2703 GNUNET_i2s (peer));
2704 #ifdef ENABLE_MALICIOUS 2704 #if ENABLE_MALICIOUS
2705 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&attacked_peer, peer)) 2705 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&attacked_peer, peer))
2706 (void) destroy_sending_channel (get_peer_ctx (sub->peer_map, peer)); 2706 (void) destroy_sending_channel (get_peer_ctx (sub->peer_map, peer));
2707 #else /* ENABLE_MALICIOUS */ 2707 #else /* ENABLE_MALICIOUS */
@@ -3436,7 +3436,7 @@ handle_peer_push (void *cls,
3436 GNUNET_STATISTICS_update(stats, "# push message received", 1, GNUNET_NO); 3436 GNUNET_STATISTICS_update(stats, "# push message received", 1, GNUNET_NO);
3437 } 3437 }
3438 3438
3439 #ifdef ENABLE_MALICIOUS 3439 #if ENABLE_MALICIOUS
3440 struct AttackedPeer *tmp_att_peer; 3440 struct AttackedPeer *tmp_att_peer;
3441 3441
3442 if ( (1 == mal_type) || 3442 if ( (1 == mal_type) ||
@@ -3512,7 +3512,7 @@ handle_peer_pull_request (void *cls,
3512 } 3512 }
3513 } 3513 }
3514 3514
3515 #ifdef ENABLE_MALICIOUS 3515 #if ENABLE_MALICIOUS
3516 if (1 == mal_type 3516 if (1 == mal_type
3517 || 3 == mal_type) 3517 || 3 == mal_type)
3518 { /* Try to maximise representation */ 3518 { /* Try to maximise representation */
@@ -3606,7 +3606,7 @@ handle_peer_pull_reply (void *cls,
3606 const struct GNUNET_PeerIdentity *peers; 3606 const struct GNUNET_PeerIdentity *peers;
3607 struct Sub *sub = channel_ctx->peer_ctx->sub; 3607 struct Sub *sub = channel_ctx->peer_ctx->sub;
3608 uint32_t i; 3608 uint32_t i;
3609#ifdef ENABLE_MALICIOUS 3609#if ENABLE_MALICIOUS
3610 struct AttackedPeer *tmp_att_peer; 3610 struct AttackedPeer *tmp_att_peer;
3611#endif /* ENABLE_MALICIOUS */ 3611#endif /* ENABLE_MALICIOUS */
3612 3612
@@ -3628,7 +3628,7 @@ handle_peer_pull_reply (void *cls,
3628 } 3628 }
3629 } 3629 }
3630 3630
3631 #ifdef ENABLE_MALICIOUS 3631 #if ENABLE_MALICIOUS
3632 // We shouldn't even receive pull replies as we're not sending 3632 // We shouldn't even receive pull replies as we're not sending
3633 if (2 == mal_type) 3633 if (2 == mal_type)
3634 { 3634 {
@@ -3649,7 +3649,7 @@ handle_peer_pull_reply (void *cls,
3649 i, 3649 i,
3650 GNUNET_i2s (&peers[i])); 3650 GNUNET_i2s (&peers[i]));
3651 3651
3652 #ifdef ENABLE_MALICIOUS 3652 #if ENABLE_MALICIOUS
3653 if ((NULL != att_peer_set) && 3653 if ((NULL != att_peer_set) &&
3654 (1 == mal_type || 3 == mal_type)) 3654 (1 == mal_type || 3 == mal_type))
3655 { /* Add attacked peer to local list */ 3655 { /* Add attacked peer to local list */
@@ -3812,7 +3812,7 @@ send_push (struct PeerContext *peer_ctx)
3812} 3812}
3813 3813
3814 3814
3815#ifdef ENABLE_MALICIOUS 3815#if ENABLE_MALICIOUS
3816 3816
3817 3817
3818/** 3818/**
@@ -4534,7 +4534,7 @@ shutdown_task (void *cls)
4534 } 4534 }
4535 GNUNET_CADET_disconnect (cadet_handle); 4535 GNUNET_CADET_disconnect (cadet_handle);
4536 cadet_handle = NULL; 4536 cadet_handle = NULL;
4537#ifdef ENABLE_MALICIOUS 4537#if ENABLE_MALICIOUS
4538 struct AttackedPeer *tmp_att_peer; 4538 struct AttackedPeer *tmp_att_peer;
4539 GNUNET_array_grow (mal_peers, 4539 GNUNET_array_grow (mal_peers,
4540 num_mal_peers, 4540 num_mal_peers,
@@ -4647,7 +4647,7 @@ run (void *cls,
4647 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 4647 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
4648 "STARTING SERVICE (rps) for peer [%s]\n", 4648 "STARTING SERVICE (rps) for peer [%s]\n",
4649 GNUNET_i2s (&own_identity)); 4649 GNUNET_i2s (&own_identity));
4650#ifdef ENABLE_MALICIOUS 4650#if ENABLE_MALICIOUS
4651 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 4651 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
4652 "Malicious execution compiled in.\n"); 4652 "Malicious execution compiled in.\n");
4653#endif /* ENABLE_MALICIOUS */ 4653#endif /* ENABLE_MALICIOUS */
@@ -4740,7 +4740,7 @@ GNUNET_SERVICE_MAIN
4740 GNUNET_MESSAGE_TYPE_RPS_CS_SEED, 4740 GNUNET_MESSAGE_TYPE_RPS_CS_SEED,
4741 struct GNUNET_RPS_CS_SeedMessage, 4741 struct GNUNET_RPS_CS_SeedMessage,
4742 NULL), 4742 NULL),
4743#ifdef ENABLE_MALICIOUS 4743#if ENABLE_MALICIOUS
4744 GNUNET_MQ_hd_var_size (client_act_malicious, 4744 GNUNET_MQ_hd_var_size (client_act_malicious,
4745 GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS, 4745 GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS,
4746 struct GNUNET_RPS_CS_ActMaliciousMessage, 4746 struct GNUNET_RPS_CS_ActMaliciousMessage,