From 6e619393824922118317689ef59a73c556b7ef98 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Apr 2005 15:27:13 +0000 Subject: GnuTLS support added. There's now a "generic" SSL layer that we use all over internally, with code provided by sslgen.c. All SSL-layer-specific code is then written in ssluse.c (for OpenSSL) and gtls.c (for GnuTLS). As far as possible, internals should not need to know what SSL layer that is in use. Building with GnuTLS currently makes two test cases fail. TODO.gnutls contains a few known outstanding issues for the GnuTLS support. GnuTLS support is enabled with configure --with-gnutls --- lib/gtls.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/gtls.h (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h new file mode 100644 index 000000000..2632b9686 --- /dev/null +++ b/lib/gtls.h @@ -0,0 +1,45 @@ +#ifndef __GTLS_H +#define __GTLS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + ***************************************************************************/ +int Curl_gtls_init(void); +int Curl_gtls_cleanup(void); +CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); + +/* tell GnuTLS to close down all open information regarding connections (and + thus session ID caching etc) */ +void Curl_gtls_close_all(struct SessionHandle *data); +void Curl_gtls_close(struct connectdata *conn); /* close a SSL connection */ + +/* return number of sent (non-SSL) bytes */ +int Curl_gtls_send(struct connectdata *conn, int sockindex, + void *mem, size_t len); +ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ + int num, /* socketindex */ + char *buf, /* store read data here */ + size_t buffersize, /* max amount to read */ + bool *wouldblock); +void Curl_gtls_session_free(void *ptr); +size_t Curl_gtls_version(char *buffer, size_t size); + +#endif -- cgit v1.2.1 From be0d17e812053bddd99e1d330c429399f17aee44 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 11 Nov 2006 21:34:43 +0000 Subject: cleaned up Curl_write() and the sub functions it uses for various protocols. They all now return ssize_t to Curl_write(). Unfortunately, Curl_read() is in a sorrier state but it too would benefit from a similar cleanup. --- lib/gtls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 2632b9686..4e7025c89 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -32,8 +32,8 @@ void Curl_gtls_close_all(struct SessionHandle *data); void Curl_gtls_close(struct connectdata *conn); /* close a SSL connection */ /* return number of sent (non-SSL) bytes */ -int Curl_gtls_send(struct connectdata *conn, int sockindex, - void *mem, size_t len); +ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, + void *mem, size_t len); ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ -- cgit v1.2.1 From 4750e6f3c5fd42e19998242ddb63d7d5506b9fd9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Jan 2007 23:11:14 +0000 Subject: - Linus Nielsen Feltzing introduced the --ftp-ssl-ccc command line option to curl that uses the new CURLOPT_FTP_SSL_CCC option in libcurl. If enabled, it will make libcurl shutdown SSL/TLS after the authentication is done on a FTP-SSL operation. --- lib/gtls.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 4e7025c89..bff3f8693 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -41,5 +41,6 @@ ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ bool *wouldblock); void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); +int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); #endif -- cgit v1.2.1 From 50c10aa5bf545eedfdbe561116656b6ec12654cd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 1 Aug 2007 21:20:01 +0000 Subject: Patrick Monnerat and I modified libcurl so that now it *copies* all strings passed to it with curl_easy_setopt()! Previously it has always just refered to the data, forcing the user to keep the data around until libcurl is done with it. That is now history and libcurl will instead clone the given strings and keep private copies. --- lib/gtls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index bff3f8693..feb02fd64 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -29,7 +29,9 @@ CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); /* tell GnuTLS to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_gtls_close_all(struct SessionHandle *data); -void Curl_gtls_close(struct connectdata *conn); /* close a SSL connection */ + + /* close a SSL connection */ +void Curl_gtls_close(struct connectdata *conn, int index); /* return number of sent (non-SSL) bytes */ ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, -- cgit v1.2.1 From 0bd2d54814145a6d0638ae0e663e6a69087e085c Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 27 Sep 2007 02:45:58 +0000 Subject: Renamed a few variables to avoid shadowing global declarations. --- lib/gtls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index feb02fd64..8dc0a30d4 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -31,7 +31,7 @@ CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); void Curl_gtls_close_all(struct SessionHandle *data); /* close a SSL connection */ -void Curl_gtls_close(struct connectdata *conn, int index); +void Curl_gtls_close(struct connectdata *conn, int sockindex); /* return number of sent (non-SSL) bytes */ ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, -- cgit v1.2.1 From 3940e69c91f8739b679309e870eae3e4e8af728f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 10 Jun 2008 21:53:59 +0000 Subject: fix warning in GnuTLS build by making sure Curl_gtls_send() takes a const void * --- lib/gtls.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 8dc0a30d4..ee560a9cb 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -35,7 +35,7 @@ void Curl_gtls_close(struct connectdata *conn, int sockindex); /* return number of sent (non-SSL) bytes */ ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, - void *mem, size_t len); + const void *mem, size_t len); ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ -- cgit v1.2.1 From 04d5c8fb779afdb4f7e85a701f8b4b987a4016ee Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 11 Jun 2008 17:01:58 +0000 Subject: - I did a cleanup of the internal generic SSL layer and how the various SSL libraries are supported. Starting now, each underlying SSL library support code does a set of defines for the 16 functions the generic layer (sslgen.c) uses (all these new function defines use the prefix "curlssl_"). This greatly simplified the generic layer in readability by involving much less #ifdefs and other preprocessor stuff and should make it easier for people to make libcurl work with new SSL libraries. Hopefully I can later on document these 16 functions somewhat as well. I also made most of the internal SSL-dependent functions (using Curl_ssl_ prefix) #defined to nothing when no SSL support is requested - previously they would unnecessarily call mostly empty functions. --- lib/gtls.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index ee560a9cb..49e39c563 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -22,6 +22,9 @@ * * $Id$ ***************************************************************************/ + +#ifdef USE_GNUTLS + int Curl_gtls_init(void); int Curl_gtls_cleanup(void); CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); @@ -45,4 +48,22 @@ void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); +/* API setup for GnuTLS */ +#define curlssl_init Curl_gtls_init +#define curlssl_cleanup Curl_gtls_cleanup +#define curlssl_connect Curl_gtls_connect +#define curlssl_session_free(x) Curl_gtls_session_free(x) +#define curlssl_close_all Curl_gtls_close_all +#define curlssl_close Curl_gtls_close +#define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y) +#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT) +#define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT) +#define curlssl_engines_list(x) (x=x, NULL) +#define curlssl_send Curl_gtls_send +#define curlssl_recv Curl_gtls_recv +#define curlssl_version Curl_gtls_version +#define curlssl_check_cxn(x) (x=x, -1) +#define curlssl_data_pending(x,y) (x=x, y=y, 0) + +#endif /* USE_GNUTLS */ #endif -- cgit v1.2.1 From 3e55fef5e1ac57597e30d5a490a93d63bc7a363a Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 17 Oct 2008 22:23:48 +0000 Subject: Fixed a compile error reported by Albert Chin on AIX and IRIX when using GTLS. --- lib/gtls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 49e39c563..5f4409455 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -58,7 +58,7 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); #define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT) #define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT) -#define curlssl_engines_list(x) (x=x, NULL) +#define curlssl_engines_list(x) (x=x, (curl_slist *)NULL) #define curlssl_send Curl_gtls_send #define curlssl_recv Curl_gtls_recv #define curlssl_version Curl_gtls_version -- cgit v1.2.1 From 8eee5f3253f790a25e027bd55638597868d35bda Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 17 Oct 2008 22:33:08 +0000 Subject: Forgot it's a struct --- lib/gtls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 5f4409455..9d8c0723d 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -58,7 +58,7 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); #define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT) #define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT) -#define curlssl_engines_list(x) (x=x, (curl_slist *)NULL) +#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_send Curl_gtls_send #define curlssl_recv Curl_gtls_recv #define curlssl_version Curl_gtls_version -- cgit v1.2.1 From 9a4c887c4a7279acc4cae66b11540746244e9cc3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 12 Feb 2009 20:48:40 +0000 Subject: Added support for Digest and NTLM authentication using GnuTLS. --- lib/gtls.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 9d8c0723d..661cfef78 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -47,6 +47,7 @@ ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); +int Curl_gtls_seed(struct SessionHandle *data); /* API setup for GnuTLS */ #define curlssl_init Curl_gtls_init -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/gtls.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 661cfef78..0d3f3fa6e 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #ifdef USE_GNUTLS -- cgit v1.2.1 From ff8711135e9311d5a54c7210a5a87a86077271cb Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sun, 4 Apr 2010 23:37:18 +0200 Subject: refactorize interface of Curl_ssl_recv/Curl_ssl_send --- lib/gtls.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 0d3f3fa6e..9fe618a32 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -35,14 +35,14 @@ void Curl_gtls_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_gtls_close(struct connectdata *conn, int sockindex); -/* return number of sent (non-SSL) bytes */ +/* for documentation see Curl_ssl_send() in sslgen.h */ ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, - const void *mem, size_t len); -ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ - int num, /* socketindex */ - char *buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - bool *wouldblock); + const void *mem, size_t len, int *curlcode); + +/* for documentation see Curl_ssl_recv() in sslgen.h */ +ssize_t Curl_gtls_recv(struct connectdata *conn, int num, char *buf, + size_t buffersize, int *curlcode); + void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); -- cgit v1.2.1 From c2888604d7ead19473b5621f8f2edab60fc418de Mon Sep 17 00:00:00 2001 From: Jerome Vouillon Date: Fri, 16 Apr 2010 22:43:01 +0200 Subject: GnuTLS: make the connection phase non-blocking When multi interface is used, the SSL handshake is no longer blocking when GnuTLS is used. --- lib/gtls.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 9fe618a32..da3489bc3 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -27,6 +27,9 @@ int Curl_gtls_init(void); int Curl_gtls_cleanup(void); CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); +CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn, + int sockindex, + bool *done); /* tell GnuTLS to close down all open information regarding connections (and thus session ID caching etc) */ @@ -52,6 +55,7 @@ int Curl_gtls_seed(struct SessionHandle *data); #define curlssl_init Curl_gtls_init #define curlssl_cleanup Curl_gtls_cleanup #define curlssl_connect Curl_gtls_connect +#define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking #define curlssl_session_free(x) Curl_gtls_session_free(x) #define curlssl_close_all Curl_gtls_close_all #define curlssl_close Curl_gtls_close -- cgit v1.2.1 From d64bd82bdcb169d0647a80f00068cedd761f8163 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 7 May 2010 15:05:34 +0200 Subject: sendrecv: split the I/O handling into private handler Howard Chu brought the bulk work of this patch that properly moves out the sending and recving of data to the parts of the code that are properly responsible for the various ways of doing so. Daniel Stenberg assisted with polishing a few bits and fixed some minor flaws in the original patch. Another upside of this patch is that we now abuse CURLcodes less with the "magic" -1 return codes and instead use CURLE_AGAIN more consistently. --- lib/gtls.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index da3489bc3..51e0af1f5 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -38,14 +38,6 @@ void Curl_gtls_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_gtls_close(struct connectdata *conn, int sockindex); -/* for documentation see Curl_ssl_send() in sslgen.h */ -ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex, - const void *mem, size_t len, int *curlcode); - -/* for documentation see Curl_ssl_recv() in sslgen.h */ -ssize_t Curl_gtls_recv(struct connectdata *conn, int num, char *buf, - size_t buffersize, int *curlcode); - void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); @@ -63,8 +55,6 @@ int Curl_gtls_seed(struct SessionHandle *data); #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT) #define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) -#define curlssl_send Curl_gtls_send -#define curlssl_recv Curl_gtls_recv #define curlssl_version Curl_gtls_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) (x=x, y=y, 0) -- cgit v1.2.1 From 01f05d0c758795e5bb02c6245fc73b8458eb397a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 5 Apr 2011 15:14:02 +0200 Subject: return code cleanup: build, init and run-time errors Stop the abuse of CURLE_FAILED_INIT as return code for things not being init related by introducing two new return codes: CURLE_NOT_BUILT_IN and CURLE_UNKNOWN_OPTION CURLE_NOT_BUILT_IN replaces return code 4 that has been obsoleted for several years. It is used for returning error when something is attempted to be used but the feature/option was not enabled or explictitly disabled at build-time. Getting this error mostly means that libcurl needs to be rebuilt. CURLE_FAILED_INIT is now saved and used strictly for init failures. Getting this problem means something went seriously wrong, like a resource shortage or similar. CURLE_UNKNOWN_OPTION is the option formerly known as CURLE_UNKNOWN_TELNET_OPTION (and the old name is still present, separately defined to be removed in a very distant future). This error code is meant to be used to return when an option is given to libcurl that isn't known. This problem would mostly indicate a problem in the program that uses libcurl. --- lib/gtls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 51e0af1f5..6275b49a3 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -52,8 +52,8 @@ int Curl_gtls_seed(struct SessionHandle *data); #define curlssl_close_all Curl_gtls_close_all #define curlssl_close Curl_gtls_close #define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y) -#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT) -#define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT) +#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) +#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_gtls_version #define curlssl_check_cxn(x) (x=x, -1) -- cgit v1.2.1 From 78199b6030e07112d1515272afd7017337fa79c7 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 28 Aug 2011 11:29:09 +0200 Subject: NTLM: header inclusion cleanup follow-up --- lib/gtls.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 6275b49a3..733122e6c 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -1,5 +1,5 @@ -#ifndef __GTLS_H -#define __GTLS_H +#ifndef HEADER_CURL_GTLS_H +#define HEADER_CURL_GTLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -22,8 +22,12 @@ * ***************************************************************************/ +#include "setup.h" + #ifdef USE_GNUTLS +#include "urldata.h" + int Curl_gtls_init(void); int Curl_gtls_cleanup(void); CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); @@ -60,4 +64,4 @@ int Curl_gtls_seed(struct SessionHandle *data); #define curlssl_data_pending(x,y) (x=x, y=y, 0) #endif /* USE_GNUTLS */ -#endif +#endif /* HEADER_CURL_GTLS_H */ -- cgit v1.2.1 From 849179ba2739ab9a0ad079384b125d9c1745db5f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 26 Jun 2012 14:52:46 +0200 Subject: SSL cleanup: use crypto functions through the sslgen layer curl_ntlm_msgs.c would previously use an #ifdef maze and direct SSL-library calls instead of using the SSL layer we have for this purpose. --- lib/gtls.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/gtls.h') diff --git a/lib/gtls.h b/lib/gtls.h index 733122e6c..45b755a0e 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -47,6 +47,14 @@ size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); int Curl_gtls_seed(struct SessionHandle *data); +void Curl_gtls_random(struct SessionHandle *data, + unsigned char *entropy, + size_t length); +void Curl_gtls_md5sum(unsigned char *tmp, /* input */ + size_t tmplen, + unsigned char *md5sum, /* output */ + size_t md5len); + /* API setup for GnuTLS */ #define curlssl_init Curl_gtls_init #define curlssl_cleanup Curl_gtls_cleanup @@ -62,6 +70,8 @@ int Curl_gtls_seed(struct SessionHandle *data); #define curlssl_version Curl_gtls_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) (x=x, y=y, 0) +#define curlssl_random(x,y,z) Curl_gtls_random(x,y,z) +#define curlssl_md5sum(a,b,c,d) Curl_gtls_md5sum(a,b,c,d) #endif /* USE_GNUTLS */ #endif /* HEADER_CURL_GTLS_H */ -- cgit v1.2.1