aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-07-25 14:17:24 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-07-25 14:17:24 +0000
commit5073cf5873c8c612f841e0a0e0cb0dd20e4c6140 (patch)
treec2dd75eb6b6e8e7a1721b6b4d21abfa04bbd4f04 /src
parent49bb861ae2f02b2ba5af68cc6aaf13a135032420 (diff)
downloadgnunet-5073cf5873c8c612f841e0a0e0cb0dd20e4c6140.tar.gz
gnunet-5073cf5873c8c612f841e0a0e0cb0dd20e4c6140.zip
Diffstat (limited to 'src')
-rw-r--r--src/transport/Makefile.am17
-rw-r--r--src/transport/test_plugin_transport_https.c10
-rw-r--r--src/transport/test_transport_api.c13
-rw-r--r--src/transport/test_transport_api_http_peer1.conf9
-rw-r--r--src/transport/test_transport_api_http_peer2.conf8
5 files changed, 47 insertions, 10 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index f4824ab70..cf73faa9e 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -14,7 +14,9 @@ if HAVE_MHD
14 test_transport_api_reliability_http 14 test_transport_api_reliability_http
15 15
16 HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la 16 HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
17 HTTPS_PLUGIN_CHECK = test_plugin_transport_https 17 HTTPS_PLUGIN_CHECK = test_plugin_transport_https \
18 test_transport_api_https \
19 test_transport_api_reliability_https
18endif 20endif
19 21
20if USE_COVERAGE 22if USE_COVERAGE
@@ -238,7 +240,18 @@ test_plugin_transport_https_LDADD = \
238 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 240 $(top_builddir)/src/statistics/libgnunetstatistics.la \
239 @LIBCURL@ \ 241 @LIBCURL@ \
240 $(top_builddir)/src/util/libgnunetutil.la 242 $(top_builddir)/src/util/libgnunetutil.la
241 243
244test_transport_api_https_SOURCES = \
245 test_transport_api.c
246test_transport_api_https_LDADD = \
247 $(top_builddir)/src/transport/libgnunettransport.la \
248 $(top_builddir)/src/util/libgnunetutil.la
249
250test_transport_api_reliability_https_SOURCES = \
251 test_transport_api_reliability.c
252test_transport_api_reliability_https_LDADD = \
253 $(top_builddir)/src/transport/libgnunettransport.la \
254 $(top_builddir)/src/util/libgnunetutil.la
242endif 255endif
243 256
244EXTRA_DIST = \ 257EXTRA_DIST = \
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c
index 7c9229111..f22f6e95f 100644
--- a/src/transport/test_plugin_transport_https.c
+++ b/src/transport/test_plugin_transport_https.c
@@ -548,7 +548,7 @@ receive (void *cls,
548 if ((ntohs(message->type)==32) && (ntohs(message->size) == GNUNET_SERVER_MAX_MESSAGE_SIZE-1)) 548 if ((ntohs(message->type)==32) && (ntohs(message->size) == GNUNET_SERVER_MAX_MESSAGE_SIZE-1))
549 { 549 {
550 fail_msg_transmited_max_size = GNUNET_NO; 550 fail_msg_transmited_max_size = GNUNET_NO;
551 //shutdown_clean(); 551 shutdown_clean();
552 } 552 }
553 553
554 return GNUNET_TIME_UNIT_ZERO; 554 return GNUNET_TIME_UNIT_ZERO;
@@ -963,7 +963,7 @@ static void run_connection_tests( int phase , void * cls)
963 { 963 {
964 /* Connecting to peer without identification */ 964 /* Connecting to peer without identification */
965 char * ident = ""; 965 char * ident = "";
966 GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); 966 GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident);
967 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer without any peer identification.\n")); 967 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer without any peer identification.\n"));
968 test_no_ident.test_executed = GNUNET_YES; 968 test_no_ident.test_executed = GNUNET_YES;
969 send_data ( &test_no_ident, host_str); 969 send_data ( &test_no_ident, host_str);
@@ -974,7 +974,7 @@ static void run_connection_tests( int phase , void * cls)
974 { 974 {
975 char * ident = "AAAAAAAAAA"; 975 char * ident = "AAAAAAAAAA";
976 /* Connecting to peer with too short identification */ 976 /* Connecting to peer with too short identification */
977 GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); 977 GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident);
978 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too short peer identification.\n")); 978 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too short peer identification.\n"));
979 test_too_short_ident.test_executed = GNUNET_YES; 979 test_too_short_ident.test_executed = GNUNET_YES;
980 send_data ( &test_too_short_ident, host_str); 980 send_data ( &test_too_short_ident, host_str);
@@ -987,7 +987,7 @@ static void run_connection_tests( int phase , void * cls)
987 char * ident = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 987 char * ident = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
988 988
989 /* Connecting to peer with too long identification */ 989 /* Connecting to peer with too long identification */
990 GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); 990 GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident);
991 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too long peer identification.\n")); 991 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too long peer identification.\n"));
992 test_too_long_ident.test_executed = GNUNET_YES; 992 test_too_long_ident.test_executed = GNUNET_YES;
993 send_data ( &test_too_long_ident, host_str); 993 send_data ( &test_too_long_ident, host_str);
@@ -998,7 +998,7 @@ static void run_connection_tests( int phase , void * cls)
998 { 998 {
999 struct GNUNET_CRYPTO_HashAsciiEncoded ident; 999 struct GNUNET_CRYPTO_HashAsciiEncoded ident;
1000 GNUNET_CRYPTO_hash_to_enc(&my_identity.hashPubKey,&ident); 1000 GNUNET_CRYPTO_hash_to_enc(&my_identity.hashPubKey,&ident);
1001 GNUNET_asprintf (&host_str, "http://%s/%s%s",test_addr,(char *) &ident,";0"); 1001 GNUNET_asprintf (&host_str, "https://%s/%s%s",test_addr,(char *) &ident,";0");
1002 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with valid peer identification.\n")); 1002 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with valid peer identification.\n"));
1003 test_valid_ident.test_executed = GNUNET_YES; 1003 test_valid_ident.test_executed = GNUNET_YES;
1004 send_data ( &test_valid_ident, host_str); 1004 send_data ( &test_valid_ident, host_str);
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 7aa81bff8..de75d5da3 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -82,6 +82,8 @@ static int is_udp_nat;
82 82
83static int is_http; 83static int is_http;
84 84
85static int is_https;
86
85static GNUNET_SCHEDULER_TaskIdentifier die_task; 87static GNUNET_SCHEDULER_TaskIdentifier die_task;
86 88
87#if VERBOSE 89#if VERBOSE
@@ -308,7 +310,11 @@ run (void *cls,
308 setup_peer (&p1, "test_transport_api_http_peer1.conf"); 310 setup_peer (&p1, "test_transport_api_http_peer1.conf");
309 setup_peer (&p2, "test_transport_api_http_peer2.conf"); 311 setup_peer (&p2, "test_transport_api_http_peer2.conf");
310 } 312 }
311 313 else if (is_https)
314 {
315 setup_peer (&p1, "test_transport_api_https_peer1.conf");
316 setup_peer (&p2, "test_transport_api_https_peer2.conf");
317 }
312 GNUNET_assert(p1.th != NULL); 318 GNUNET_assert(p1.th != NULL);
313 GNUNET_assert(p2.th != NULL); 319 GNUNET_assert(p2.th != NULL);
314 320
@@ -441,7 +447,10 @@ main (int argc, char *argv[])
441 { 447 {
442 is_http = GNUNET_YES; 448 is_http = GNUNET_YES;
443 } 449 }
444 450 else if (strstr(argv[0], "https") != NULL)
451 {
452 is_https = GNUNET_YES;
453 }
445 GNUNET_log_setup ("test-transport-api", 454 GNUNET_log_setup ("test-transport-api",
446#if VERBOSE 455#if VERBOSE
447 "DEBUG", 456 "DEBUG",
diff --git a/src/transport/test_transport_api_http_peer1.conf b/src/transport/test_transport_api_http_peer1.conf
index bb7027c0d..1430197d3 100644
--- a/src/transport/test_transport_api_http_peer1.conf
+++ b/src/transport/test_transport_api_http_peer1.conf
@@ -6,6 +6,13 @@ USE_IPv4 = YES
6#BINDTO4 = 127.0.0.1 6#BINDTO4 = 127.0.0.1
7#BINDTO6 = ::1 7#BINDTO6 = ::1
8 8
9[transport-https]
10PORT = 42389
11DEBUG = NO
12USE_IPv6 = YES
13USE_IPv4 = YES
14#BINDTO4 = 127.0.0.1
15#BINDTO6 = ::1
9 16
10[fs] 17[fs]
11AUTOSTART = NO 18AUTOSTART = NO
@@ -36,7 +43,7 @@ FRIENDS-ONLY = NO
36MINIMUM-FRIENDS = 0 43MINIMUM-FRIENDS = 0
37 44
38[transport] 45[transport]
39PLUGINS = http 46PLUGINS = https
40#PLUGINS = tcp http 47#PLUGINS = tcp http
41DEBUG = YES 48DEBUG = YES
42ACCEPT_FROM6 = ::1; 49ACCEPT_FROM6 = ::1;
diff --git a/src/transport/test_transport_api_http_peer2.conf b/src/transport/test_transport_api_http_peer2.conf
index 910a63c9c..cbdf981d4 100644
--- a/src/transport/test_transport_api_http_peer2.conf
+++ b/src/transport/test_transport_api_http_peer2.conf
@@ -6,6 +6,14 @@ USE_IPv4 = YES
6#BINDTO4 = 127.0.0.1 6#BINDTO4 = 127.0.0.1
7#BINDTO6 = ::1 7#BINDTO6 = ::1
8 8
9[transport-https]
10PORT = 42388
11DEBUG = NO
12USE_IPv6 = YES
13USE_IPv4 = YES
14#BINDTO4 = 127.0.0.1
15#BINDTO6 = ::1
16
9[fs] 17[fs]
10AUTOSTART = NO 18AUTOSTART = NO
11 19