diff options
Diffstat (limited to 'src/testcurl/https/bug-test.c')
-rw-r--r-- | src/testcurl/https/bug-test.c | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/src/testcurl/https/bug-test.c b/src/testcurl/https/bug-test.c index 34680b5f..8c28bea7 100644 --- a/src/testcurl/https/bug-test.c +++ b/src/testcurl/https/bug-test.c | |||
@@ -238,7 +238,7 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version) | |||
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
240 | 240 | ||
241 | int | 241 | static int |
242 | test_cipher_option (FILE * test_fd, char *cipher_suite, int proto_version) | 242 | test_cipher_option (FILE * test_fd, char *cipher_suite, int proto_version) |
243 | { | 243 | { |
244 | 244 | ||
@@ -264,35 +264,8 @@ test_cipher_option (FILE * test_fd, char *cipher_suite, int proto_version) | |||
264 | return ret; | 264 | return ret; |
265 | } | 265 | } |
266 | 266 | ||
267 | int | ||
268 | test_mac_option (FILE * test_fd, char *cipher_suite, int proto_version) | ||
269 | { | ||
270 | |||
271 | int ret; | ||
272 | int mac[] = { MHD_GNUTLS_MAC_SHA1, 0 }; | ||
273 | struct MHD_Daemon *d; | ||
274 | |||
275 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | | ||
276 | MHD_USE_DEBUG, 42433, | ||
277 | NULL, NULL, &http_ahc, NULL, | ||
278 | MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, | ||
279 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, | ||
280 | MHD_OPTION_MAC_ALGO, mac, MHD_OPTION_END); | ||
281 | |||
282 | if (d == NULL) | ||
283 | { | ||
284 | fprintf (stderr, MHD_E_SERVER_INIT); | ||
285 | return -1; | ||
286 | } | ||
287 | |||
288 | ret = test_daemon_get (test_fd, cipher_suite, proto_version); | ||
289 | |||
290 | MHD_stop_daemon (d); | ||
291 | return ret; | ||
292 | } | ||
293 | |||
294 | /* setup a temporary transfer test file */ | 267 | /* setup a temporary transfer test file */ |
295 | FILE * | 268 | static FILE * |
296 | setupTestFile () | 269 | setupTestFile () |
297 | { | 270 | { |
298 | FILE *test_fd; | 271 | FILE *test_fd; |
@@ -320,6 +293,32 @@ setupTestFile () | |||
320 | return test_fd; | 293 | return test_fd; |
321 | } | 294 | } |
322 | 295 | ||
296 | /* perform a HTTP GET request via SSL/TLS */ | ||
297 | int | ||
298 | test_secure_get (FILE * test_fd, char *cipher_suite, int proto_version) | ||
299 | { | ||
300 | int ret; | ||
301 | struct MHD_Daemon *d; | ||
302 | |||
303 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | | ||
304 | MHD_USE_DEBUG, 42433, | ||
305 | NULL, NULL, &http_ahc, NULL, | ||
306 | MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem, | ||
307 | MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem, | ||
308 | MHD_OPTION_END); | ||
309 | |||
310 | if (d == NULL) | ||
311 | { | ||
312 | fprintf (stderr, MHD_E_SERVER_INIT); | ||
313 | return -1; | ||
314 | } | ||
315 | |||
316 | ret = test_daemon_get (test_fd, cipher_suite, proto_version); | ||
317 | |||
318 | MHD_stop_daemon (d); | ||
319 | return ret; | ||
320 | } | ||
321 | |||
323 | int | 322 | int |
324 | main (int argc, char *const *argv) | 323 | main (int argc, char *const *argv) |
325 | { | 324 | { |
@@ -345,17 +344,13 @@ main (int argc, char *const *argv) | |||
345 | return -1; | 344 | return -1; |
346 | } | 345 | } |
347 | 346 | ||
348 | // errorCount += | 347 | errorCount += |
349 | // test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_TLSv1); | 348 | test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_TLSv1); |
350 | // errorCount += | 349 | errorCount += |
351 | // test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); | 350 | test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); |
352 | // errorCount += | ||
353 | // test_file_certificates (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); | ||
354 | /* TODO resolve cipher setting issue when compiling against GNU TLS */ | 351 | /* TODO resolve cipher setting issue when compiling against GNU TLS */ |
355 | errorCount += | 352 | errorCount += |
356 | test_cipher_option (test_fd, "DES-CBC3-SHA", CURL_SSLVERSION_TLSv1); | 353 | test_cipher_option (test_fd, "DES-CBC3-SHA", CURL_SSLVERSION_TLSv1); |
357 | /* errorCount += | ||
358 | test_kx_option (test_fd, "EDH-RSA-DES-CBC3-SHA", CURL_SSLVERSION_SSLv3); */ | ||
359 | 354 | ||
360 | 355 | ||
361 | curl_global_cleanup (); | 356 | curl_global_cleanup (); |