[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 108/164: Added some more sec checks
From: |
gnunet |
Subject: |
[gnunet] 108/164: Added some more sec checks |
Date: |
Fri, 30 Jul 2021 15:32:54 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit cee65f84cdbfee202e7bb301ac0ed14506e40f45
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Mon May 24 14:13:48 2021 +0200
Added some more sec checks
---
src/setu/gnunet-service-setu.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index b72ac662b..284beee46 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -2927,8 +2927,6 @@ handle_union_p2p_full_element (void *cls,
&ee->element_hash);
if (NULL != ke)
{
- /* Got repeated element. Should not happen since
- * we track demands. */
GNUNET_STATISTICS_update (_GSS_statistics,
"# repeated elements",
1,
@@ -2948,15 +2946,16 @@ handle_union_p2p_full_element (void *cls,
GNUNET_SETU_STATUS_ADD_LOCAL);
}
+ uint64_t received_repeated = op->received_total - op->received_fresh;
+
if ((GNUNET_YES == op->byzantine) &&
- (op->received_total > 384 + op->received_fresh * 4) &&
- (op->received_fresh < op->received_total / 6))
+ op->received_total > op->remote_element_count)
{
/* The other peer gave us lots of old elements, there's something wrong. */
LOG (GNUNET_ERROR_TYPE_ERROR,
- "Other peer sent only %llu/%llu fresh elements, failing operation\n",
- (unsigned long long) op->received_fresh,
- (unsigned long long) op->received_total);
+ "Other peer sent %llu elements while pretending to have %llu
elements, failing operation\n",
+ (unsigned long long) op->received_total,
+ (unsigned long long) op->remote_element_count);
GNUNET_break_op (0);
fail_union_operation (op);
return;
@@ -3178,6 +3177,19 @@ handle_union_p2p_full_done (void *cls,
{
struct GNUNET_MQ_Envelope *ev;
+ if ((GNUNET_YES == op->byzantine) &&
+ op->received_total != op->remote_element_count)
+ {
+ /* The other peer gave not enough elements before sending full
done, there's something wrong. */
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "Other peer sent only %llu/%llu fresh elements, failing
operation\n",
+ (unsigned long long) op->received_total,
+ (unsigned long long) op->remote_element_count);
+ GNUNET_break_op (0);
+ fail_union_operation (op);
+ return;
+ }
+
LOG (GNUNET_ERROR_TYPE_DEBUG,
"got FULL DONE, sending elements that other peer is missing\n");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 89/164: Perftest, (continued)
- [gnunet] 89/164: Perftest, gnunet, 2021/07/30
- [gnunet] 75/164: Final messurement, gnunet, 2021/07/30
- [gnunet] 74/164: Add new algo to determinate mode of operation, gnunet, 2021/07/30
- [gnunet] 95/164: Perftest, gnunet, 2021/07/30
- [gnunet] 98/164: Perftest, gnunet, 2021/07/30
- [gnunet] 101/164: Added element avg calculation, gnunet, 2021/07/30
- [gnunet] 77/164: Added new algo to determine operation mode, gnunet, 2021/07/30
- [gnunet] 81/164: Perf test, gnunet, 2021/07/30
- [gnunet] 87/164: Perf test, gnunet, 2021/07/30
- [gnunet] 100/164: Added message flow control, gnunet, 2021/07/30
- [gnunet] 108/164: Added some more sec checks,
gnunet <=
- [gnunet] 93/164: Perftest, gnunet, 2021/07/30
- [gnunet] 94/164: Perftest, gnunet, 2021/07/30
- [gnunet] 86/164: Perf test, gnunet, 2021/07/30
- [gnunet] 20/164: Run over night, gnunet, 2021/07/30
- [gnunet] 53/164: Reverte change to changes salt, gnunet, 2021/07/30
- [gnunet] 46/164: Test data 50 elements, gnunet, 2021/07/30
- [gnunet] 69/164: Pack IBF counter to use only as much storage as needed, gnunet, 2021/07/30
- [gnunet] 83/164: Perf test, gnunet, 2021/07/30
- [gnunet] 71/164: Fixed some ugly construct, gnunet, 2021/07/30
- [gnunet] 82/164: Perf test, gnunet, 2021/07/30