1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

mbedtls: remove Curl_ prefix from static functions

This commit is contained in:
Daniel Stenberg 2021-01-13 08:45:23 +01:00
parent 5beed3e742
commit 4b55d0468a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -6,7 +6,7 @@
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2010 - 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com> * Copyright (C) 2010 - 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* Copyright (C) 2012 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -783,12 +783,12 @@ static ssize_t mbed_send(struct connectdata *conn, int sockindex,
return ret; return ret;
} }
static void Curl_mbedtls_close_all(struct Curl_easy *data) static void mbedtls_close_all(struct Curl_easy *data)
{ {
(void)data; (void)data;
} }
static void Curl_mbedtls_close(struct connectdata *conn, int sockindex) static void mbedtls_close(struct connectdata *conn, int sockindex)
{ {
struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend; struct ssl_backend_data *backend = connssl->backend;
@ -831,13 +831,13 @@ static ssize_t mbed_recv(struct connectdata *conn, int num,
return len; return len;
} }
static void Curl_mbedtls_session_free(void *ptr) static void mbedtls_session_free(void *ptr)
{ {
mbedtls_ssl_session_free(ptr); mbedtls_ssl_session_free(ptr);
free(ptr); free(ptr);
} }
static size_t Curl_mbedtls_version(char *buffer, size_t size) static size_t mbedtls_version(char *buffer, size_t size)
{ {
#ifdef MBEDTLS_VERSION_C #ifdef MBEDTLS_VERSION_C
/* if mbedtls_version_get_number() is available it is better */ /* if mbedtls_version_get_number() is available it is better */
@ -849,8 +849,8 @@ static size_t Curl_mbedtls_version(char *buffer, size_t size)
#endif #endif
} }
static CURLcode Curl_mbedtls_random(struct Curl_easy *data, static CURLcode mbedtls_random(struct Curl_easy *data,
unsigned char *entropy, size_t length) unsigned char *entropy, size_t length)
{ {
#if defined(MBEDTLS_CTR_DRBG_C) #if defined(MBEDTLS_CTR_DRBG_C)
int ret = -1; int ret = -1;
@ -1011,14 +1011,14 @@ mbed_connect_common(struct connectdata *conn,
return CURLE_OK; return CURLE_OK;
} }
static CURLcode Curl_mbedtls_connect_nonblocking(struct connectdata *conn, static CURLcode mbedtls_connect_nonblocking(struct connectdata *conn,
int sockindex, bool *done) int sockindex, bool *done)
{ {
return mbed_connect_common(conn, sockindex, TRUE, done); return mbed_connect_common(conn, sockindex, TRUE, done);
} }
static CURLcode Curl_mbedtls_connect(struct connectdata *conn, int sockindex) static CURLcode mbedtls_connect(struct connectdata *conn, int sockindex)
{ {
CURLcode retcode; CURLcode retcode;
bool done = FALSE; bool done = FALSE;
@ -1036,28 +1036,28 @@ static CURLcode Curl_mbedtls_connect(struct connectdata *conn, int sockindex)
* return 0 error initializing SSL * return 0 error initializing SSL
* return 1 SSL initialized successfully * return 1 SSL initialized successfully
*/ */
static int Curl_mbedtls_init(void) static int mbedtls_init(void)
{ {
return Curl_mbedtlsthreadlock_thread_setup(); return Curl_mbedtlsthreadlock_thread_setup();
} }
static void Curl_mbedtls_cleanup(void) static void mbedtls_cleanup(void)
{ {
(void)Curl_mbedtlsthreadlock_thread_cleanup(); (void)Curl_mbedtlsthreadlock_thread_cleanup();
} }
static bool Curl_mbedtls_data_pending(const struct connectdata *conn, static bool mbedtls_data_pending(const struct connectdata *conn,
int sockindex) int sockindex)
{ {
const struct ssl_connect_data *connssl = &conn->ssl[sockindex]; const struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend; struct ssl_backend_data *backend = connssl->backend;
return mbedtls_ssl_get_bytes_avail(&backend->ssl) != 0; return mbedtls_ssl_get_bytes_avail(&backend->ssl) != 0;
} }
static CURLcode Curl_mbedtls_sha256sum(const unsigned char *input, static CURLcode mbedtls_sha256sum(const unsigned char *input,
size_t inputlen, size_t inputlen,
unsigned char *sha256sum, unsigned char *sha256sum,
size_t sha256len UNUSED_PARAM) size_t sha256len UNUSED_PARAM)
{ {
(void)sha256len; (void)sha256len;
#if MBEDTLS_VERSION_NUMBER < 0x02070000 #if MBEDTLS_VERSION_NUMBER < 0x02070000
@ -1070,8 +1070,8 @@ static CURLcode Curl_mbedtls_sha256sum(const unsigned char *input,
return CURLE_OK; return CURLE_OK;
} }
static void *Curl_mbedtls_get_internals(struct ssl_connect_data *connssl, static void *mbedtls_get_internals(struct ssl_connect_data *connssl,
CURLINFO info UNUSED_PARAM) CURLINFO info UNUSED_PARAM)
{ {
struct ssl_backend_data *backend = connssl->backend; struct ssl_backend_data *backend = connssl->backend;
(void)info; (void)info;
@ -1087,26 +1087,26 @@ const struct Curl_ssl Curl_ssl_mbedtls = {
sizeof(struct ssl_backend_data), sizeof(struct ssl_backend_data),
Curl_mbedtls_init, /* init */ mbedtls_init, /* init */
Curl_mbedtls_cleanup, /* cleanup */ mbedtls_cleanup, /* cleanup */
Curl_mbedtls_version, /* version */ mbedtls_version, /* version */
Curl_none_check_cxn, /* check_cxn */ Curl_none_check_cxn, /* check_cxn */
Curl_none_shutdown, /* shutdown */ Curl_none_shutdown, /* shutdown */
Curl_mbedtls_data_pending, /* data_pending */ mbedtls_data_pending, /* data_pending */
Curl_mbedtls_random, /* random */ mbedtls_random, /* random */
Curl_none_cert_status_request, /* cert_status_request */ Curl_none_cert_status_request, /* cert_status_request */
Curl_mbedtls_connect, /* connect */ mbedtls_connect, /* connect */
Curl_mbedtls_connect_nonblocking, /* connect_nonblocking */ mbedtls_connect_nonblocking, /* connect_nonblocking */
Curl_mbedtls_get_internals, /* get_internals */ mbedtls_get_internals, /* get_internals */
Curl_mbedtls_close, /* close_one */ mbedtls_close, /* close_one */
Curl_mbedtls_close_all, /* close_all */ mbedtls_close_all, /* close_all */
Curl_mbedtls_session_free, /* session_free */ mbedtls_session_free, /* session_free */
Curl_none_set_engine, /* set_engine */ Curl_none_set_engine, /* set_engine */
Curl_none_set_engine_default, /* set_engine_default */ Curl_none_set_engine_default, /* set_engine_default */
Curl_none_engines_list, /* engines_list */ Curl_none_engines_list, /* engines_list */
Curl_none_false_start, /* false_start */ Curl_none_false_start, /* false_start */
Curl_none_md5sum, /* md5sum */ Curl_none_md5sum, /* md5sum */
Curl_mbedtls_sha256sum /* sha256sum */ mbedtls_sha256sum /* sha256sum */
}; };
#endif /* USE_MBEDTLS */ #endif /* USE_MBEDTLS */