aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2022-10-05 13:35:00 +0200
committert3sserakt <t3ss@posteo.de>2022-10-05 13:35:00 +0200
commit8e4312d5e44a83e2baeb3fc15465b5e70919e6cf (patch)
treee4fe3388c0c18d9fa025c95820089d4ec5a801d4 /src/transport
parent247230d737e3e4709392148bfabbde25871b6914 (diff)
parent95fd039097d261626916cfc260a06a29d3d4fc15 (diff)
downloadgnunet-8e4312d5e44a83e2baeb3fc15465b5e70919e6cf.tar.gz
gnunet-8e4312d5e44a83e2baeb3fc15465b5e70919e6cf.zip
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/.gitignore2
-rw-r--r--src/transport/Makefile.am78
-rw-r--r--src/transport/gnunet-communicator-tcp.c2
-rw-r--r--src/transport/gnunet-service-tng.c7
-rw-r--r--src/transport/gnunet-service-transport.c7
-rw-r--r--src/transport/gnunet-transport-certificate-creation.in29
-rw-r--r--src/transport/plugin_transport_http_client.c6
7 files changed, 48 insertions, 83 deletions
diff --git a/src/transport/.gitignore b/src/transport/.gitignore
index d88d40ef7..5a82a787b 100644
--- a/src/transport/.gitignore
+++ b/src/transport/.gitignore
@@ -89,3 +89,5 @@ gnunet-communicator-tcp
89gnunet-communicator-udp 89gnunet-communicator-udp
90test_communicator_unix 90test_communicator_unix
91test_communicator_basic_unix 91test_communicator_basic_unix
92test_transport_start_with_config
93test_transport_api2_tcp
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 773fa2877..363f8b199 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -16,63 +16,28 @@ HTTPS_SERVER_PLUGIN_LA = libgnunet_plugin_transport_https_server.la
16HTTP_SERVER_PLUGIN_TEST = test_plugin_http_server 16HTTP_SERVER_PLUGIN_TEST = test_plugin_http_server
17HTTPS_SERVER_PLUGIN_TEST = test_plugin_https_server 17HTTPS_SERVER_PLUGIN_TEST = test_plugin_https_server
18 18
19if HAVE_LIBGNURL 19HTTP_CLIENT_PLUGIN_TEST = test_plugin_http_client
20 HTTP_CLIENT_PLUGIN_TEST = test_plugin_http_client 20HTTPS_CLIENT_PLUGIN_TEST = test_plugin_https_client
21 HTTPS_CLIENT_PLUGIN_TEST = test_plugin_https_client 21HTTP_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_http_client.la
22 HTTP_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_http_client.la 22HTTPS_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_https_client.la
23 HTTPS_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_https_client.la 23
24LIB_GNURL=@LIBGNURL@ 24HTTP_API_TEST = test_transport_api_http
25CPP_GNURL=@LIBGNURL_CPPFLAGS@ 25HTTP_REVERSE_API_TEST = test_transport_api_http_reverse
26else 26HTTP_API_TIMEOUT_TEST = test_transport_api_timeout_http
27if HAVE_LIBCURL 27HTTP_REL_TEST = test_transport_api_reliability_http \
28 HTTP_CLIENT_PLUGIN_TEST = test_plugin_http_client
29 HTTPS_CLIENT_PLUGIN_TEST = test_plugin_https_client
30 HTTP_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_http_client.la
31 HTTPS_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_https_client.la
32LIB_GNURL=@LIBCURL@
33CPP_GNURL=@LIBCURL_CPPFLAGS@
34endif
35endif
36
37if HAVE_LIBGNURL
38 HTTP_API_TEST = test_transport_api_http
39 HTTP_REVERSE_API_TEST = test_transport_api_http_reverse
40 HTTP_API_TIMEOUT_TEST = test_transport_api_timeout_http
41 HTTP_REL_TEST = test_transport_api_reliability_http \
42 test_transport_api_reliability_http_xhr 28 test_transport_api_reliability_http_xhr
43 HTTP_QUOTA_TEST = test_quota_compliance_http \ 29HTTP_QUOTA_TEST = test_quota_compliance_http \
44 test_quota_compliance_http_asymmetric 30 test_quota_compliance_http_asymmetric
45 HTTP_SWITCH = test_transport_address_switch_http 31HTTP_SWITCH = test_transport_address_switch_http
46 HTTPS_API_TEST = test_transport_api_https 32HTTPS_API_TEST = test_transport_api_https
47 HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https 33HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https
48if HAVE_EXPERIMENTAL 34if HAVE_EXPERIMENTAL
49 HTTPS_REL_TEST = test_transport_api_reliability_https \ 35 HTTPS_REL_TEST = test_transport_api_reliability_https \
50 test_transport_api_reliability_https_xhr 36 test_transport_api_reliability_https_xhr
51endif 37endif
52 HTTPS_QUOTA_TEST = test_quota_compliance_https \ 38HTTPS_QUOTA_TEST = test_quota_compliance_https \
53 test_quota_compliance_https_asymmetric 39 test_quota_compliance_https_asymmetric
54 HTTPS_SWITCH = test_transport_address_switch_https 40HTTPS_SWITCH = test_transport_address_switch_https
55else
56if HAVE_LIBCURL
57 HTTP_API_TEST = test_transport_api_http
58 HTTP_REVERSE_API_TEST = test_transport_api_http_reverse
59 HTTP_API_TIMEOUT_TEST = test_transport_api_timeout_http
60 HTTP_REL_TEST = test_transport_api_reliability_http \
61 test_transport_api_reliability_http_xhr
62 HTTP_QUOTA_TEST = test_quota_compliance_http \
63 test_quota_compliance_http_asymmetric
64 HTTP_SWITCH = test_transport_address_switch_http
65 HTTPS_API_TEST = test_transport_api_https
66 HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https
67if HAVE_EXPERIMENTAL
68 HTTPS_REL_TEST = test_transport_api_reliability_https \
69 test_transport_api_reliability_https_xhr
70endif
71 HTTPS_QUOTA_TEST = test_quota_compliance_https \
72 test_quota_compliance_https_asymmetric
73 HTTPS_SWITCH = test_transport_address_switch_https
74endif
75endif
76 41
77if USE_COVERAGE 42if USE_COVERAGE
78 AM_CFLAGS = --coverage -O0 43 AM_CFLAGS = --coverage -O0
@@ -268,8 +233,9 @@ do_subst = sed -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
268 233
269 234
270gnunet-transport-certificate-creation: gnunet-transport-certificate-creation.in Makefile 235gnunet-transport-certificate-creation: gnunet-transport-certificate-creation.in Makefile
271 $(do_subst) < $(srcdir)/gnunet-transport-certificate-creation.in > gnunet-transport-certificate-creation 236 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/gnunet-transport-certificate-creation.in > gnunet-transport-certificate-creation
272 chmod +x gnunet-transport-certificate-creation 237 @chmod +x gnunet-transport-certificate-creation
238
273 239
274 240
275 241
@@ -554,13 +520,13 @@ libgnunet_plugin_transport_http_client_la_LIBADD = \
554 $(top_builddir)/src/hello/libgnunethello.la \ 520 $(top_builddir)/src/hello/libgnunethello.la \
555 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 521 $(top_builddir)/src/statistics/libgnunetstatistics.la \
556 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ 522 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
557 $(LIB_GNURL) \ 523 @LIBCURL@ \
558 $(top_builddir)/src/util/libgnunetutil.la 524 $(top_builddir)/src/util/libgnunetutil.la
559libgnunet_plugin_transport_http_client_la_LDFLAGS = \ 525libgnunet_plugin_transport_http_client_la_LDFLAGS = \
560 $(GN_LIBINTL) \ 526 $(GN_LIBINTL) \
561 $(GN_PLUGIN_LDFLAGS) 527 $(GN_PLUGIN_LDFLAGS)
562libgnunet_plugin_transport_http_client_la_CFLAGS = \ 528libgnunet_plugin_transport_http_client_la_CFLAGS = \
563 $(CPP_GNURL) $(AM_CFLAGS) 529 @LIBCURL_CPPFLAGS@ $(AM_CFLAGS)
564 530
565 531
566libgnunet_plugin_transport_http_server_la_SOURCES = \ 532libgnunet_plugin_transport_http_server_la_SOURCES = \
@@ -584,13 +550,13 @@ libgnunet_plugin_transport_https_client_la_LIBADD = \
584 $(top_builddir)/src/hello/libgnunethello.la \ 550 $(top_builddir)/src/hello/libgnunethello.la \
585 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 551 $(top_builddir)/src/statistics/libgnunetstatistics.la \
586 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ 552 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
587 $(LIB_GNURL) \ 553 @LIBCURL@ \
588 $(top_builddir)/src/util/libgnunetutil.la 554 $(top_builddir)/src/util/libgnunetutil.la
589libgnunet_plugin_transport_https_client_la_LDFLAGS = \ 555libgnunet_plugin_transport_https_client_la_LDFLAGS = \
590 $(GN_LIBINTL) \ 556 $(GN_LIBINTL) \
591 $(GN_PLUGIN_LDFLAGS) 557 $(GN_PLUGIN_LDFLAGS)
592libgnunet_plugin_transport_https_client_la_CFLAGS = \ 558libgnunet_plugin_transport_https_client_la_CFLAGS = \
593 $(CPP_GNURL) $(AM_CFLAGS) -DBUILD_HTTPS 559 @LIBCURL_CPPFLAGS@ $(AM_CFLAGS) -DBUILD_HTTPS
594 560
595 561
596libgnunet_plugin_transport_https_server_la_SOURCES = \ 562libgnunet_plugin_transport_https_server_la_SOURCES = \
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index 1161ac73a..2a5290bf9 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -2457,7 +2457,7 @@ boot_queue (struct Queue *queue)
2457 * Generate and transmit our ephemeral key and the signature for 2457 * Generate and transmit our ephemeral key and the signature for
2458 * the initial KX with the other peer. Must be called first, before 2458 * the initial KX with the other peer. Must be called first, before
2459 * any other bytes are ever written to the output buffer. Note that 2459 * any other bytes are ever written to the output buffer. Note that
2460 * our cipher must already be initialized when calling thi function. 2460 * our cipher must already be initialized when calling this function.
2461 * Helper function for #start_initial_kx_out(). 2461 * Helper function for #start_initial_kx_out().
2462 * 2462 *
2463 * @param queue queue to do KX for 2463 * @param queue queue to do KX for
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 783047a5b..ae4d65bcf 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -87,7 +87,7 @@
87#define RING_BUFFER_SIZE 16 87#define RING_BUFFER_SIZE 16
88 88
89/** 89/**
90 * Maximum number of FC retransmissions for a runing retransmission task. 90 * Maximum number of FC retransmissions for a running retransmission task.
91 */ 91 */
92#define MAX_FC_RETRANSMIT_COUNT 1000 92#define MAX_FC_RETRANSMIT_COUNT 1000
93 93
@@ -1961,9 +1961,6 @@ struct Queue
1961}; 1961};
1962 1962
1963 1963
1964
1965
1966
1967/** 1964/**
1968 * A neighbour that at least one communicator is connected to. 1965 * A neighbour that at least one communicator is connected to.
1969 */ 1966 */
@@ -10122,7 +10119,7 @@ handle_send_message_ack (void *cls,
10122 (unsigned long long) queue->qid, 10119 (unsigned long long) queue->qid,
10123 (unsigned long long) sma->mid); 10120 (unsigned long long) sma->mid);
10124 qe = qep; 10121 qe = qep;
10125 if ((NULL != qe->pm)&&(qe->pm->qe != qe)) 10122 if ((NULL != qe->pm) && (qe->pm->qe != qe))
10126 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 10123 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
10127 "For pending message %llu we had retransmissions.\n", 10124 "For pending message %llu we had retransmissions.\n",
10128 qe->pm->logging_uuid); 10125 qe->pm->logging_uuid);
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index fad2ca4a1..345a0d949 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -480,7 +480,7 @@ client_connect_cb (void *cls,
480/** 480/**
481 * Perform next action in the blacklist check. 481 * Perform next action in the blacklist check.
482 * 482 *
483 * @param cls the `struct BlacklistCheck*` 483 * @param cls the `struct GST_BlacklistCheck *`
484 */ 484 */
485static void 485static void
486do_blacklist_check (void *cls); 486do_blacklist_check (void *cls);
@@ -2189,11 +2189,6 @@ shutdown_task (void *cls)
2189} 2189}
2190 2190
2191 2191
2192/**
2193 * Perform next action in the blacklist check.
2194 *
2195 * @param cls the `struct GST_BlacklistCheck *`
2196 */
2197static void 2192static void
2198do_blacklist_check (void *cls) 2193do_blacklist_check (void *cls)
2199{ 2194{
diff --git a/src/transport/gnunet-transport-certificate-creation.in b/src/transport/gnunet-transport-certificate-creation.in
index 8348dd1b7..771422a7a 100644
--- a/src/transport/gnunet-transport-certificate-creation.in
+++ b/src/transport/gnunet-transport-certificate-creation.in
@@ -42,6 +42,10 @@
42 42
43progname=${0##*/} 43progname=${0##*/}
44 44
45existence() {
46 command -v "$1" >/dev/null 2>&1
47}
48
45setdefaults() 49setdefaults()
46{ 50{
47 verbosity=0 51 verbosity=0
@@ -105,16 +109,23 @@ generate_cert_key()
105 CERTTOOL="" 109 CERTTOOL=""
106 GNUTLS_CA_TEMPLATE=@PKGDATADIRECTORY@/gnunet-gns-proxy-ca.template 110 GNUTLS_CA_TEMPLATE=@PKGDATADIRECTORY@/gnunet-gns-proxy-ca.template
107 OPENSSL=0 111 OPENSSL=0
108 if test -z "`gnutls-certtool --version`" > /dev/null 112 if test -x $(existence gnutls-certtool)
113 #if test -z "`gnutls-certtool --version`" > /dev/null
109 then 114 then
110 if test -z "`openssl version`" > /dev/null 115 if test -z "`certtool --version | grep gnutls`" > /dev/null
111 then 116 then
112 warningmsg "Install either gnutls certtool or openssl for certificate generation!" 117 warningmsg "'gnutls-certtool' or 'certtool' command not found. Trying openssl."
113 exit 1 118 # if test -z "`openssl version`" > /dev/null
114 else 119 if test -x $(existence openssl)
115 OPENSSL=1 120 then
121 OPENSSL=1
122 else
123 warningmsg "Install either gnutls certtool or openssl for certificate generation!"
124 statusmsg "Cleaning up."
125 exit 1
126 fi
116 fi 127 fi
117 CERTTOOL="openssl" 128 CERTTOOL="certtool"
118 else 129 else
119 CERTTOOL="gnutls-certtool" 130 CERTTOOL="gnutls-certtool"
120 fi 131 fi
@@ -122,8 +133,8 @@ generate_cert_key()
122 133
123 if test 1 -eq $OPENSSL 134 if test 1 -eq $OPENSSL
124 then 135 then
125 $CERTTOOL genrsa -out $KEYFILE 1024 136 openssl genrsa -out $KEYFILE 1024
126 $CERTTOOL req -batch -days 365 -out $CERTFILE -new -x509 -key $KEYFILE 137 openssl req -batch -days 365 -out $CERTFILE -new -x509 -key $KEYFILE
127 else 138 else
128 $CERTTOOL --generate-privkey --outfile $KEYFILE 2>/dev/null 139 $CERTTOOL --generate-privkey --outfile $KEYFILE 2>/dev/null
129 $CERTTOOL --template $GNUTLS_CA_TEMPLATE --generate-self-signed --load-privkey $KEYFILE --outfile $CERTFILE 2>/dev/null 140 $CERTTOOL --template $GNUTLS_CA_TEMPLATE --generate-self-signed --load-privkey $KEYFILE --outfile $CERTFILE 2>/dev/null
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 18bfcc054..476a3cd52 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -1692,12 +1692,6 @@ client_connect_get (struct GNUNET_ATS_Session *s)
1692} 1692}
1693 1693
1694 1694
1695/**
1696 * Connect a HTTP put request
1697 *
1698 * @param s the session to connect
1699 * @return #GNUNET_SYSERR for hard failure, #GNUNET_OK for ok
1700 */
1701static int 1695static int
1702client_connect_put (struct GNUNET_ATS_Session *s) 1696client_connect_put (struct GNUNET_ATS_Session *s)
1703{ 1697{