aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-02-20 12:30:43 +0000
committerChristian Grothoff <christian@grothoff.org>2016-02-20 12:30:43 +0000
commit8d83647523111e7d514cd8d045a0ffceccb86104 (patch)
treea978738711ac63a43b647db22ac95b72846ba49a
parenta6249094154d811189c1e25c9eb2001712ecb571 (diff)
downloadlibmicrohttpd-8d83647523111e7d514cd8d045a0ffceccb86104.tar.gz
libmicrohttpd-8d83647523111e7d514cd8d045a0ffceccb86104.zip
-check for versions, report tests as skipped if versions missmatch
-rw-r--r--src/testcurl/https/test_https_session_info.c15
-rw-r--r--src/testcurl/https/test_https_sni.c4
-rw-r--r--src/testcurl/https/test_tls_options.c20
3 files changed, 26 insertions, 13 deletions
diff --git a/src/testcurl/https/test_https_session_info.c b/src/testcurl/https/test_https_session_info.c
index 97be81af..12d70f7b 100644
--- a/src/testcurl/https/test_https_session_info.c
+++ b/src/testcurl/https/test_https_session_info.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 Copyright (C) 2007 Christian Grothoff 3 Copyright (C) 2007, 2016 Christian Grothoff
4 4
5 libmicrohttpd is free software; you can redistribute it and/or modify 5 libmicrohttpd is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -168,6 +168,7 @@ int
168main (int argc, char *const *argv) 168main (int argc, char *const *argv)
169{ 169{
170 unsigned int errorCount = 0; 170 unsigned int errorCount = 0;
171 const char *ssl_version;
171 172
172 gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); 173 gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
173#ifdef GCRYCTL_INITIALIZATION_FINISHED 174#ifdef GCRYCTL_INITIALIZATION_FINISHED
@@ -178,6 +179,18 @@ main (int argc, char *const *argv)
178 fprintf (stderr, "Error (code: %u)\n", errorCount); 179 fprintf (stderr, "Error (code: %u)\n", errorCount);
179 return -1; 180 return -1;
180 } 181 }
182
183 ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version;
184 if (NULL == ssl_version)
185 {
186 fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
187 return 77;
188 }
189 if (0 != strncmp (ssl_version, "GnuTLS", 6))
190 {
191 fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
192 return 77;
193 }
181#if LIBCURL_VERSION_NUM >= 0x072200 194#if LIBCURL_VERSION_NUM >= 0x072200
182 errorCount += test_query_session (); 195 errorCount += test_query_session ();
183#endif 196#endif
diff --git a/src/testcurl/https/test_https_sni.c b/src/testcurl/https/test_https_sni.c
index 50be1499..ce7b9f6b 100644
--- a/src/testcurl/https/test_https_sni.c
+++ b/src/testcurl/https/test_https_sni.c
@@ -256,7 +256,7 @@ main (int argc, char *const *argv)
256 if (0 != curl_global_init (CURL_GLOBAL_ALL)) 256 if (0 != curl_global_init (CURL_GLOBAL_ALL))
257 { 257 {
258 fprintf (stderr, "Error: %s\n", strerror (errno)); 258 fprintf (stderr, "Error: %s\n", strerror (errno));
259 return -1; 259 return 77;
260 } 260 }
261 load_keys ("host1", ABS_SRCDIR "/host1.crt", ABS_SRCDIR "/host1.key"); 261 load_keys ("host1", ABS_SRCDIR "/host1.crt", ABS_SRCDIR "/host1.key");
262 load_keys ("host2", ABS_SRCDIR "/host2.crt", ABS_SRCDIR "/host2.key"); 262 load_keys ("host2", ABS_SRCDIR "/host2.crt", ABS_SRCDIR "/host2.key");
@@ -288,6 +288,6 @@ int main ()
288{ 288{
289 fprintf (stderr, 289 fprintf (stderr,
290 "SNI not supported by GnuTLS < 3.0\n"); 290 "SNI not supported by GnuTLS < 3.0\n");
291 return 0; 291 return 77;
292} 292}
293#endif 293#endif
diff --git a/src/testcurl/https/test_tls_options.c b/src/testcurl/https/test_tls_options.c
index 391dc594..72ccaced 100644
--- a/src/testcurl/https/test_tls_options.c
+++ b/src/testcurl/https/test_tls_options.c
@@ -1,17 +1,17 @@
1/* 1/*
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 Copyright (C) 2007, 2010 Christian Grothoff 3 Copyright (C) 2007, 2010, 2016 Christian Grothoff
4 4
5 libmicrohttpd is free software; you can redistribute it and/or modify 5 libmicrohttpd is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 libmicrohttpd is distributed in the hope that it will be useful, but 10 libmicrohttpd is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with libmicrohttpd; see the file COPYING. If not, write to the 16 along with libmicrohttpd; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
@@ -92,24 +92,24 @@ main (int argc, char *const *argv)
92#endif 92#endif
93 if (curl_check_version (MHD_REQ_CURL_VERSION)) 93 if (curl_check_version (MHD_REQ_CURL_VERSION))
94 { 94 {
95 return 0; 95 return 77;
96 } 96 }
97 ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version; 97 ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version;
98 if (NULL == ssl_version) 98 if (NULL == ssl_version)
99 { 99 {
100 fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n"); 100 fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
101 return 0; 101 return 77;
102 } 102 }
103 if (0 != strncmp (ssl_version, "GnuTLS", 6)) 103 if (0 != strncmp (ssl_version, "GnuTLS", 6))
104 { 104 {
105 fprintf (stderr, "This test can be run only with libcurl-gnutls.\n"); 105 fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
106 return 0; 106 return 77;
107 } 107 }
108 108
109 if (0 != curl_global_init (CURL_GLOBAL_ALL)) 109 if (0 != curl_global_init (CURL_GLOBAL_ALL))
110 { 110 {
111 fprintf (stderr, "Error: %s\n", strerror (errno)); 111 fprintf (stderr, "Error: %s\n", strerror (errno));
112 return 0; 112 return 77;
113 } 113 }
114 114
115 const char *aes128_sha = "AES128-SHA"; 115 const char *aes128_sha = "AES128-SHA";
@@ -119,9 +119,9 @@ main (int argc, char *const *argv)
119 aes128_sha = "rsa_aes_128_sha"; 119 aes128_sha = "rsa_aes_128_sha";
120 aes256_sha = "rsa_aes_256_sha"; 120 aes256_sha = "rsa_aes_256_sha";
121 } 121 }
122
123 122
124 if (0 != 123
124 if (0 !=
125 test_wrap ("TLS1.0-AES-SHA1", 125 test_wrap ("TLS1.0-AES-SHA1",
126 &test_https_transfer, NULL, daemon_flags, 126 &test_https_transfer, NULL, daemon_flags,
127 aes128_sha, 127 aes128_sha,