@@ -830,6 +830,11 @@ int test_memio_setup(struct test_memio_ctx *ctx,
830
830
}
831
831
#endif
832
832
833
+ #ifdef USE_WINDOWS_API
834
+ #define MESSAGE_TYPE_CAST char*
835
+ #else
836
+ #define MESSAGE_TYPE_CAST void*
837
+ #endif
833
838
/*----------------------------------------------------------------------------*
834
839
| BIO with fixed read/write size
835
840
*----------------------------------------------------------------------------*/
@@ -8389,7 +8394,7 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
8389
8394
if (!sharedCtx)
8390
8395
wolfSSL_CTX_free(ctx);
8391
8396
8392
- if (clientfd >= 0 )
8397
+ if (clientfd != SOCKET_INVALID )
8393
8398
CloseSocket(clientfd);
8394
8399
8395
8400
#ifdef WOLFSSL_TIRTOS
@@ -76214,7 +76219,7 @@ static int test_wolfSSL_TXT_DB(void)
76214
76219
76215
76220
/* Test index */
76216
76221
ExpectIntEQ(TXT_DB_create_index(db, 3, NULL,
76217
- (wolf_sk_hash_cb)(long unsigned int) TXT_DB_hash,
76222
+ (wolf_sk_hash_cb)TXT_DB_hash,
76218
76223
(wolf_lh_compare_cb)TXT_DB_cmp), 1);
76219
76224
ExpectNotNull(TXT_DB_get_by_index(db, 3, (WOLFSSL_STRING*)fields));
76220
76225
fields[3] = "12DA";
@@ -90343,10 +90348,10 @@ static void test_wolfSSL_dtls_plaintext_client(WOLFSSL* ssl)
90343
90348
AssertIntGE(fd, 0);
90344
90349
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 0);
90345
90350
/* Server should ignore this datagram */
90346
- AssertIntEQ(send(fd, ch, sizeof(ch), 0), sizeof(ch));
90351
+ AssertIntEQ(send(fd, (MESSAGE_TYPE_CAST) ch, sizeof(ch), 0), sizeof(ch));
90347
90352
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 10000);
90348
90353
/* Server should ignore this datagram */
90349
- AssertIntEQ(send(fd, ch, sizeof(ch), 0), sizeof(ch));
90354
+ AssertIntEQ(send(fd, (MESSAGE_TYPE_CAST) ch, sizeof(ch), 0), sizeof(ch));
90350
90355
90351
90356
AssertIntEQ(wolfSSL_write(ssl, msg, sizeof(msg)), sizeof(msg));
90352
90357
AssertIntGT(wolfSSL_read(ssl, reply, sizeof(reply)),0);
@@ -90457,7 +90462,7 @@ static void test_wolfSSL_dtls12_fragments_spammer(WOLFSSL* ssl)
90457
90462
delay.tv_nsec = 10000000; /* wait 0.01 seconds */
90458
90463
c32toa(seq_number, b + seq_offset);
90459
90464
c16toa(msg_number, b + msg_offset);
90460
- ret = (int)send(fd, b, 55, 0);
90465
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) b, 55, 0);
90461
90466
nanosleep(&delay, NULL);
90462
90467
}
90463
90468
}
@@ -90502,7 +90507,7 @@ static void test_wolfSSL_dtls13_fragments_spammer(WOLFSSL* ssl)
90502
90507
c16toa(msg_number, b + msg_offset);
90503
90508
sendSz = BuildTls13Message(ssl, sendBuf, sendSz, b,
90504
90509
(int)idx, handshake, 0, 0, 0);
90505
- ret = (int)send(fd, sendBuf, (size_t)sendSz, 0);
90510
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) sendBuf, (size_t)sendSz, 0);
90506
90511
nanosleep(&delay, NULL);
90507
90512
}
90508
90513
}
@@ -90576,7 +90581,7 @@ static void test_wolfSSL_dtls_send_alert(WOLFSSL* ssl)
90576
90581
90577
90582
fd = wolfSSL_get_wfd(ssl);
90578
90583
AssertIntGE(fd, 0);
90579
- ret = (int)send(fd, alert_msg, sizeof(alert_msg), 0);
90584
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) alert_msg, sizeof(alert_msg), 0);
90580
90585
AssertIntGT(ret, 0);
90581
90586
}
90582
90587
@@ -90647,7 +90652,7 @@ static void test_wolfSSL_send_bad_record(WOLFSSL* ssl)
90647
90652
90648
90653
fd = wolfSSL_get_wfd(ssl);
90649
90654
AssertIntGE(fd, 0);
90650
- ret = (int)send(fd, bad_msg, sizeof(bad_msg), 0);
90655
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) bad_msg, sizeof(bad_msg), 0);
90651
90656
AssertIntEQ(ret, sizeof(bad_msg));
90652
90657
ret = wolfSSL_write(ssl, "badrecordtest", sizeof("badrecordtest"));
90653
90658
AssertIntEQ(ret, sizeof("badrecordtest"));
@@ -90728,7 +90733,7 @@ static byte test_AEAD_done = 0;
90728
90733
90729
90734
static int test_AEAD_cbiorecv(WOLFSSL *ssl, char *buf, int sz, void *ctx)
90730
90735
{
90731
- int ret = (int)recv(wolfSSL_get_fd(ssl), buf, sz, 0);
90736
+ int ret = (int)recv(wolfSSL_get_fd(ssl), (MESSAGE_TYPE_CAST) buf, sz, 0);
90732
90737
if (ret > 0) {
90733
90738
if (test_AEAD_fail_decryption) {
90734
90739
/* Modify the packet to trigger a decryption failure */
@@ -90974,10 +90979,10 @@ static void test_wolfSSL_dtls_send_ch(WOLFSSL* ssl)
90974
90979
90975
90980
fd = wolfSSL_get_wfd(ssl);
90976
90981
AssertIntGE(fd, 0);
90977
- ret = (int)send(fd, ch_msg, sizeof(ch_msg), 0);
90982
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) ch_msg, sizeof(ch_msg), 0);
90978
90983
AssertIntGT(ret, 0);
90979
90984
/* consume the HRR otherwise handshake will fail */
90980
- ret = (int)recv(fd, ch_msg, sizeof(ch_msg), 0);
90985
+ ret = (int)recv(fd, (MESSAGE_TYPE_CAST) ch_msg, sizeof(ch_msg), 0);
90981
90986
AssertIntGT(ret, 0);
90982
90987
}
90983
90988
@@ -91045,10 +91050,10 @@ static void test_wolfSSL_dtls_send_ch_with_invalid_cookie(WOLFSSL* ssl)
91045
91050
};
91046
91051
91047
91052
fd = wolfSSL_get_wfd(ssl);
91048
- ret = (int)send(fd, ch_msh_invalid_cookie, sizeof(ch_msh_invalid_cookie), 0);
91053
+ ret = (int)send(fd, (MESSAGE_TYPE_CAST) ch_msh_invalid_cookie, sizeof(ch_msh_invalid_cookie), 0);
91049
91054
AssertIntGT(ret, 0);
91050
91055
/* should reply with an illegal_parameter reply */
91051
- ret = (int)recv(fd, alert_reply, sizeof(alert_reply), 0);
91056
+ ret = (int)recv(fd, (MESSAGE_TYPE_CAST) alert_reply, sizeof(alert_reply), 0);
91052
91057
AssertIntEQ(ret, sizeof(expected_alert_reply));
91053
91058
AssertIntEQ(XMEMCMP(alert_reply, expected_alert_reply, sizeof(expected_alert_reply)), 0);
91054
91059
}
@@ -97619,7 +97624,8 @@ static int test_dtls_msg_from_other_peer(void)
97619
97624
* !defined(SINGLE_THREADED) && !defined(NO_RSA) */
97620
97625
#if defined(WOLFSSL_DTLS) && !defined(WOLFSSL_IPV6) && \
97621
97626
!defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
97622
- defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
97627
+ defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12) \
97628
+ && !defined(USE_WINDOWS_API)
97623
97629
static int test_dtls_ipv6_check(void)
97624
97630
{
97625
97631
EXPECT_DECLS;
0 commit comments