2011-02-28 21:02:47 -05:00
|
|
|
#ifndef HEADER_CURL_CYASSL_H
|
|
|
|
#define HEADER_CURL_CYASSL_H
|
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2016-05-01 11:05:38 -04:00
|
|
|
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-02-28 21:02:47 -05:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2016-02-02 18:19:02 -05:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2011-02-28 21:02:47 -05: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
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2013-01-06 13:06:49 -05:00
|
|
|
#include "curl_setup.h"
|
2011-02-28 21:02:47 -05:00
|
|
|
|
|
|
|
#ifdef USE_CYASSL
|
|
|
|
|
2016-05-01 11:05:38 -04:00
|
|
|
/* KEEP_PEER_CERT is a product of the presence of build time symbol
|
|
|
|
OPENSSL_EXTRA without NO_CERTS, depending on the version. KEEP_PEER_CERT is
|
|
|
|
in wolfSSL's settings.h, and the latter two are build time symbols in
|
|
|
|
options.h. */
|
|
|
|
#ifndef KEEP_PEER_CERT
|
|
|
|
#if defined(HAVE_CYASSL_GET_PEER_CERTIFICATE) || \
|
|
|
|
defined(HAVE_WOLFSSL_GET_PEER_CERTIFICATE) || \
|
|
|
|
(defined(OPENSSL_EXTRA) && !defined(NO_CERTS))
|
|
|
|
#define KEEP_PEER_CERT
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2011-02-28 21:02:47 -05:00
|
|
|
CURLcode Curl_cyassl_connect(struct connectdata *conn, int sockindex);
|
2015-03-17 08:41:49 -04:00
|
|
|
bool Curl_cyassl_data_pending(const struct connectdata* conn, int connindex);
|
2011-02-28 21:02:47 -05:00
|
|
|
int Curl_cyassl_shutdown(struct connectdata* conn, int sockindex);
|
|
|
|
|
|
|
|
/* close a SSL connection */
|
|
|
|
void Curl_cyassl_close(struct connectdata *conn, int sockindex);
|
|
|
|
|
|
|
|
void Curl_cyassl_session_free(void *ptr);
|
|
|
|
size_t Curl_cyassl_version(char *buffer, size_t size);
|
|
|
|
int Curl_cyassl_shutdown(struct connectdata *conn, int sockindex);
|
2011-03-08 08:09:20 -05:00
|
|
|
int Curl_cyassl_init(void);
|
|
|
|
CURLcode Curl_cyassl_connect_nonblocking(struct connectdata *conn,
|
|
|
|
int sockindex,
|
|
|
|
bool *done);
|
2016-06-21 09:47:12 -04:00
|
|
|
int Curl_cyassl_random(struct Curl_easy *data,
|
2014-07-30 18:09:13 -04:00
|
|
|
unsigned char *entropy,
|
|
|
|
size_t length);
|
2015-07-02 02:29:22 -04:00
|
|
|
void Curl_cyassl_sha256sum(const unsigned char *tmp, /* input */
|
2015-06-30 20:23:54 -04:00
|
|
|
size_t tmplen,
|
|
|
|
unsigned char *sha256sum, /* output */
|
|
|
|
size_t unused);
|
2011-02-28 21:02:47 -05:00
|
|
|
|
2015-01-17 11:03:49 -05:00
|
|
|
/* Set the API backend definition to Schannel */
|
|
|
|
#define CURL_SSL_BACKEND CURLSSLBACKEND_CYASSL
|
|
|
|
|
2015-03-28 00:16:08 -04:00
|
|
|
/* this backend supports CURLOPT_SSL_CTX_* */
|
2015-03-27 07:22:32 -04:00
|
|
|
#define have_curlssl_ssl_ctx 1
|
|
|
|
|
2016-05-01 11:05:38 -04:00
|
|
|
#ifdef KEEP_PEER_CERT
|
|
|
|
/* this backend supports CURLOPT_PINNEDPUBLICKEY */
|
|
|
|
#define have_curlssl_pinnedpubkey 1
|
|
|
|
#endif
|
|
|
|
|
2011-02-28 21:02:47 -05:00
|
|
|
/* API setup for CyaSSL */
|
|
|
|
#define curlssl_init Curl_cyassl_init
|
2011-09-03 10:06:10 -04:00
|
|
|
#define curlssl_cleanup() Curl_nop_stmt
|
2011-02-28 21:02:47 -05:00
|
|
|
#define curlssl_connect Curl_cyassl_connect
|
|
|
|
#define curlssl_connect_nonblocking Curl_cyassl_connect_nonblocking
|
|
|
|
#define curlssl_session_free(x) Curl_cyassl_session_free(x)
|
2015-01-17 11:41:03 -05:00
|
|
|
#define curlssl_close_all(x) ((void)x)
|
2011-02-28 21:02:47 -05:00
|
|
|
#define curlssl_close Curl_cyassl_close
|
2011-04-05 09:14:02 -04:00
|
|
|
#define curlssl_shutdown(x,y) Curl_cyassl_shutdown(x,y)
|
2014-12-30 12:08:16 -05:00
|
|
|
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
|
|
|
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
|
|
|
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
2011-02-28 21:02:47 -05:00
|
|
|
#define curlssl_version Curl_cyassl_version
|
2014-12-30 12:08:16 -05:00
|
|
|
#define curlssl_check_cxn(x) ((void)x, -1)
|
2011-02-28 21:02:47 -05:00
|
|
|
#define curlssl_data_pending(x,y) Curl_cyassl_data_pending(x,y)
|
2014-07-30 18:09:13 -04:00
|
|
|
#define curlssl_random(x,y,z) Curl_cyassl_random(x,y,z)
|
2015-06-30 20:23:54 -04:00
|
|
|
#define curlssl_sha256sum(a,b,c,d) Curl_cyassl_sha256sum(a,b,c,d)
|
2014-07-30 04:08:27 -04:00
|
|
|
|
2011-02-28 21:02:47 -05:00
|
|
|
#endif /* USE_CYASSL */
|
|
|
|
#endif /* HEADER_CURL_CYASSL_H */
|