1999-12-29 15:20:26 +01:00
|
|
|
#ifndef __SSLUSE_H
|
|
|
|
#define __SSLUSE_H
|
2002-09-03 13:52:59 +02:00
|
|
|
/***************************************************************************
|
2004-12-13 17:43:00 +01:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
1999-12-29 15:20:26 +01:00
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2008-06-11 19:01:58 +02:00
|
|
|
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
1999-12-29 15:20:26 +01:00
|
|
|
*
|
2002-09-03 13:52:59 +02:00
|
|
|
* 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.
|
2004-12-13 17:43:00 +01:00
|
|
|
*
|
2001-01-03 10:29:33 +01:00
|
|
|
* 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
|
2002-09-03 13:52:59 +02:00
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
1999-12-29 15:20:26 +01:00
|
|
|
*
|
2001-01-03 10:29:33 +01:00
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
1999-12-29 15:20:26 +01:00
|
|
|
*
|
2001-01-03 10:29:33 +01:00
|
|
|
* $Id$
|
2002-09-03 13:52:59 +02:00
|
|
|
***************************************************************************/
|
2005-04-07 17:27:13 +02:00
|
|
|
|
2008-06-11 19:01:58 +02:00
|
|
|
#ifdef USE_SSLEAY
|
2005-04-07 17:27:13 +02:00
|
|
|
/*
|
|
|
|
* This header should only be needed to get included by sslgen.c and ssluse.c
|
|
|
|
*/
|
|
|
|
|
2001-02-20 18:35:51 +01:00
|
|
|
#include "urldata.h"
|
2005-04-07 17:27:13 +02:00
|
|
|
CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex);
|
2007-01-06 00:11:14 +01:00
|
|
|
CURLcode Curl_ossl_connect_nonblocking(struct connectdata *conn,
|
|
|
|
int sockindex,
|
2006-03-21 22:54:44 +01:00
|
|
|
bool *done);
|
2007-07-29 14:54:05 +02:00
|
|
|
|
|
|
|
/* close a SSL connection */
|
|
|
|
void Curl_ossl_close(struct connectdata *conn, int sockindex);
|
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
/* tell OpenSSL to close down all open information regarding connections (and
|
|
|
|
thus session ID caching etc) */
|
|
|
|
int Curl_ossl_close_all(struct SessionHandle *data);
|
2007-07-29 14:54:05 +02:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
/* Sets an OpenSSL engine */
|
|
|
|
CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);
|
2001-09-07 11:40:46 +02:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
/* function provided for the generic SSL-layer, called when a session id
|
|
|
|
should be freed */
|
|
|
|
void Curl_ossl_session_free(void *ptr);
|
2001-08-28 10:37:54 +02:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
/* Sets engine as default for all SSL operations */
|
|
|
|
CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data);
|
2001-08-28 10:37:54 +02:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
/* Build list of OpenSSL engines */
|
|
|
|
struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data);
|
2004-12-13 17:43:00 +01:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
int Curl_ossl_init(void);
|
|
|
|
void Curl_ossl_cleanup(void);
|
2004-12-13 17:43:00 +01:00
|
|
|
|
2006-11-11 23:05:33 +01:00
|
|
|
ssize_t Curl_ossl_send(struct connectdata *conn,
|
|
|
|
int sockindex,
|
2008-05-09 13:27:54 +02:00
|
|
|
const void *mem,
|
2006-11-11 23:05:33 +01:00
|
|
|
size_t len);
|
2005-04-07 17:27:13 +02:00
|
|
|
ssize_t Curl_ossl_recv(struct connectdata *conn, /* connection data */
|
|
|
|
int num, /* socketindex */
|
|
|
|
char *buf, /* store read data here */
|
|
|
|
size_t buffersize, /* max amount to read */
|
|
|
|
bool *wouldblock);
|
2004-12-13 17:43:00 +01:00
|
|
|
|
2005-04-07 17:27:13 +02:00
|
|
|
size_t Curl_ossl_version(char *buffer, size_t size);
|
2006-05-11 00:17:42 +02:00
|
|
|
int Curl_ossl_check_cxn(struct connectdata *cxn);
|
2006-06-07 16:14:04 +02:00
|
|
|
int Curl_ossl_seed(struct SessionHandle *data);
|
2006-05-11 00:17:42 +02:00
|
|
|
|
2007-01-06 00:11:14 +01:00
|
|
|
int Curl_ossl_shutdown(struct connectdata *conn, int sockindex);
|
2008-06-11 19:01:58 +02:00
|
|
|
bool Curl_ossl_data_pending(const struct connectdata *conn,
|
|
|
|
int connindex);
|
2007-01-06 00:11:14 +01:00
|
|
|
|
2008-06-11 19:01:58 +02:00
|
|
|
/* API setup for OpenSSL */
|
|
|
|
#define curlssl_init Curl_ossl_init
|
|
|
|
#define curlssl_cleanup Curl_ossl_cleanup
|
|
|
|
#define curlssl_connect Curl_ossl_connect
|
|
|
|
#define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking
|
|
|
|
#define curlssl_session_free(x) Curl_ossl_session_free(x)
|
|
|
|
#define curlssl_close_all Curl_ossl_close_all
|
|
|
|
#define curlssl_close Curl_ossl_close
|
|
|
|
#define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y)
|
|
|
|
#define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y)
|
|
|
|
#define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x)
|
|
|
|
#define curlssl_engines_list(x) Curl_ossl_engines_list(x)
|
|
|
|
#define curlssl_send Curl_ossl_send
|
|
|
|
#define curlssl_recv Curl_ossl_recv
|
|
|
|
#define curlssl_version Curl_ossl_version
|
|
|
|
#define curlssl_check_cxn Curl_ossl_check_cxn
|
|
|
|
#define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y)
|
|
|
|
|
|
|
|
#endif /* USE_SSLEAY */
|
1999-12-29 15:20:26 +01:00
|
|
|
#endif
|