mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Fixes for some -pedantic
errors
Some of the API with callbacks may not be compatible with pedantic
This commit is contained in:
14
tests/api.c
14
tests/api.c
@ -3343,7 +3343,7 @@ done:
|
|||||||
|
|
||||||
typedef int (*cbType)(WOLFSSL_CTX *ctx, WOLFSSL *ssl);
|
typedef int (*cbType)(WOLFSSL_CTX *ctx, WOLFSSL *ssl);
|
||||||
|
|
||||||
static void test_client_nofail(void* args, void *cb)
|
static void test_client_nofail(void* args, cbType cb)
|
||||||
{
|
{
|
||||||
SOCKET_T sockfd = 0;
|
SOCKET_T sockfd = 0;
|
||||||
callback_functions* cbf;
|
callback_functions* cbf;
|
||||||
@ -3510,7 +3510,7 @@ static void test_client_nofail(void* args, void *cb)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cb != NULL)
|
if (cb != NULL)
|
||||||
((cbType)cb)(ctx, ssl);
|
(cb)(ctx, ssl);
|
||||||
|
|
||||||
if (wolfSSL_write(ssl, msg, msgSz) != msgSz) {
|
if (wolfSSL_write(ssl, msg, msgSz) != msgSz) {
|
||||||
/*err_sys("SSL_write failed");*/
|
/*err_sys("SSL_write failed");*/
|
||||||
@ -29826,7 +29826,7 @@ static void test_wolfSSL_msgCb(void)
|
|||||||
#ifndef SINGLE_THREADED
|
#ifndef SINGLE_THREADED
|
||||||
start_thread(test_server_nofail, &server_args, &serverThread);
|
start_thread(test_server_nofail, &server_args, &serverThread);
|
||||||
wait_tcp_ready(&server_args);
|
wait_tcp_ready(&server_args);
|
||||||
test_client_nofail(&client_args, (void *)msgCb);
|
test_client_nofail(&client_args, msgCb);
|
||||||
join_thread(serverThread);
|
join_thread(serverThread);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -40261,7 +40261,7 @@ static int my_DhCallback(WOLFSSL* ssl, struct DhKey* key,
|
|||||||
(void)ssl;
|
(void)ssl;
|
||||||
/* return 0 on success */
|
/* return 0 on success */
|
||||||
return wc_DhAgree(key, out, outlen, priv, privSz, pubKeyDer, pubKeySz);
|
return wc_DhAgree(key, out, outlen, priv, privSz, pubKeyDer, pubKeySz);
|
||||||
};
|
}
|
||||||
|
|
||||||
static void test_dh_ctx_setup(WOLFSSL_CTX* ctx) {
|
static void test_dh_ctx_setup(WOLFSSL_CTX* ctx) {
|
||||||
wolfSSL_CTX_SetDhAgreeCb(ctx, my_DhCallback);
|
wolfSSL_CTX_SetDhAgreeCb(ctx, my_DhCallback);
|
||||||
@ -41764,9 +41764,9 @@ typedef struct {
|
|||||||
ASN1_SEQUENCE(DPP_BOOTSTRAPPING_KEY) = {
|
ASN1_SEQUENCE(DPP_BOOTSTRAPPING_KEY) = {
|
||||||
ASN1_SIMPLE(DPP_BOOTSTRAPPING_KEY, alg, X509_ALGOR),
|
ASN1_SIMPLE(DPP_BOOTSTRAPPING_KEY, alg, X509_ALGOR),
|
||||||
ASN1_SIMPLE(DPP_BOOTSTRAPPING_KEY, pub_key, ASN1_BIT_STRING)
|
ASN1_SIMPLE(DPP_BOOTSTRAPPING_KEY, pub_key, ASN1_BIT_STRING)
|
||||||
} ASN1_SEQUENCE_END(DPP_BOOTSTRAPPING_KEY);
|
} ASN1_SEQUENCE_END(DPP_BOOTSTRAPPING_KEY)
|
||||||
|
|
||||||
IMPLEMENT_ASN1_FUNCTIONS(DPP_BOOTSTRAPPING_KEY);
|
IMPLEMENT_ASN1_FUNCTIONS(DPP_BOOTSTRAPPING_KEY)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void test_wolfSSL_IMPLEMENT_ASN1_FUNCTIONS(void)
|
static void test_wolfSSL_IMPLEMENT_ASN1_FUNCTIONS(void)
|
||||||
@ -42869,7 +42869,7 @@ static void test_export_keying_material(void)
|
|||||||
|
|
||||||
start_thread(test_server_nofail, &server_args, &serverThread);
|
start_thread(test_server_nofail, &server_args, &serverThread);
|
||||||
wait_tcp_ready(&server_args);
|
wait_tcp_ready(&server_args);
|
||||||
test_client_nofail(&client_args, (void*)test_export_keying_material_cb);
|
test_client_nofail(&client_args, test_export_keying_material_cb);
|
||||||
join_thread(serverThread);
|
join_thread(serverThread);
|
||||||
|
|
||||||
AssertTrue(client_args.return_code);
|
AssertTrue(client_args.return_code);
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
_Pragma("GCC diagnostic ignored \"-Wunused-function\"");
|
_Pragma("GCC diagnostic ignored \"-Wunused-function\"")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FLAT_TEST_H
|
#ifdef USE_FLAT_TEST_H
|
||||||
@ -36409,9 +36409,9 @@ WOLFSSL_TEST_SUBROUTINE int memcb_test(void)
|
|||||||
b = NULL;
|
b = NULL;
|
||||||
|
|
||||||
/* Use API. */
|
/* Use API. */
|
||||||
if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)(void*)&my_Malloc_cb,
|
if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)my_Malloc_cb,
|
||||||
(wolfSSL_Free_cb)(void*)&my_Free_cb,
|
(wolfSSL_Free_cb)my_Free_cb,
|
||||||
(wolfSSL_Realloc_cb)(void*)&my_Realloc_cb) != 0) {
|
(wolfSSL_Realloc_cb)my_Realloc_cb) != 0) {
|
||||||
ERROR_OUT(-13802, exit_memcb);
|
ERROR_OUT(-13802, exit_memcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3428,7 +3428,7 @@ static WC_INLINE int myDhCallback(WOLFSSL* ssl, struct DhKey* key,
|
|||||||
ret, privSz, pubKeySz, *outlen);
|
ret, privSz, pubKeySz, *outlen);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
};
|
}
|
||||||
|
|
||||||
#endif /* !NO_DH */
|
#endif /* !NO_DH */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user