diff options
Diffstat (limited to 'src/testcurl/https/tls_test_common.h')
-rw-r--r-- | src/testcurl/https/tls_test_common.h | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/testcurl/https/tls_test_common.h b/src/testcurl/https/tls_test_common.h index 490239ef..36f5ffa5 100644 --- a/src/testcurl/https/tls_test_common.h +++ b/src/testcurl/https/tls_test_common.h | |||
@@ -35,15 +35,18 @@ | |||
35 | #define test_data "Hello World\n" | 35 | #define test_data "Hello World\n" |
36 | #define ca_cert_file_name "tmp_ca_cert.pem" | 36 | #define ca_cert_file_name "tmp_ca_cert.pem" |
37 | 37 | ||
38 | #define EMPTY_PAGE "<html><head><title>Empty page</title></head><body>Empty page</body></html>" | 38 | #define EMPTY_PAGE \ |
39 | #define PAGE_NOT_FOUND "<html><head><title>File not found</title></head><body>File not found</body></html>" | 39 | "<html><head><title>Empty page</title></head><body>Empty page</body></html>" |
40 | #define PAGE_NOT_FOUND \ | ||
41 | "<html><head><title>File not found</title></head><body>File not found</body></html>" | ||
40 | 42 | ||
41 | #define MHD_E_MEM "Error: memory error\n" | 43 | #define MHD_E_MEM "Error: memory error\n" |
42 | #define MHD_E_SERVER_INIT "Error: failed to start server\n" | 44 | #define MHD_E_SERVER_INIT "Error: failed to start server\n" |
43 | #define MHD_E_TEST_FILE_CREAT "Error: failed to setup test file\n" | 45 | #define MHD_E_TEST_FILE_CREAT "Error: failed to setup test file\n" |
44 | #define MHD_E_CERT_FILE_CREAT "Error: failed to setup test certificate\n" | 46 | #define MHD_E_CERT_FILE_CREAT "Error: failed to setup test certificate\n" |
45 | #define MHD_E_KEY_FILE_CREAT "Error: failed to setup test certificate\n" | 47 | #define MHD_E_KEY_FILE_CREAT "Error: failed to setup test certificate\n" |
46 | #define MHD_E_FAILED_TO_CONNECT "Error: server connection could not be established\n" | 48 | #define MHD_E_FAILED_TO_CONNECT \ |
49 | "Error: server connection could not be established\n" | ||
47 | 50 | ||
48 | /* TODO rm if unused */ | 51 | /* TODO rm if unused */ |
49 | struct https_test_data | 52 | struct https_test_data |
@@ -82,8 +85,8 @@ setup_ca_cert (void); | |||
82 | * perform cURL request for file | 85 | * perform cURL request for file |
83 | */ | 86 | */ |
84 | int | 87 | int |
85 | test_daemon_get (void * cls, | 88 | test_daemon_get (void *cls, |
86 | const char *cipher_suite, int proto_version, | 89 | const char *cipher_suite, int proto_version, |
87 | int port, int ver_peer); | 90 | int port, int ver_peer); |
88 | 91 | ||
89 | void | 92 | void |
@@ -122,31 +125,33 @@ send_curl_req (char *url, struct CBC *cbc, const char *cipher_suite, | |||
122 | int proto_version); | 125 | int proto_version); |
123 | 126 | ||
124 | int | 127 | int |
125 | test_https_transfer (void *cls, int port, const char *cipher_suite, int proto_version); | 128 | test_https_transfer (void *cls, int port, const char *cipher_suite, int |
129 | proto_version); | ||
126 | 130 | ||
127 | int | 131 | int |
128 | setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list arg_list); | 132 | setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list |
133 | arg_list); | ||
129 | 134 | ||
130 | void | 135 | void |
131 | teardown_testcase (struct MHD_Daemon *d); | 136 | teardown_testcase (struct MHD_Daemon *d); |
132 | 137 | ||
133 | 138 | ||
134 | int | 139 | int |
135 | setup_session (gnutls_session_t * session, | 140 | setup_session (gnutls_session_t *session, |
136 | gnutls_datum_t * key, | 141 | gnutls_datum_t *key, |
137 | gnutls_datum_t * cert, | 142 | gnutls_datum_t *cert, |
138 | gnutls_certificate_credentials_t * xcred); | 143 | gnutls_certificate_credentials_t *xcred); |
139 | 144 | ||
140 | int | 145 | int |
141 | teardown_session (gnutls_session_t session, | 146 | teardown_session (gnutls_session_t session, |
142 | gnutls_datum_t * key, | 147 | gnutls_datum_t *key, |
143 | gnutls_datum_t * cert, | 148 | gnutls_datum_t *cert, |
144 | gnutls_certificate_credentials_t xcred); | 149 | gnutls_certificate_credentials_t xcred); |
145 | 150 | ||
146 | int | 151 | int |
147 | test_wrap (const char *test_name, int | 152 | test_wrap (const char *test_name, int |
148 | (*test_function) (void * cls, int port, const char *cipher_suite, | 153 | (*test_function)(void *cls, int port, const char *cipher_suite, |
149 | int proto_version), void * cls, | 154 | int proto_version), void *cls, |
150 | int port, | 155 | int port, |
151 | int daemon_flags, const char *cipher_suite, int proto_version, ...); | 156 | int daemon_flags, const char *cipher_suite, int proto_version, ...); |
152 | 157 | ||