diff options
Diffstat (limited to 'src/testcurl/https/tls_session_time_out_test.c')
-rw-r--r-- | src/testcurl/https/tls_session_time_out_test.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/testcurl/https/tls_session_time_out_test.c b/src/testcurl/https/tls_session_time_out_test.c index f0f43dbc..1fe6cc1c 100644 --- a/src/testcurl/https/tls_session_time_out_test.c +++ b/src/testcurl/https/tls_session_time_out_test.c | |||
@@ -55,50 +55,50 @@ http_ahc (void *cls, struct MHD_Connection *connection, | |||
55 | } | 55 | } |
56 | 56 | ||
57 | static int | 57 | static int |
58 | setup (mhd_gtls_session_t * session, | 58 | setup (MHD_gtls_session_t * session, |
59 | gnutls_datum_t * key, | 59 | MHD_gnutls_datum_t * key, |
60 | gnutls_datum_t * cert, mhd_gtls_cert_credentials_t * xcred) | 60 | MHD_gnutls_datum_t * cert, MHD_gtls_cert_credentials_t * xcred) |
61 | { | 61 | { |
62 | int ret; | 62 | int ret; |
63 | const char **err_pos; | 63 | const char **err_pos; |
64 | 64 | ||
65 | MHD_gnutls_certificate_allocate_credentials (xcred); | 65 | MHD__gnutls_certificate_allocate_credentials (xcred); |
66 | 66 | ||
67 | mhd_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc); | 67 | MHD_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc); |
68 | mhd_gtls_set_datum_m (cert, srv_self_signed_cert_pem, | 68 | MHD_gtls_set_datum_m (cert, srv_self_signed_cert_pem, |
69 | strlen (srv_self_signed_cert_pem), &malloc); | 69 | strlen (srv_self_signed_cert_pem), &malloc); |
70 | 70 | ||
71 | MHD_gnutls_certificate_set_x509_key_mem (*xcred, cert, key, | 71 | MHD__gnutls_certificate_set_x509_key_mem (*xcred, cert, key, |
72 | GNUTLS_X509_FMT_PEM); | 72 | GNUTLS_X509_FMT_PEM); |
73 | 73 | ||
74 | MHD_gnutls_init (session, GNUTLS_CLIENT); | 74 | MHD__gnutls_init (session, GNUTLS_CLIENT); |
75 | ret = MHD_gnutls_priority_set_direct (*session, "NORMAL", err_pos); | 75 | ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", err_pos); |
76 | if (ret < 0) | 76 | if (ret < 0) |
77 | { | 77 | { |
78 | return -1; | 78 | return -1; |
79 | } | 79 | } |
80 | 80 | ||
81 | MHD_gnutls_credentials_set (*session, MHD_GNUTLS_CRD_CERTIFICATE, xcred); | 81 | MHD__gnutls_credentials_set (*session, MHD_GNUTLS_CRD_CERTIFICATE, xcred); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static int | 85 | static int |
86 | teardown (mhd_gtls_session_t session, | 86 | teardown (MHD_gtls_session_t session, |
87 | gnutls_datum_t * key, | 87 | MHD_gnutls_datum_t * key, |
88 | gnutls_datum_t * cert, mhd_gtls_cert_credentials_t xcred) | 88 | MHD_gnutls_datum_t * cert, MHD_gtls_cert_credentials_t xcred) |
89 | { | 89 | { |
90 | 90 | ||
91 | mhd_gtls_free_datum_m (key, free); | 91 | MHD_gtls_free_datum_m (key, free); |
92 | mhd_gtls_free_datum_m (cert, free); | 92 | MHD_gtls_free_datum_m (cert, free); |
93 | 93 | ||
94 | MHD_gnutls_deinit (session); | 94 | MHD__gnutls_deinit (session); |
95 | 95 | ||
96 | MHD_gnutls_certificate_free_credentials (xcred); | 96 | MHD__gnutls_certificate_free_credentials (xcred); |
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | static int | 100 | static int |
101 | test_tls_session_time_out (mhd_gtls_session_t session) | 101 | test_tls_session_time_out (MHD_gtls_session_t session) |
102 | { | 102 | { |
103 | int sd, ret; | 103 | int sd, ret; |
104 | struct sockaddr_in sa; | 104 | struct sockaddr_in sa; |
@@ -109,7 +109,7 @@ test_tls_session_time_out (mhd_gtls_session_t session) | |||
109 | sa.sin_port = htons (42433); | 109 | sa.sin_port = htons (42433); |
110 | inet_pton (AF_INET, "127.0.0.1", &sa.sin_addr); | 110 | inet_pton (AF_INET, "127.0.0.1", &sa.sin_addr); |
111 | 111 | ||
112 | MHD_gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd); | 112 | MHD__gnutls_transport_set_ptr (session, (MHD_gnutls_transport_ptr_t) sd); |
113 | 113 | ||
114 | ret = connect (sd, &sa, sizeof (struct sockaddr_in)); | 114 | ret = connect (sd, &sa, sizeof (struct sockaddr_in)); |
115 | 115 | ||
@@ -119,7 +119,7 @@ test_tls_session_time_out (mhd_gtls_session_t session) | |||
119 | return -1; | 119 | return -1; |
120 | } | 120 | } |
121 | 121 | ||
122 | ret = MHD_gnutls_handshake (session); | 122 | ret = MHD__gnutls_handshake (session); |
123 | if (ret < 0) | 123 | if (ret < 0) |
124 | { | 124 | { |
125 | return -1; | 125 | return -1; |
@@ -144,12 +144,12 @@ main (int argc, char *const *argv) | |||
144 | { | 144 | { |
145 | int errorCount = 0;; | 145 | int errorCount = 0;; |
146 | struct MHD_Daemon *d; | 146 | struct MHD_Daemon *d; |
147 | mhd_gtls_session_t session; | 147 | MHD_gtls_session_t session; |
148 | gnutls_datum_t key; | 148 | MHD_gnutls_datum_t key; |
149 | gnutls_datum_t cert; | 149 | MHD_gnutls_datum_t cert; |
150 | mhd_gtls_cert_credentials_t xcred; | 150 | MHD_gtls_cert_credentials_t xcred; |
151 | 151 | ||
152 | MHD_gnutls_global_init (); | 152 | MHD__gnutls_global_init (); |
153 | MHD_gtls_global_set_log_level (11); | 153 | MHD_gtls_global_set_log_level (11); |
154 | 154 | ||
155 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | | 155 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | |
@@ -174,7 +174,7 @@ main (int argc, char *const *argv) | |||
174 | fprintf (stderr, "Failed test: %s.\n", argv[0]); | 174 | fprintf (stderr, "Failed test: %s.\n", argv[0]); |
175 | 175 | ||
176 | MHD_stop_daemon (d); | 176 | MHD_stop_daemon (d); |
177 | MHD_gnutls_global_deinit (); | 177 | MHD__gnutls_global_deinit (); |
178 | 178 | ||
179 | return errorCount != 0; | 179 | return errorCount != 0; |
180 | } | 180 | } |