432d3d7ce404c0a30b6fccb656683437b5a2ad41
[platform/upstream/curl.git] / lib / curl_darwinssl.h
1 #ifndef HEADER_CURL_DARWINSSL_H
2 #define HEADER_CURL_DARWINSSL_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 2012 - 2013, Nick Zitzmann, <nickzman@gmail.com>.
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 #include "curl_setup.h"
25
26 #ifdef USE_DARWINSSL
27
28 CURLcode Curl_darwinssl_connect(struct connectdata *conn, int sockindex);
29
30 CURLcode Curl_darwinssl_connect_nonblocking(struct connectdata *conn,
31                                             int sockindex,
32                                             bool *done);
33
34 /* this function doesn't actually do anything */
35 void Curl_darwinssl_close_all(struct SessionHandle *data);
36
37 /* close a SSL connection */
38 void Curl_darwinssl_close(struct connectdata *conn, int sockindex);
39
40 void Curl_darwinssl_session_free(void *ptr);
41 size_t Curl_darwinssl_version(char *buffer, size_t size);
42 int Curl_darwinssl_shutdown(struct connectdata *conn, int sockindex);
43 int Curl_darwinssl_check_cxn(struct connectdata *conn);
44 bool Curl_darwinssl_data_pending(const struct connectdata *conn,
45                                  int connindex);
46
47 void Curl_darwinssl_random(struct SessionHandle *data,
48                            unsigned char *entropy,
49                            size_t length);
50 void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
51                            size_t tmplen,
52                            unsigned char *md5sum, /* output */
53                            size_t md5len);
54
55 /* this backend provides these functions: */
56 #define have_curlssl_random 1
57 #define have_curlssl_md5sum 1
58
59 /* API setup for SecureTransport */
60 #define curlssl_init() (1)
61 #define curlssl_cleanup() Curl_nop_stmt
62 #define curlssl_connect Curl_darwinssl_connect
63 #define curlssl_connect_nonblocking Curl_darwinssl_connect_nonblocking
64 #define curlssl_session_free(x) Curl_darwinssl_session_free(x)
65 #define curlssl_close_all Curl_darwinssl_close_all
66 #define curlssl_close Curl_darwinssl_close
67 #define curlssl_shutdown(x,y) 0
68 #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
69 #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
70 #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
71 #define curlssl_version Curl_darwinssl_version
72 #define curlssl_check_cxn Curl_darwinssl_check_cxn
73 #define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y)
74 #define curlssl_random(x,y,z) Curl_darwinssl_random(x,y,z)
75 #define curlssl_md5sum(a,b,c,d) Curl_darwinssl_md5sum(a,b,c,d)
76
77 #endif /* USE_DARWINSSL */
78 #endif /* HEADER_CURL_DARWINSSL_H */