diff options
Diffstat (limited to 'src/testcurl')
-rw-r--r-- | src/testcurl/https/mhds_session_info_test.c | 1 | ||||
-rw-r--r-- | src/testcurl/https/tls_daemon_options_test.c | 20 | ||||
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 11 | ||||
-rw-r--r-- | src/testcurl/https/tls_test_common.h | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/src/testcurl/https/mhds_session_info_test.c b/src/testcurl/https/mhds_session_info_test.c index 4f8c67d2..3cfb39c4 100644 --- a/src/testcurl/https/mhds_session_info_test.c +++ b/src/testcurl/https/mhds_session_info_test.c | |||
@@ -138,7 +138,6 @@ test_query_session () | |||
138 | /* currently skip any peer authentication */ | 138 | /* currently skip any peer authentication */ |
139 | curl_easy_setopt (c, CURLOPT_SSL_VERIFYPEER, 0); | 139 | curl_easy_setopt (c, CURLOPT_SSL_VERIFYPEER, 0); |
140 | curl_easy_setopt (c, CURLOPT_SSL_VERIFYHOST, 0); | 140 | curl_easy_setopt (c, CURLOPT_SSL_VERIFYHOST, 0); |
141 | |||
142 | curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); | 141 | curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); |
143 | 142 | ||
144 | // NOTE: use of CONNECTTIMEOUT without also | 143 | // NOTE: use of CONNECTTIMEOUT without also |
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c index d4c25232..f1b1b7fd 100644 --- a/src/testcurl/https/tls_daemon_options_test.c +++ b/src/testcurl/https/tls_daemon_options_test.c | |||
@@ -40,9 +40,8 @@ int curl_check_version (const char *req_version, ...); | |||
40 | * test server refuses to negotiate connections with unsupported protocol versions | 40 | * test server refuses to negotiate connections with unsupported protocol versions |
41 | * | 41 | * |
42 | */ | 42 | */ |
43 | /* TODO rm test_fd */ | 43 | static int |
44 | int | 44 | test_unmatching_ssl_version (void * cls, const char *cipher_suite, |
45 | test_unmatching_ssl_version (void * cls, char *cipher_suite, | ||
46 | int curl_req_ssl_version) | 45 | int curl_req_ssl_version) |
47 | { | 46 | { |
48 | struct CBC cbc; | 47 | struct CBC cbc; |
@@ -67,6 +66,7 @@ test_unmatching_ssl_version (void * cls, char *cipher_suite, | |||
67 | send_curl_req (url, &cbc, cipher_suite, curl_req_ssl_version)) | 66 | send_curl_req (url, &cbc, cipher_suite, curl_req_ssl_version)) |
68 | { | 67 | { |
69 | free (cbc.buf); | 68 | free (cbc.buf); |
69 | fprintf (stderr, "cURL failed to reject request despite SSL version missmatch!\n"); | ||
70 | return -1; | 70 | return -1; |
71 | } | 71 | } |
72 | 72 | ||
@@ -95,14 +95,14 @@ main (int argc, char *const *argv) | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | char *aes128_sha = "AES128-SHA"; | 98 | const char *aes128_sha = "AES128-SHA"; |
99 | char *aes256_sha = "AES256-SHA"; | 99 | const char *aes256_sha = "AES256-SHA"; |
100 | if (curl_uses_nss_ssl() == 0) | 100 | if (curl_uses_nss_ssl() == 0) |
101 | { | 101 | { |
102 | aes128_sha = "rsa_aes_128_sha"; | 102 | aes128_sha = "rsa_aes_128_sha"; |
103 | aes256_sha = "rsa_aes_256_sha"; | 103 | aes256_sha = "rsa_aes_256_sha"; |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | errorCount += | 107 | errorCount += |
108 | test_wrap ("TLS1.0-AES-SHA1", | 108 | test_wrap ("TLS1.0-AES-SHA1", |
@@ -113,16 +113,16 @@ main (int argc, char *const *argv) | |||
113 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, | 113 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, |
114 | MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+AES-128-CBC:+SHA1:+RSA:+COMP-NULL", | 114 | MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+AES-128-CBC:+SHA1:+RSA:+COMP-NULL", |
115 | MHD_OPTION_END); | 115 | MHD_OPTION_END); |
116 | |||
116 | errorCount += | 117 | errorCount += |
117 | test_wrap ("TLS1.0-AES-SHA1", | 118 | test_wrap ("SSL3.0-AES256-SHA1", |
118 | &test_https_transfer, NULL, daemon_flags, | 119 | &test_https_transfer, NULL, daemon_flags, |
119 | aes128_sha, | 120 | aes256_sha, |
120 | CURL_SSLVERSION_SSLv3, | 121 | CURL_SSLVERSION_SSLv3, |
121 | MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, | 122 | MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, |
122 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, | 123 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, |
123 | MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-SSL3.0:+AES-128-CBC:+SHA1:+RSA:+COMP-NULL", | 124 | MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-SSL3.0:+AES-256-CBC:+SHA1:+RSA:+COMP-NULL", |
124 | MHD_OPTION_END); | 125 | MHD_OPTION_END); |
125 | |||
126 | errorCount += | 126 | errorCount += |
127 | test_wrap ("SSL3.0-AES-SHA1", | 127 | test_wrap ("SSL3.0-AES-SHA1", |
128 | &test_https_transfer, NULL, daemon_flags, | 128 | &test_https_transfer, NULL, daemon_flags, |
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index 140954d2..7c6441f7 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -206,7 +206,7 @@ http_dummy_ahc (void *cls, struct MHD_Connection *connection, | |||
206 | */ | 206 | */ |
207 | /* TODO have test wrap consider a NULL cbc */ | 207 | /* TODO have test wrap consider a NULL cbc */ |
208 | int | 208 | int |
209 | send_curl_req (char *url, struct CBC * cbc, char *cipher_suite, | 209 | send_curl_req (char *url, struct CBC * cbc, const char *cipher_suite, |
210 | int proto_version) | 210 | int proto_version) |
211 | { | 211 | { |
212 | CURL *c; | 212 | CURL *c; |
@@ -289,7 +289,7 @@ gen_test_file_url (char *url, int port) | |||
289 | * test HTTPS file transfer | 289 | * test HTTPS file transfer |
290 | */ | 290 | */ |
291 | int | 291 | int |
292 | test_https_transfer (void *cls, char *cipher_suite, int proto_version) | 292 | test_https_transfer (void *cls, const char *cipher_suite, int proto_version) |
293 | { | 293 | { |
294 | int len; | 294 | int len; |
295 | int ret = 0; | 295 | int ret = 0; |
@@ -424,10 +424,10 @@ teardown_session (gnutls_session_t session, | |||
424 | 424 | ||
425 | /* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */ | 425 | /* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */ |
426 | int | 426 | int |
427 | test_wrap (char *test_name, int | 427 | test_wrap (const char *test_name, int |
428 | (*test_function) (void * cls, char *cipher_suite, | 428 | (*test_function) (void * cls, const char *cipher_suite, |
429 | int proto_version), void * cls, | 429 | int proto_version), void * cls, |
430 | int daemon_flags, char *cipher_suite, int proto_version, ...) | 430 | int daemon_flags, const char *cipher_suite, int proto_version, ...) |
431 | { | 431 | { |
432 | int ret; | 432 | int ret; |
433 | va_list arg_list; | 433 | va_list arg_list; |
@@ -437,6 +437,7 @@ test_wrap (char *test_name, int | |||
437 | if (setup_testcase (&d, daemon_flags, arg_list) != 0) | 437 | if (setup_testcase (&d, daemon_flags, arg_list) != 0) |
438 | { | 438 | { |
439 | va_end (arg_list); | 439 | va_end (arg_list); |
440 | fprintf (stderr, "Failed to setup testcase %s\n", test_name); | ||
440 | return -1; | 441 | return -1; |
441 | } | 442 | } |
442 | #if 0 | 443 | #if 0 |
diff --git a/src/testcurl/https/tls_test_common.h b/src/testcurl/https/tls_test_common.h index 24e86ebb..4e6abff8 100644 --- a/src/testcurl/https/tls_test_common.h +++ b/src/testcurl/https/tls_test_common.h | |||
@@ -101,11 +101,11 @@ http_dummy_ahc (void *cls, struct MHD_Connection *connection, | |||
101 | int gen_test_file_url (char *url, int port); | 101 | int gen_test_file_url (char *url, int port); |
102 | 102 | ||
103 | int | 103 | int |
104 | send_curl_req (char *url, struct CBC *cbc, char *cipher_suite, | 104 | send_curl_req (char *url, struct CBC *cbc, const char *cipher_suite, |
105 | int proto_version); | 105 | int proto_version); |
106 | 106 | ||
107 | int | 107 | int |
108 | test_https_transfer (void *cls, char *cipher_suite, int proto_version); | 108 | test_https_transfer (void *cls, const char *cipher_suite, int proto_version); |
109 | 109 | ||
110 | int | 110 | int |
111 | setup_testcase (struct MHD_Daemon **d, int daemon_flags, va_list arg_list); | 111 | setup_testcase (struct MHD_Daemon **d, int daemon_flags, va_list arg_list); |
@@ -125,8 +125,8 @@ teardown_session (gnutls_session_t session, | |||
125 | gnutls_certificate_credentials_t xcred); | 125 | gnutls_certificate_credentials_t xcred); |
126 | 126 | ||
127 | int | 127 | int |
128 | test_wrap (char *test_name, int | 128 | test_wrap (const char *test_name, int |
129 | (*test_function) (void * cls, char *cipher_suite, | 129 | (*test_function) (void * cls, const char *cipher_suite, |
130 | int proto_version), void *test_function_cls, | 130 | int proto_version), void *test_function_cls, |
131 | int daemon_flags, char *cipher_suite, int proto_version, ...); | 131 | int daemon_flags, const char *cipher_suite, int proto_version, ...); |
132 | #endif /* TLS_TEST_COMMON_H_ */ | 132 | #endif /* TLS_TEST_COMMON_H_ */ |