aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-12-07 16:00:22 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-12-07 16:03:15 +0300
commit56077dce84615cf34c1d0651357eb970b329eb24 (patch)
tree0f61346d1d34465d20f07238d73197f3f8d16e8c
parentace60e23531d15ed1a7e2e235388d33a6da468ba (diff)
downloadlibmicrohttpd-56077dce84615cf34c1d0651357eb970b329eb24.tar.gz
libmicrohttpd-56077dce84615cf34c1d0651357eb970b329eb24.zip
https tests: completely exclude 3DES from tests
as it considered as "unsafe" and could be disabled in libs
-rw-r--r--ChangeLog5
-rw-r--r--src/testcurl/https/test_https_get.c55
2 files changed, 4 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index c83e47ab..39e88fe2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1Mon Nov 04 15:43:00 MSK 2017 1Mon Dec 07 16:01:00 MSK 2017
2 Fixed HTTPS tests on modern platforms. -EG
3
4Mon Dec 04 15:43:00 MSK 2017
2 Minor documentation installation fixes. -EG 5 Minor documentation installation fixes. -EG
3 6
4Mon Nov 27 22:58:38 CET 2017 7Mon Nov 27 22:58:38 CET 2017
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c
index 8ed0028a..61c25643 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -34,54 +34,9 @@
34#endif /* MHD_HTTPS_REQUIRE_GRYPT */ 34#endif /* MHD_HTTPS_REQUIRE_GRYPT */
35#include "tls_test_common.h" 35#include "tls_test_common.h"
36 36
37extern const char srv_key_pem[];
38extern const char srv_self_signed_cert_pem[];
39extern const char srv_signed_cert_pem[]; 37extern const char srv_signed_cert_pem[];
40extern const char srv_signed_key_pem[]; 38extern const char srv_signed_key_pem[];
41 39
42
43static int
44test_cipher_option (FILE * test_fd,
45 const char *cipher_suite,
46 int proto_version)
47{
48 int ret;
49 struct MHD_Daemon *d;
50 int port;
51
52 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
53 port = 0;
54 else
55 port = 3040;
56
57 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
58 MHD_USE_ERROR_LOG, port,
59 NULL, NULL, &http_ahc, NULL,
60 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
61 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
62 MHD_OPTION_END);
63
64 if (d == NULL)
65 {
66 fprintf (stderr, MHD_E_SERVER_INIT);
67 return -1;
68 }
69 if (0 == port)
70 {
71 const union MHD_DaemonInfo *dinfo;
72 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
73 if (NULL == dinfo || 0 == dinfo->port)
74 { MHD_stop_daemon (d); return -1; }
75 port = (int)dinfo->port;
76 }
77
78 ret = test_https_transfer (test_fd, port, cipher_suite, proto_version);
79
80 MHD_stop_daemon (d);
81 return ret;
82}
83
84
85/* perform a HTTP GET request via SSL/TLS */ 40/* perform a HTTP GET request via SSL/TLS */
86static int 41static int
87test_secure_get (FILE * test_fd, 42test_secure_get (FILE * test_fd,
@@ -130,7 +85,6 @@ main (int argc, char *const *argv)
130{ 85{
131 unsigned int errorCount = 0; 86 unsigned int errorCount = 0;
132 const char *aes256_sha_tlsv1 = "AES256-SHA"; 87 const char *aes256_sha_tlsv1 = "AES256-SHA";
133 const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
134 (void)argc; /* Unused. Silent compiler warning. */ 88 (void)argc; /* Unused. Silent compiler warning. */
135 89
136#ifdef MHD_HTTPS_REQUIRE_GRYPT 90#ifdef MHD_HTTPS_REQUIRE_GRYPT
@@ -151,19 +105,10 @@ main (int argc, char *const *argv)
151 if (curl_uses_nss_ssl() == 0) 105 if (curl_uses_nss_ssl() == 0)
152 { 106 {
153 aes256_sha_tlsv1 = "rsa_aes_256_sha"; 107 aes256_sha_tlsv1 = "rsa_aes_256_sha";
154 des_cbc3_sha_tlsv1 = "rsa_aes_128_sha";
155 } 108 }
156 109
157 errorCount += 110 errorCount +=
158 test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1); 111 test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1);
159#if GNUTLS_VERSION_NUMBER < 0x030600
160 /* '3DES' is disabled by default on GnuTLS > 3.6.0 */
161 errorCount +=
162 test_cipher_option (NULL, des_cbc3_sha_tlsv1, CURL_SSLVERSION_TLSv1);
163#else /* GNUTLS_VERSION_NUMBER >= 0x030600 */
164 (void)des_cbc3_sha_tlsv1;
165 (void)test_cipher_option;
166#endif /* GNUTLS_VERSION_NUMBER >= 0x030600 */
167 print_test_result (errorCount, argv[0]); 112 print_test_result (errorCount, argv[0]);
168 113
169 curl_global_cleanup (); 114 curl_global_cleanup ();