Update tag value for tizen 2.0 build
[external/curl.git] / lib / sslgen.h
1 #ifndef __SSLGEN_H
2 #define __SSLGEN_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2008, 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
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.
15  *
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.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24
25 bool Curl_ssl_config_matches(struct ssl_config_data* data,
26                              struct ssl_config_data* needle);
27 bool Curl_clone_ssl_config(struct ssl_config_data* source,
28                            struct ssl_config_data* dest);
29 void Curl_free_ssl_config(struct ssl_config_data* sslc);
30
31 #ifdef USE_SSL
32 int Curl_ssl_init(void);
33 void Curl_ssl_cleanup(void);
34 CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex);
35 CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn,
36                                       int sockindex,
37                                       bool *done);
38 /* tell the SSL stuff to close down all open information regarding
39    connections (and thus session ID caching etc) */
40 void Curl_ssl_close_all(struct SessionHandle *data);
41 void Curl_ssl_close(struct connectdata *conn, int sockindex);
42 CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex);
43 CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine);
44 /* Sets engine as default for all SSL operations */
45 CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data);
46 struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data);
47
48 /* init the SSL session ID cache */
49 CURLcode Curl_ssl_initsessions(struct SessionHandle *, long);
50 size_t Curl_ssl_version(char *buffer, size_t size);
51 bool Curl_ssl_data_pending(const struct connectdata *conn,
52                            int connindex);
53 int Curl_ssl_check_cxn(struct connectdata *conn);
54 void Curl_ssl_free_certinfo(struct SessionHandle *data);
55
56 /* Functions to be used by SSL library adaptation functions */
57
58 /* extract a session ID */
59 int Curl_ssl_getsessionid(struct connectdata *conn,
60                           void **ssl_sessionid,
61                           size_t *idsize) /* set 0 if unknown */;
62 /* add a new session ID */
63 CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
64                                void *ssl_sessionid,
65                                size_t idsize);
66 /* delete a session from the cache */
67 void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
68
69 #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
70
71 #else
72 /* When SSL support is not present, just define away these function calls */
73 #define Curl_ssl_init() 1
74 #define Curl_ssl_cleanup() do { } while (0)
75 #define Curl_ssl_connect(x,y) CURLE_FAILED_INIT
76 #define Curl_ssl_close_all(x)
77 #define Curl_ssl_close(x,y)
78 #define Curl_ssl_shutdown(x,y) CURLE_FAILED_INIT
79 #define Curl_ssl_set_engine(x,y) CURLE_FAILED_INIT
80 #define Curl_ssl_set_engine_default(x) CURLE_FAILED_INIT
81 #define Curl_ssl_engines_list(x) NULL
82 #define Curl_ssl_send(a,b,c,d,e) -1
83 #define Curl_ssl_recv(a,b,c,d,e) -1
84 #define Curl_ssl_initsessions(x,y) CURLE_OK
85 #define Curl_ssl_version(x,y) 0
86 #define Curl_ssl_data_pending(x,y) 0
87 #define Curl_ssl_check_cxn(x) 0
88 #define Curl_ssl_free_certinfo(x)
89
90 #endif
91
92 #endif /* USE_SSL */