summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2022-03-17 15:12:06 +0100
committert3sserakt <t3ss@posteo.de>2022-03-17 15:12:06 +0100
commit8d41efc36bec5bc5ec29278a365d5a63d7349084 (patch)
tree99177b1b5400df5ae7180c2af1f47408cace1034 /src/transport
parent95a1edacccd9b3bf769a144a12d41946d0ac25dc (diff)
parentea4a5dd6ca3d62f852b5c2de94071b7fc8f0544c (diff)
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am8
-rw-r--r--src/transport/gnunet-communicator-tcp.c16
-rw-r--r--src/transport/gnunet-service-tng.c20
-rw-r--r--src/transport/gnunet-service-transport.c4
-rwxr-xr-xsrc/transport/test_transport_simple_send.sh7
-rwxr-xr-xsrc/transport/test_transport_simple_send_broadcast.sh8
-rwxr-xr-xsrc/transport/test_transport_simple_send_dv.sh8
-rwxr-xr-xsrc/transport/test_transport_simple_send_dv_circle.sh9
-rwxr-xr-xsrc/transport/test_transport_simple_send_string.sh8
-rwxr-xr-xsrc/transport/test_transport_udp_backchannel.sh9
10 files changed, 52 insertions, 45 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index ec00bc917..69b05fb13 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -773,6 +773,8 @@ TESTS += \
endif
endif
+# Only test TNG if we run experimental
+if HAVE_EXPERIMENTAL
check_SCRIPTS= \
test_transport_simple_send_string.sh \
test_transport_simple_send.sh \
@@ -780,6 +782,7 @@ check_SCRIPTS= \
test_transport_udp_backchannel.sh \
test_transport_simple_send_dv_circle.sh
# test_transport_simple_send_dv_inverse.sh
+endif
test_transport_start_with_config_SOURCES = \
test_transport_start_with_config.c
@@ -1521,7 +1524,10 @@ test_transport_api_slow_ats_LDADD = \
EXTRA_DIST = \
-$(check_SCRIPTS) \
+test_transport_simple_send_string.sh \
+test_transport_simple_send.sh \
+test_transport_simple_send_broadcast.sh \
+test_transport_udp_backchannel.sh \
gnunet-transport-certificate-creation.in \
communicator-unix.conf \
test_plugin_hostkey \
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index 3bfdeaa90..be75fa0e8 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -143,7 +143,7 @@ struct TcpHandshakeSignature
/**
* Challenge value used to protect against replay attack, if there is no stored monotonic time value.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
/**
@@ -176,7 +176,7 @@ struct TcpHandshakeAckSignature
/**
* Challenge value used to protect against replay attack, if there is no stored monotonic time value.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
/**
@@ -203,7 +203,7 @@ struct TCPConfirmation
/**
* Challenge value used to protect against replay attack, if there is no stored monotonic time value.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
@@ -238,7 +238,7 @@ struct TCPConfirmationAck
/**
* Challenge value used to protect against replay attack, if there is no stored monotonic time value.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
@@ -587,12 +587,12 @@ struct Queue
/**
* Challenge value used to protect against replay attack, if there is no stored monotonic time value.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/**
* Challenge value received. In case of inbound connection we have to remember the value, because we send the challenge back later after we received the GNUNET_MESSAGE_TYPE_COMMUNICATOR_TCP_CONFIRMATION_ACK.
*/
- struct ChallengeNonceP challenge_received;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge_received;
/**
* Iteration Context for retrieving the monotonic time send with key for rekeying.
@@ -1447,7 +1447,7 @@ handshake_ack_monotime_cb (void *cls,
* @param queue The queue context.
*/
static void
-send_challenge (struct ChallengeNonceP challenge, struct Queue *queue)
+send_challenge (struct GNUNET_CRYPTO_ChallengeNonceP challenge, struct Queue *queue)
{
struct TCPConfirmationAck tca;
struct TcpHandshakeAckSignature thas;
@@ -1680,7 +1680,7 @@ try_handle_plaintext (struct Queue *queue)
uint16_t type;
size_t size = 0; /* make compiler happy */
struct TcpHandshakeAckSignature thas;
- const struct ChallengeNonceP challenge = queue->challenge;
+ const struct GNUNET_CRYPTO_ChallengeNonceP challenge = queue->challenge;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"try handle plaintext!\n");
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 0427bd229..21c9be05c 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -581,7 +581,7 @@ struct DvInitPS
/**
* Challenge value used by the initiator to re-identify the path.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
@@ -621,7 +621,7 @@ struct DvHopPS
/**
* Challenge value used by the initiator to re-identify the path.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
@@ -715,7 +715,7 @@ struct TransportDVLearnMessage
/**
* Challenge value used by the initiator to re-identify the path.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/* Followed by @e num_hops `struct DVPathEntryP` values,
excluding the initiator of the DV trace; the last entry is the
@@ -834,7 +834,7 @@ struct TransportValidationChallengeMessage
/**
* Challenge to be signed by the receiving peer.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/**
* Timestamp of the sender, to be copied into the reply to allow
@@ -864,7 +864,7 @@ struct TransportValidationPS
/**
* Challenge signed by the receiving peer.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
};
@@ -893,7 +893,7 @@ struct TransportValidationResponseMessage
/**
* The challenge that was signed by the receiving peer.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/**
* Original timestamp of the sender (was @code{sender_time}),
@@ -1056,7 +1056,7 @@ struct LearnLaunchEntry
/**
* Challenge that uniquely identifies this activity.
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/**
* When did we transmit the DV learn message (used to calculate RTT) and
@@ -2569,7 +2569,7 @@ struct ValidationState
* (We must not rotate more often as otherwise we may discard valid answers
* due to packet losses, latency and reorderings on the network).
*/
- struct ChallengeNonceP challenge;
+ struct GNUNET_CRYPTO_ChallengeNonceP challenge;
/**
* Claimed address of the peer.
@@ -6886,7 +6886,7 @@ static int
validate_dv_initiator_signature (
struct GNUNET_TIME_AbsoluteNBO sender_monotonic_time,
const struct GNUNET_PeerIdentity *init,
- const struct ChallengeNonceP *challenge,
+ const struct GNUNET_CRYPTO_ChallengeNonceP *challenge,
const struct GNUNET_CRYPTO_EddsaSignature *init_sig)
{
struct DvInitPS ip = { .purpose.purpose = htonl (
@@ -8340,7 +8340,7 @@ struct CheckKnownChallengeContext
/**
* Set to the challenge we are looking for.
*/
- const struct ChallengeNonceP *challenge;
+ const struct GNUNET_CRYPTO_ChallengeNonceP *challenge;
/**
* Set to a matching validation state, if one was found.
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 24cc6464a..fad2ca4a1 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -1628,8 +1628,8 @@ GST_receive_callback (void *cls,
GST_neighbours_notify_data_recv (address, message);
switch (type)
{
- case GNUNET_MESSAGE_TYPE_HELLO_LEGACY:
- /* Legacy HELLO message, discard */
+ case GNUNET_MESSAGE_TYPE_HELLO_URI:
+ /* Future HELLO message, discard */
return ret;
case GNUNET_MESSAGE_TYPE_HELLO:
diff --git a/src/transport/test_transport_simple_send.sh b/src/transport/test_transport_simple_send.sh
index 3d5266622..0250070be 100755
--- a/src/transport/test_transport_simple_send.sh
+++ b/src/transport/test_transport_simple_send.sh
@@ -2,9 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_topo.conf"
diff --git a/src/transport/test_transport_simple_send_broadcast.sh b/src/transport/test_transport_simple_send_broadcast.sh
index f264b1203..a4801bf70 100755
--- a/src/transport/test_transport_simple_send_broadcast.sh
+++ b/src/transport/test_transport_simple_send_broadcast.sh
@@ -2,10 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
- # exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip/sed/bash ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
diff --git a/src/transport/test_transport_simple_send_dv.sh b/src/transport/test_transport_simple_send_dv.sh
index fa127cfa4..b57ee0629 100755
--- a/src/transport/test_transport_simple_send_dv.sh
+++ b/src/transport/test_transport_simple_send_dv.sh
@@ -2,10 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
- # exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip/sed/bash ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
diff --git a/src/transport/test_transport_simple_send_dv_circle.sh b/src/transport/test_transport_simple_send_dv_circle.sh
index de16df356..bd5f00abe 100755
--- a/src/transport/test_transport_simple_send_dv_circle.sh
+++ b/src/transport/test_transport_simple_send_dv_circle.sh
@@ -2,11 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
- # exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip/sed/bash ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf"
- #./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf"
diff --git a/src/transport/test_transport_simple_send_string.sh b/src/transport/test_transport_simple_send_string.sh
index b2bd05d5f..211abb494 100755
--- a/src/transport/test_transport_simple_send_string.sh
+++ b/src/transport/test_transport_simple_send_string.sh
@@ -11,9 +11,11 @@ EOF
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config -s '$string'"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config -s '$string'"
diff --git a/src/transport/test_transport_udp_backchannel.sh b/src/transport/test_transport_udp_backchannel.sh
index c52734a55..1a7c83385 100755
--- a/src/transport/test_transport_udp_backchannel.sh
+++ b/src/transport/test_transport_udp_backchannel.sh
@@ -5,11 +5,10 @@ fi
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
fi
-if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
-#exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
-exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; GNUNET_FORCE_LOG=';;;;DEBUG' GNUNET_FORCE_LOGFILE='test.out' ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
-# exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; GNUNET_FORCE_LOG=';;;;DEBUG' GNUNET_FORCE_LOGFILE='test.out' ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"