[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35458 - gnunet/src/rps
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35458 - gnunet/src/rps |
Date: |
Wed, 25 Mar 2015 23:01:26 +0100 |
Author: ch3
Date: 2015-03-25 23:01:26 +0100 (Wed, 25 Mar 2015)
New Revision: 35458
Modified:
gnunet/src/rps/gnunet-service-rps.c
Log:
-malicious push handling
Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-03-25 22:01:20 UTC (rev 35457)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-03-25 22:01:26 UTC (rev 35458)
@@ -391,7 +391,7 @@
/**
* PeerID
*/
- struct GNUNET_PeerIdentity *peer_id;
+ struct GNUNET_PeerIdentity peer_id;
};
/**
@@ -1247,6 +1247,26 @@
// FIXME wait for cadet to change this function
LOG (GNUNET_ERROR_TYPE_DEBUG, "PUSH received (%s)\n", GNUNET_i2s (peer));
+ #ifdef ENABLE_MALICIOUS
+ struct AttackedPeer *tmp_att_peer;
+
+ tmp_att_peer = GNUNET_new (struct AttackedPeer);
+ memcpy (&tmp_att_peer->peer_id, peer, sizeof (struct GNUNET_PeerIdentity));
+ if (1 == mal_type)
+ { /* Try to maximise representation */
+ // TODO Check whether we already have that peer
+ GNUNET_CONTAINER_DLL_insert (att_peers_head, att_peers_tail, tmp_att_peer);
+ return GNUNET_OK;
+ }
+
+
+ else if (2 == mal_type)
+ { /* We attack one single well-known peer - simply ignore */
+ return GNUNET_OK;
+ }
+
+ #endif /* ENABLE_MALICIOUS */
+
/* Add the sending peer to the push_list */
if (GNUNET_NO == in_arr (push_list, push_list_size, peer))
GNUNET_array_append (push_list, push_list_size, *peer);
@@ -1254,6 +1274,7 @@
return GNUNET_OK;
}
+
/**
* Handle PULL REQUEST request message from another peer.
*
@@ -1653,7 +1674,7 @@
else
att_peer_index = att_peer_index->next;
- send_push (att_peer_index->peer_id);
+ send_push (&att_peer_index->peer_id);
}
@@ -1677,7 +1698,7 @@
else
att_peer_index = tmp_att_peer->next;
- send_pull_request (tmp_att_peer->peer_id);
+ send_pull_request (&tmp_att_peer->peer_id);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35458 - gnunet/src/rps,
gnunet <=