From b3461bab1df4221abf74d7c159cf5c719b1b9744 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Jul 2007 21:46:26 +0000 Subject: Implemented the parts of Patrick Monnerat's OS/400 patch that introduces support for the OS/400 Secure Sockets Layer library --- lib/qssl.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 lib/qssl.h (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h new file mode 100644 index 000000000..61ff80adf --- /dev/null +++ b/lib/qssl.h @@ -0,0 +1,52 @@ +#ifndef __QSSL_H +#define __QSSL_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * 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 + * 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$ + ***************************************************************************/ + +/* + * This header should only be needed to get included by sslgen.c and qssl.c + */ + +#include "urldata.h" + +int Curl_qsossl_init(void); +void Curl_qsossl_cleanup(void); +CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex); +void Curl_qsossl_close(struct connectdata * conn); /* close a SSL connection */ +int Curl_qsossl_close_all(struct SessionHandle * data); +int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); + +ssize_t Curl_qsossl_send(struct connectdata * conn, + int sockindex, + void * mem, + size_t len); +ssize_t Curl_qsossl_recv(struct connectdata * conn, /* connection data */ + int num, /* socketindex */ + char * buf, /* store read data here */ + size_t buffersize, /* max amount to read */ + bool * wouldblock); + +size_t Curl_qsossl_version(char * buffer, size_t size); +int Curl_qsossl_check_cxn(struct connectdata * cxn); + +#endif -- cgit v1.2.1 From f01c6e51f463a14eee8fdb43835cb7d2a144a214 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 30 Jul 2007 21:41:12 +0000 Subject: Patrick Monnerat restored qssl successful compilation and loading --- lib/qssl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index 61ff80adf..55d72d4dc 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -32,7 +32,7 @@ int Curl_qsossl_init(void); void Curl_qsossl_cleanup(void); CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex); -void Curl_qsossl_close(struct connectdata * conn); /* close a SSL connection */ +void Curl_qsossl_close(struct connectdata *conn, int sockindex); int Curl_qsossl_close_all(struct SessionHandle * data); int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); -- cgit v1.2.1 From 24bf52bc691cca9f8b3a668e26b4dd695ec4991c Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Tue, 20 May 2008 10:21:50 +0000 Subject: Adapting last changes to OS400: _ Updated packages/OS400/curl.inc.in with new definitions. _ New connect/bind/sendto/recvfrom wrappers to support AF_UNIX sockets. _ Include files line length shortened below 100 chars. _ Const parameter in lib/qssl.[ch]. _ Typos in packages/OS400/initscript.sh. --- lib/qssl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index 55d72d4dc..ff3f6f56a 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -38,7 +38,7 @@ int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); ssize_t Curl_qsossl_send(struct connectdata * conn, int sockindex, - void * mem, + const void * mem, size_t len); ssize_t Curl_qsossl_recv(struct connectdata * conn, /* connection data */ int num, /* socketindex */ -- 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/qssl.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index ff3f6f56a..64b91347f 100644 --- a/lib/qssl.h +++ b/lib/qssl.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 @@ -29,6 +29,7 @@ #include "urldata.h" +#ifdef USE_QSOSSL int Curl_qsossl_init(void); void Curl_qsossl_cleanup(void); CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex); @@ -49,4 +50,23 @@ ssize_t Curl_qsossl_recv(struct connectdata * conn, /* connection data */ size_t Curl_qsossl_version(char * buffer, size_t size); int Curl_qsossl_check_cxn(struct connectdata * cxn); +/* API setup for QsoSSL */ +#define curlssl_init Curl_qossl_init +#define curlssl_cleanup Curl_qossl_cleanup +#define curlssl_connect Curl_qossl_connect + +/* No session handling for QsoSSL */ +#define curlssl_session_free(x) +#define curlssl_close_all Curl_qsossl_close_all +#define curlssl_close Curl_qsossl_close +#define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y) +#define curlssl_set_engine(x,y) CURLE_FAILED_INIT +#define curlssl_set_engine_default(x) CURLE_FAILED_INIT +#define curlssl_engines_list(x) NULL +#define curlssl_send Curl_qsossl_send +#define curlssl_recv Curl_qsossl_recv +#define curlssl_version Curl_qsossl_version +#define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) +#define curlssl_data_pending(x,y) 0 +#endif /* USE_QSOSSL */ #endif -- cgit v1.2.1 From ddfa4b889681131bf19c8a911e9b376e14380551 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Mon, 7 Jul 2008 10:39:46 +0000 Subject: New options added to OS400 wrapper and ILERPG definitions. Wrong defines (typos) for QSSL layer fixed. --- lib/qssl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index 64b91347f..e7bc2b15b 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -51,9 +51,9 @@ size_t Curl_qsossl_version(char * buffer, size_t size); int Curl_qsossl_check_cxn(struct connectdata * cxn); /* API setup for QsoSSL */ -#define curlssl_init Curl_qossl_init -#define curlssl_cleanup Curl_qossl_cleanup -#define curlssl_connect Curl_qossl_connect +#define curlssl_init Curl_qsossl_init +#define curlssl_cleanup Curl_qsossl_cleanup +#define curlssl_connect Curl_qsossl_connect /* No session handling for QsoSSL */ #define curlssl_session_free(x) -- 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/qssl.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index e7bc2b15b..9a984bf4d 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ /* -- cgit v1.2.1 From 10977f57de0d2426f479ef4d36f8a203488fdda7 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 7 Apr 2010 10:07:29 +0200 Subject: qssl: reflect recent code changes in SSL interface Reported by Guenter Knauf. --- lib/qssl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index 9a984bf4d..a0cf8cc29 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -36,15 +36,19 @@ void Curl_qsossl_close(struct connectdata *conn, int sockindex); int Curl_qsossl_close_all(struct SessionHandle * data); int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); +/* for documentation see Curl_ssl_send() in sslgen.h */ ssize_t Curl_qsossl_send(struct connectdata * conn, int sockindex, const void * mem, - size_t len); + size_t len, + int * curlcode); + +/* for documentation see Curl_ssl_recv() in sslgen.h */ ssize_t Curl_qsossl_recv(struct connectdata * conn, /* connection data */ int num, /* socketindex */ char * buf, /* store read data here */ size_t buffersize, /* max amount to read */ - bool * wouldblock); + int * curlcode); size_t Curl_qsossl_version(char * buffer, size_t size); int Curl_qsossl_check_cxn(struct connectdata * cxn); -- 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/qssl.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index a0cf8cc29..45190e623 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -36,20 +36,6 @@ void Curl_qsossl_close(struct connectdata *conn, int sockindex); int Curl_qsossl_close_all(struct SessionHandle * data); int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); -/* for documentation see Curl_ssl_send() in sslgen.h */ -ssize_t Curl_qsossl_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_qsossl_recv(struct connectdata * conn, /* connection data */ - int num, /* socketindex */ - char * buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - int * curlcode); - size_t Curl_qsossl_version(char * buffer, size_t size); int Curl_qsossl_check_cxn(struct connectdata * cxn); @@ -66,8 +52,6 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn); #define curlssl_set_engine(x,y) CURLE_FAILED_INIT #define curlssl_set_engine_default(x) CURLE_FAILED_INIT #define curlssl_engines_list(x) NULL -#define curlssl_send Curl_qsossl_send -#define curlssl_recv Curl_qsossl_recv #define curlssl_version Curl_qsossl_version #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) #define curlssl_data_pending(x,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/qssl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index 45190e623..bd195ff7b 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, 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 @@ -49,8 +49,8 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn); #define curlssl_close_all Curl_qsossl_close_all #define curlssl_close Curl_qsossl_close #define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y) -#define curlssl_set_engine(x,y) CURLE_FAILED_INIT -#define curlssl_set_engine_default(x) CURLE_FAILED_INIT +#define curlssl_set_engine(x,y) CURLE_NOT_BUILT_IN +#define curlssl_set_engine_default(x) CURLE_NOT_BUILT_IN #define curlssl_engines_list(x) NULL #define curlssl_version Curl_qsossl_version #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) -- cgit v1.2.1 From 6b75d2c2df7209919a70a29a4479625b62fb3c28 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 3 Sep 2011 16:06:10 +0200 Subject: fix a bunch of MSVC compiler warnings --- lib/qssl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/qssl.h') diff --git a/lib/qssl.h b/lib/qssl.h index bd195ff7b..a523cb1f3 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -1,5 +1,5 @@ -#ifndef __QSSL_H -#define __QSSL_H +#ifndef HEADER_CURL_QSSL_H +#define HEADER_CURL_QSSL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -21,6 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ +#include "setup.h" /* * This header should only be needed to get included by sslgen.c and qssl.c @@ -45,7 +46,7 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn); #define curlssl_connect Curl_qsossl_connect /* No session handling for QsoSSL */ -#define curlssl_session_free(x) +#define curlssl_session_free(x) Curl_nop_stmt #define curlssl_close_all Curl_qsossl_close_all #define curlssl_close Curl_qsossl_close #define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y) @@ -56,4 +57,5 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn); #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) #define curlssl_data_pending(x,y) 0 #endif /* USE_QSOSSL */ -#endif + +#endif /* HEADER_CURL_QSSL_H */ -- cgit v1.2.1