aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/https/tls_cipher_change_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/https/tls_cipher_change_test.c')
-rw-r--r--src/testcurl/https/tls_cipher_change_test.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/testcurl/https/tls_cipher_change_test.c b/src/testcurl/https/tls_cipher_change_test.c
index 78881a62..9a6fe0bd 100644
--- a/src/testcurl/https/tls_cipher_change_test.c
+++ b/src/testcurl/https/tls_cipher_change_test.c
@@ -150,52 +150,6 @@ test_out_of_context_cipher_change (MHD_gtls_session_t session)
150 } 150 }
151 151
152 close (sd); 152 close (sd);
153 fprintf (stderr, "%s. f: %s, l: %d\n", "ok", __FUNCTION__, __LINE__);
154 return 0;
155}
156
157/* */
158static int
159test_rehandshake (MHD_gtls_session_t session)
160{
161 int sd, ret;
162 struct sockaddr_in sa;
163
164 sd = socket (AF_INET, SOCK_STREAM, 0);
165 memset (&sa, '\0', sizeof (struct sockaddr_in));
166 sa.sin_family = AF_INET;
167 sa.sin_port = htons (42433);
168 inet_pton (AF_INET, "127.0.0.1", &sa.sin_addr);
169
170 MHD__gnutls_transport_set_ptr (session, (MHD_gnutls_transport_ptr_t) sd);
171
172 ret = connect (sd, &sa, sizeof (struct sockaddr_in));
173
174 if (ret < 0)
175 {
176 fprintf (stderr, "Error: %s)\n", MHD_E_FAILED_TO_CONNECT);
177 return -1;
178 }
179
180 ret = MHD__gnutls_handshake (session);
181 if (ret < 0)
182 {
183 return 1;
184 }
185
186 ret = MHD__gnutls_record_send (session, http_get_req, strlen (http_get_req));
187
188 /* check server responds with a 'close-notify' */
189 MHD_gtls_recv_int (session, GNUTLS_ALERT, GNUTLS_HANDSHAKE_FINISHED, 0, 0);
190
191
192 /* CLOSE_NOTIFY */
193 if (session->internals.last_alert != GNUTLS_A_CLOSE_NOTIFY)
194 {
195 return 1;
196 }
197
198 close (sd);
199 return 0; 153 return 0;
200} 154}
201 155
@@ -227,7 +181,6 @@ main (int argc, char *const *argv)
227 181
228 setup (&session, &key, &cert, &xcred); 182 setup (&session, &key, &cert, &xcred);
229 errorCount += test_out_of_context_cipher_change (session); 183 errorCount += test_out_of_context_cipher_change (session);
230 errorCount += test_rehandshake (session);
231 teardown (session, &key, &cert, xcred); 184 teardown (session, &key, &cert, xcred);
232 185
233 if (errorCount != 0) 186 if (errorCount != 0)