mbedtls.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_MBEDTLS_H
00002 #define HEADER_CURL_MBEDTLS_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  * Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
00012  *
00013  * This software is licensed as described in the file COPYING, which
00014  * you should have received as part of this distribution. The terms
00015  * are also available at https://curl.haxx.se/docs/copyright.html.
00016  *
00017  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00018  * copies of the Software, and permit persons to whom the Software is
00019  * furnished to do so, under the terms of the COPYING file.
00020  *
00021  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00022  * KIND, either express or implied.
00023  *
00024  ***************************************************************************/
00025 #include "curl_setup.h"
00026 
00027 #ifdef USE_MBEDTLS
00028 
00029 #include <mbedtls/sha256.h>
00030 
00031 /* Called on first use mbedTLS, setup threading if supported */
00032 int  Curl_mbedtls_init(void);
00033 void Curl_mbedtls_cleanup(void);
00034 int Curl_mbedtls_data_pending(const struct connectdata *conn, int sockindex);
00035 
00036 CURLcode Curl_mbedtls_connect(struct connectdata *conn, int sockindex);
00037 
00038 CURLcode Curl_mbedtls_connect_nonblocking(struct connectdata *conn,
00039                                            int sockindex,
00040                                            bool *done);
00041 
00042 /* tell mbedTLS to close down all open information regarding connections (and
00043    thus session ID caching etc) */
00044 void Curl_mbedtls_close_all(struct Curl_easy *data);
00045 
00046  /* close a SSL connection */
00047 void Curl_mbedtls_close(struct connectdata *conn, int sockindex);
00048 
00049 void Curl_mbedtls_session_free(void *ptr);
00050 size_t Curl_mbedtls_version(char *buffer, size_t size);
00051 int Curl_mbedtls_shutdown(struct connectdata *conn, int sockindex);
00052 
00053 /* this backends supports CURLOPT_PINNEDPUBLICKEY */
00054 #define have_curlssl_pinnedpubkey 1
00055 
00056 /* API setup for mbedTLS */
00057 #define curlssl_init() Curl_mbedtls_init()
00058 #define curlssl_cleanup() Curl_mbedtls_cleanup()
00059 #define curlssl_connect Curl_mbedtls_connect
00060 #define curlssl_connect_nonblocking Curl_mbedtls_connect_nonblocking
00061 #define curlssl_session_free(x)  Curl_mbedtls_session_free(x)
00062 #define curlssl_close_all Curl_mbedtls_close_all
00063 #define curlssl_close Curl_mbedtls_close
00064 #define curlssl_shutdown(x,y) 0
00065 #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
00066 #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
00067 #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
00068 #define curlssl_version Curl_mbedtls_version
00069 #define curlssl_check_cxn(x) (x=x, -1)
00070 #define curlssl_data_pending(x,y) Curl_mbedtls_data_pending(x, y)
00071 #define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
00072 #define curlssl_sha256sum(a,b,c,d) mbedtls_sha256(a,b,c,0)
00073 
00074 /* This might cause libcurl to use a weeker random!
00075    TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that
00076 */
00077 #define curlssl_random(x,y,z) (x=x, y=y, z=z, CURLE_NOT_BUILT_IN)
00078 
00079 #endif /* USE_MBEDTLS */
00080 #endif /* HEADER_CURL_MBEDTLS_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:05