1 #ifndef HEADER_CURL_SSLUSE_H
2 #define HEADER_CURL_SSLUSE_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
25 #include "curl_setup.h"
29 * This header should only be needed to get included by vtls.c and openssl.c
34 CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex);
35 CURLcode Curl_ossl_connect_nonblocking(struct connectdata *conn,
39 /* close a SSL connection */
40 void Curl_ossl_close(struct connectdata *conn, int sockindex);
42 /* tell OpenSSL to close down all open information regarding connections (and
43 thus session ID caching etc) */
44 void Curl_ossl_close_all(struct SessionHandle *data);
46 /* Sets an OpenSSL engine */
47 CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);
49 /* function provided for the generic SSL-layer, called when a session id
51 void Curl_ossl_session_free(void *ptr);
53 /* Sets engine as default for all SSL operations */
54 CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data);
56 /* Build list of OpenSSL engines */
57 struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data);
59 int Curl_ossl_init(void);
60 void Curl_ossl_cleanup(void);
62 size_t Curl_ossl_version(char *buffer, size_t size);
63 int Curl_ossl_check_cxn(struct connectdata *cxn);
64 int Curl_ossl_shutdown(struct connectdata *conn, int sockindex);
65 bool Curl_ossl_data_pending(const struct connectdata *conn,
68 /* return 0 if a find random is filled in */
69 int Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy,
71 void Curl_ossl_md5sum(unsigned char *tmp, /* input */
73 unsigned char *md5sum /* output */,
75 void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */
77 unsigned char *sha256sum /* output */,
80 bool Curl_ossl_cert_status_request(void);
82 /* Set the API backend definition to OpenSSL */
83 #define CURL_SSL_BACKEND CURLSSLBACKEND_OPENSSL
85 /* this backend supports the CAPATH option */
86 #define have_curlssl_ca_path 1
88 /* this backend supports CURLOPT_CERTINFO */
89 #define have_curlssl_certinfo 1
91 /* this backend suppots CURLOPT_SSL_CTX_* */
92 #define have_curlssl_ssl_ctx 1
94 /* API setup for OpenSSL */
95 #define curlssl_init Curl_ossl_init
96 #define curlssl_cleanup Curl_ossl_cleanup
97 #define curlssl_connect Curl_ossl_connect
98 #define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking
99 #define curlssl_session_free(x) Curl_ossl_session_free(x)
100 #define curlssl_close_all Curl_ossl_close_all
101 #define curlssl_close Curl_ossl_close
102 #define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y)
103 #define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y)
104 #define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x)
105 #define curlssl_engines_list(x) Curl_ossl_engines_list(x)
106 #define curlssl_version Curl_ossl_version
107 #define curlssl_check_cxn Curl_ossl_check_cxn
108 #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y)
109 #define curlssl_random(x,y,z) Curl_ossl_random(x,y,z)
110 #define curlssl_md5sum(a,b,c,d) Curl_ossl_md5sum(a,b,c,d)
111 #ifndef OPENSSL_NO_SHA256
112 #define curlssl_sha256sum(a,b,c,d) Curl_ossl_sha256sum(a,b,c,d)
114 #define curlssl_cert_status_request() Curl_ossl_cert_status_request()
116 #define DEFAULT_CIPHER_SELECTION \
117 "ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH"
119 #endif /* USE_OPENSSL */
120 #endif /* HEADER_CURL_SSLUSE_H */