[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 120/164: Added checks for byzantine bounds
From: |
gnunet |
Subject: |
[gnunet] 120/164: Added checks for byzantine bounds |
Date: |
Fri, 30 Jul 2021 15:33:06 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 9e26cb5a4280dc7f71fb4180b3a16b4c5d36b42e
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Sat May 29 14:51:24 2021 +0200
Added checks for byzantine bounds
---
src/setu/gnunet-service-setu.c | 38 ++++++++++++++++++++++++++++++++++++++
src/setu/perf_setu_api.c | 2 +-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index a309568e7..aa2a2eba0 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -1283,6 +1283,25 @@ send_client_done (void *cls)
ev);
}
+/**
+ * Check if all given byzantine parameters are in given boundaries
+ * @param op
+ * @return indicator if all given byzantine parameters are in given boundaries
+ */
+
+static int
+check_byzantine_bounds(struct Operation *op) {
+ if (op->byzantine != GNUNET_YES)
+ return GNUNET_OK;
+ if(op->remote_element_count + op->remote_set_diff >
op->upper_element_boundary)
+ return GNUNET_SYSERR;
+ if(op->local_element_count + op->local_set_diff >
op->upper_element_boundary)
+ return GNUNET_SYSERR;
+ if(op->remote_element_count < op->byzantine_lower_bound)
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
+}
+
/* FIXME: the destroy logic is a mess and should be cleaned up! */
@@ -2606,6 +2625,15 @@ handle_union_p2p_send_full (void *cls,
op->remote_set_diff = ntohl(msg->remote_set_difference);
op->local_set_diff = ntohl(msg->local_set_difference);
+ if(check_byzantine_bounds(op) != GNUNET_OK) {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "PROTOCOL VIOLATION: Parameters transmitted from other peer do
not satisfie byzantine "
+ "criteria\n");
+ GNUNET_break_op (0);
+ fail_union_operation (op);
+ return;
+ }
+
/** Calculate avg element size if not initial sync **/
uint64_t avg_element_size = 0;
if(0 == op->number_elements_local) {
@@ -3309,6 +3337,16 @@ handle_union_p2p_request_full (void *cls,
op->remote_set_diff = ntohl(msg->remote_set_difference);
op->local_set_diff = ntohl(msg->local_set_difference);
+
+ if(check_byzantine_bounds(op) != GNUNET_OK) {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "PROTOCOL VIOLATION: Parameters transmitted from other peer do not
satisfie byzantine "
+ "criteria\n");
+ GNUNET_break_op (0);
+ fail_union_operation (op);
+ return;
+ }
+
perf_rtt.request_full.received += 1;
LOG (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index a10851b2b..a0b94ce83 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -404,7 +404,7 @@ run (void *cls,
"Running real set-reconciliation\n");
//init_set1 ();
// limit ~23800 element total
- initRandomSets(0, 500,1,32);
+ initRandomSets(0, 1,500,32);
}
void perf_thread() {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 82/164: Perf test, (continued)
- [gnunet] 82/164: Perf test, gnunet, 2021/07/30
- [gnunet] 91/164: Perftest, gnunet, 2021/07/30
- [gnunet] 92/164: Perftest, gnunet, 2021/07/30
- [gnunet] 97/164: Perftest, gnunet, 2021/07/30
- [gnunet] 72/164: Performance chech, gnunet, 2021/07/30
- [gnunet] 79/164: Added perf monitoring of operation mode, gnunet, 2021/07/30
- [gnunet] 107/164: Increased shufle nonce to 64bit, gnunet, 2021/07/30
- [gnunet] 96/164: Perftest, gnunet, 2021/07/30
- [gnunet] 99/164: Securyt improvement prevent peer from receiving message in wrong phase, gnunet, 2021/07/30
- [gnunet] 90/164: Perftest, gnunet, 2021/07/30
- [gnunet] 120/164: Added checks for byzantine bounds,
gnunet <=
- [gnunet] 88/164: Perf test, gnunet, 2021/07/30
- [gnunet] 116/164: Prepare fore messurement 2, gnunet, 2021/07/30
- [gnunet] 132/164: Removed Operation type from Operation Request message not required anymore, gnunet, 2021/07/30
- [gnunet] 136/164: Fixed some more errors from review, gnunet, 2021/07/30
- [gnunet] 112/164: Baseline for salt optimization, gnunet, 2021/07/30
- [gnunet] 102/164: Some more tests, gnunet, 2021/07/30
- [gnunet] 106/164: Added configuration new configration options as api options fixes memory leak, gnunet, 2021/07/30
- [gnunet] 105/164: Added randum seed for randum map, gnunet, 2021/07/30
- [gnunet] 104/164: Added full send commit message + changes request full message, gnunet, 2021/07/30
- [gnunet] 121/164: Made SE vary sizes depending on new formula, gnunet, 2021/07/30