1 #ifndef HEADER_CURL_SSLGEN_H
2 #define HEADER_CURL_SSLGEN_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2012, 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 ***************************************************************************/
26 #ifndef MD5_DIGEST_LENGTH
27 #define MD5_DIGEST_LENGTH 16 /* fixed size */
30 bool Curl_ssl_config_matches(struct ssl_config_data* data,
31 struct ssl_config_data* needle);
32 bool Curl_clone_ssl_config(struct ssl_config_data* source,
33 struct ssl_config_data* dest);
34 void Curl_free_ssl_config(struct ssl_config_data* sslc);
37 int Curl_ssl_init(void);
38 void Curl_ssl_cleanup(void);
39 CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex);
40 CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn,
43 /* tell the SSL stuff to close down all open information regarding
44 connections (and thus session ID caching etc) */
45 void Curl_ssl_close_all(struct SessionHandle *data);
46 void Curl_ssl_close(struct connectdata *conn, int sockindex);
47 CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex);
48 CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine);
49 /* Sets engine as default for all SSL operations */
50 CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data);
51 struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data);
53 /* init the SSL session ID cache */
54 CURLcode Curl_ssl_initsessions(struct SessionHandle *, size_t);
55 size_t Curl_ssl_version(char *buffer, size_t size);
56 bool Curl_ssl_data_pending(const struct connectdata *conn,
58 int Curl_ssl_check_cxn(struct connectdata *conn);
59 void Curl_ssl_free_certinfo(struct SessionHandle *data);
61 /* Functions to be used by SSL library adaptation functions */
63 /* extract a session ID */
64 int Curl_ssl_getsessionid(struct connectdata *conn,
66 size_t *idsize) /* set 0 if unknown */;
67 /* add a new session ID */
68 CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
71 /* Kill a single session ID entry in the cache */
72 void Curl_ssl_kill_session(struct curl_ssl_session *session);
73 /* delete a session from the cache */
74 void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
76 /* get N random bytes into the buffer */
77 void Curl_ssl_random(struct SessionHandle *data, unsigned char *buffer,
79 void Curl_ssl_md5sum(unsigned char *tmp, /* input */
81 unsigned char *md5sum, /* output */
84 #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
87 /* When SSL support is not present, just define away these function calls */
88 #define Curl_ssl_init() 1
89 #define Curl_ssl_cleanup() Curl_nop_stmt
90 #define Curl_ssl_connect(x,y) CURLE_NOT_BUILT_IN
91 #define Curl_ssl_close_all(x) Curl_nop_stmt
92 #define Curl_ssl_close(x,y) Curl_nop_stmt
93 #define Curl_ssl_shutdown(x,y) CURLE_NOT_BUILT_IN
94 #define Curl_ssl_set_engine(x,y) CURLE_NOT_BUILT_IN
95 #define Curl_ssl_set_engine_default(x) CURLE_NOT_BUILT_IN
96 #define Curl_ssl_engines_list(x) NULL
97 #define Curl_ssl_send(a,b,c,d,e) -1
98 #define Curl_ssl_recv(a,b,c,d,e) -1
99 #define Curl_ssl_initsessions(x,y) CURLE_OK
100 #define Curl_ssl_version(x,y) 0
101 #define Curl_ssl_data_pending(x,y) 0
102 #define Curl_ssl_check_cxn(x) 0
103 #define Curl_ssl_free_certinfo(x) Curl_nop_stmt
104 #define Curl_ssl_connect_nonblocking(x,y,z) CURLE_NOT_BUILT_IN
105 #define Curl_ssl_kill_session(x) Curl_nop_stmt
108 #endif /* HEADER_CURL_SSLGEN_H */