Christian Grothoff пре 17 година
родитељ
комит
296760de58

+ 1 - 0
src/daemon/https/tls/gnutls_datum.h

@@ -21,6 +21,7 @@
  * USA
  *
  */
+#include "gnutls_int.h"
 
 void MHD_gtls_write_datum16 (opaque * dest, MHD_gnutls_datum_t dat);
 void MHD_gtls_write_datum24 (opaque * dest, MHD_gnutls_datum_t dat);

+ 1 - 1
src/daemon/https/tls/gnutls_handshake.c

@@ -1493,7 +1493,7 @@ MHD__gnutls_read_server_hello (MHD_gtls_session_t session,
 /* This function copies the appropriate ciphersuites to a locally allocated buffer
  * Needed in client hello messages. Returns the new data length.
  */
-static int
+int
 MHD__gnutls_copy_ciphersuites (MHD_gtls_session_t session,
                                opaque * ret_data, size_t ret_data_size)
 {

+ 4 - 1
src/testcurl/https/tls_daemon_options_test.c

@@ -49,7 +49,7 @@ test_unmatching_ssl_version (FILE * test_fd, char *cipher_suite,
   struct CBC cbc;
   if (NULL == (cbc.buf = malloc (sizeof (char) * 256)))
     {
-      fprintf (stderr, "Error: failed to read test file. %s\n",
+      fprintf (stderr, "Error: failed to allocate: %s\n",
                strerror (errno));
       return -1;
     }
@@ -59,6 +59,7 @@ test_unmatching_ssl_version (FILE * test_fd, char *cipher_suite,
   char url[255];
   if (gen_test_file_url (url, DEAMON_TEST_PORT))
     {
+      free (cbc.buf);
       return -1;
     }
 
@@ -66,9 +67,11 @@ test_unmatching_ssl_version (FILE * test_fd, char *cipher_suite,
   if (CURLE_OK ==
       send_curl_req (url, &cbc, cipher_suite, curl_req_ssl_version))
     {
+      free (cbc.buf);
       return -1;
     }
 
+  free (cbc.buf);
   return 0;
 }
 

+ 1 - 1
src/testcurl/https/tls_extension_test.c

@@ -93,7 +93,7 @@ test_hello_extension (MHD_gtls_session_t session, extensions_t exten_t,
     MHD_gtls_hash_init (MHD_GNUTLS_MAC_SHA1);
 
   /* version = 2 , random = [4 for unix time + 28 for random bytes] */
-  datalen = TLS_VERSION_SIZE + TLS_RANDOM_SIZE + (session_id_len + 1);
+  datalen = 2 /* version */ + TLS_RANDOM_SIZE + (session_id_len + 1);
 
   data = MHD_gnutls_malloc (datalen);
 

+ 3 - 0
src/testcurl/https/tls_test_common.c

@@ -26,6 +26,8 @@
 
 #include "tls_test_common.h"
 #include "tls_test_keys.h"
+#include "gnutls.h"
+#include "gnutls_datum.h"
 
 const char test_file_data[] = "Hello World\n";
 
@@ -125,6 +127,7 @@ http_dummy_ahc (void *cls, struct MHD_Connection *connection,
  * @return
  */
 /* TODO have test wrap consider a NULL cbc */
+int
 send_curl_req (char *url, struct CBC * cbc, char *cipher_suite,
                int proto_version)
 {

+ 2 - 2
src/testcurl/https/tls_test_common.h

@@ -29,8 +29,8 @@
 #include "gnutls.h"
 
 /* this enables verbos CURL version checking */
-#define DEBUG_HTTPS_TEST 1
-#define CURL_VERBOS_LEVEL 1
+#define DEBUG_HTTPS_TEST 0
+#define CURL_VERBOS_LEVEL 0
 
 #define DEAMON_TEST_PORT 42433