forked from wolfSSL/wolfssl
@@ -18,23 +18,18 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- { sys: ucrt64, compiler: mingw-w64-ucrt-x86_64-gcc }
|
|
||||||
- { sys: mingw64, compiler: mingw-w64-x86_64-gcc }
|
|
||||||
- { sys: msys, compiler: gcc }
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: msys2/setup-msys2@v2
|
- uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.sys }}
|
msystem: msys
|
||||||
update: true
|
update: true
|
||||||
install: git ${{matrix.compiler}} autotools base-devel autoconf netcat
|
install: git gcc autotools base-devel autoconf netcat
|
||||||
- name: configure wolfSSL
|
- name: configure wolfSSL
|
||||||
run: ./autogen.sh && ./configure CFLAGS="-DUSE_CERT_BUFFERS_2048 -DUSE_CERT_BUFFERS_256 -DNO_WRITE_TEMP_FILES"
|
run: ./autogen.sh && ./configure CFLAGS="-DUSE_CERT_BUFFERS_2048 -DUSE_CERT_BUFFERS_256 -DNO_WRITE_TEMP_FILES"
|
||||||
- name: build wolfSSL
|
- name: build wolfSSL
|
||||||
|
run: make
|
||||||
|
- name: run tests
|
||||||
run: make check
|
run: make check
|
||||||
- name: Display log
|
- name: Display log
|
||||||
if: always()
|
if: always()
|
26
tests/api.c
26
tests/api.c
@@ -415,6 +415,12 @@ int testDevId = WOLFSSL_CAAM_DEVID;
|
|||||||
int testDevId = INVALID_DEVID;
|
int testDevId = INVALID_DEVID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_WINDOWS_API
|
||||||
|
#define MESSAGE_TYPE_CAST char*
|
||||||
|
#else
|
||||||
|
#define MESSAGE_TYPE_CAST void*
|
||||||
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*
|
/*----------------------------------------------------------------------------*
|
||||||
| BIO with fixed read/write size
|
| BIO with fixed read/write size
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
@@ -56354,10 +56360,10 @@ static void test_wolfSSL_dtls_plaintext_client(WOLFSSL* ssl)
|
|||||||
AssertIntGE(fd, 0);
|
AssertIntGE(fd, 0);
|
||||||
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 0);
|
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 0);
|
||||||
/* Server should ignore this datagram */
|
/* Server should ignore this datagram */
|
||||||
AssertIntEQ(send(fd, ch, sizeof(ch), 0), sizeof(ch));
|
AssertIntEQ(send(fd, (MESSAGE_TYPE_CAST)ch, sizeof(ch), 0), sizeof(ch));
|
||||||
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 10000);
|
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 10000);
|
||||||
/* Server should ignore this datagram */
|
/* Server should ignore this datagram */
|
||||||
AssertIntEQ(send(fd, ch, sizeof(ch), 0), sizeof(ch));
|
AssertIntEQ(send(fd, (MESSAGE_TYPE_CAST)ch, sizeof(ch), 0), sizeof(ch));
|
||||||
|
|
||||||
AssertIntEQ(wolfSSL_write(ssl, msg, sizeof(msg)), sizeof(msg));
|
AssertIntEQ(wolfSSL_write(ssl, msg, sizeof(msg)), sizeof(msg));
|
||||||
AssertIntGT(wolfSSL_read(ssl, reply, sizeof(reply)),0);
|
AssertIntGT(wolfSSL_read(ssl, reply, sizeof(reply)),0);
|
||||||
@@ -56468,7 +56474,7 @@ static void test_wolfSSL_dtls12_fragments_spammer(WOLFSSL* ssl)
|
|||||||
delay.tv_nsec = 10000000; /* wait 0.01 seconds */
|
delay.tv_nsec = 10000000; /* wait 0.01 seconds */
|
||||||
c32toa(seq_number, b + seq_offset);
|
c32toa(seq_number, b + seq_offset);
|
||||||
c16toa(msg_number, b + msg_offset);
|
c16toa(msg_number, b + msg_offset);
|
||||||
ret = (int)send(fd, b, 55, 0);
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)b, 55, 0);
|
||||||
nanosleep(&delay, NULL);
|
nanosleep(&delay, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56514,7 +56520,7 @@ static void test_wolfSSL_dtls13_fragments_spammer(WOLFSSL* ssl)
|
|||||||
ret = sendSz = BuildTls13Message(ssl, sendBuf, sendSz, b,
|
ret = sendSz = BuildTls13Message(ssl, sendBuf, sendSz, b,
|
||||||
(int)idx, handshake, 0, 0, 0);
|
(int)idx, handshake, 0, 0, 0);
|
||||||
if (sendSz > 0)
|
if (sendSz > 0)
|
||||||
ret = (int)send(fd, sendBuf, (size_t)sendSz, 0);
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)sendBuf, (size_t)sendSz, 0);
|
||||||
nanosleep(&delay, NULL);
|
nanosleep(&delay, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56588,7 +56594,7 @@ static void test_wolfSSL_dtls_send_alert(WOLFSSL* ssl)
|
|||||||
|
|
||||||
fd = wolfSSL_get_wfd(ssl);
|
fd = wolfSSL_get_wfd(ssl);
|
||||||
AssertIntGE(fd, 0);
|
AssertIntGE(fd, 0);
|
||||||
ret = (int)send(fd, alert_msg, sizeof(alert_msg), 0);
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)alert_msg, sizeof(alert_msg), 0);
|
||||||
AssertIntGT(ret, 0);
|
AssertIntGT(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56659,7 +56665,7 @@ static void test_wolfSSL_send_bad_record(WOLFSSL* ssl)
|
|||||||
|
|
||||||
fd = wolfSSL_get_wfd(ssl);
|
fd = wolfSSL_get_wfd(ssl);
|
||||||
AssertIntGE(fd, 0);
|
AssertIntGE(fd, 0);
|
||||||
ret = (int)send(fd, bad_msg, sizeof(bad_msg), 0);
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)bad_msg, sizeof(bad_msg), 0);
|
||||||
AssertIntEQ(ret, sizeof(bad_msg));
|
AssertIntEQ(ret, sizeof(bad_msg));
|
||||||
ret = wolfSSL_write(ssl, "badrecordtest", sizeof("badrecordtest"));
|
ret = wolfSSL_write(ssl, "badrecordtest", sizeof("badrecordtest"));
|
||||||
AssertIntEQ(ret, sizeof("badrecordtest"));
|
AssertIntEQ(ret, sizeof("badrecordtest"));
|
||||||
@@ -57017,10 +57023,10 @@ static void test_wolfSSL_dtls_send_ch(WOLFSSL* ssl)
|
|||||||
|
|
||||||
fd = wolfSSL_get_wfd(ssl);
|
fd = wolfSSL_get_wfd(ssl);
|
||||||
AssertIntGE(fd, 0);
|
AssertIntGE(fd, 0);
|
||||||
ret = (int)send(fd, ch_msg, sizeof(ch_msg), 0);
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)ch_msg, sizeof(ch_msg), 0);
|
||||||
AssertIntGT(ret, 0);
|
AssertIntGT(ret, 0);
|
||||||
/* consume the HRR otherwise handshake will fail */
|
/* consume the HRR otherwise handshake will fail */
|
||||||
ret = (int)recv(fd, ch_msg, sizeof(ch_msg), 0);
|
ret = (int)recv(fd, (MESSAGE_TYPE_CAST)ch_msg, sizeof(ch_msg), 0);
|
||||||
AssertIntGT(ret, 0);
|
AssertIntGT(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57089,11 +57095,11 @@ static void test_wolfSSL_dtls_send_ch_with_invalid_cookie(WOLFSSL* ssl)
|
|||||||
|
|
||||||
fd = wolfSSL_get_wfd(ssl);
|
fd = wolfSSL_get_wfd(ssl);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
ret = (int)send(fd, ch_msh_invalid_cookie,
|
ret = (int)send(fd, (MESSAGE_TYPE_CAST)ch_msh_invalid_cookie,
|
||||||
sizeof(ch_msh_invalid_cookie), 0);
|
sizeof(ch_msh_invalid_cookie), 0);
|
||||||
AssertIntGT(ret, 0);
|
AssertIntGT(ret, 0);
|
||||||
/* should reply with an illegal_parameter reply */
|
/* should reply with an illegal_parameter reply */
|
||||||
ret = (int)recv(fd, alert_reply, sizeof(alert_reply), 0);
|
ret = (int)recv(fd, (MESSAGE_TYPE_CAST)alert_reply, sizeof(alert_reply), 0);
|
||||||
AssertIntEQ(ret, sizeof(expected_alert_reply));
|
AssertIntEQ(ret, sizeof(expected_alert_reply));
|
||||||
AssertIntEQ(XMEMCMP(alert_reply, expected_alert_reply,
|
AssertIntEQ(XMEMCMP(alert_reply, expected_alert_reply,
|
||||||
sizeof(expected_alert_reply)), 0);
|
sizeof(expected_alert_reply)), 0);
|
||||||
|
Reference in New Issue
Block a user