Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/ocsp-stapling.test
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ generate_port() {

while true; do
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
|| "$OSTYPE" == "cygwin"* ]]; then
|| "$OSTYPE" == "cygwin"*
|| "$OSTYPE" == "solaris"* ]]; then
p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
Expand Down
3 changes: 2 additions & 1 deletion scripts/ocsp-stapling2.test
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ generate_port() {

while true; do
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
|| "$OSTYPE" == "cygwin" ]]; then
|| "$OSTYPE" == "cygwin"
|| "$OSTYPE" == "solaris"* ]]; then
p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
Expand Down
2 changes: 1 addition & 1 deletion scripts/openssl.test
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ generate_port() {
local attempts=0 collision p

while true; do
if [[ "$OSTYPE" == "linux"* ]]; then
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "solaris"* ]]; then
p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
Expand Down
2 changes: 1 addition & 1 deletion scripts/openssl_srtp.test
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ generate_port() {
local attempts=0 collision p

while true; do
if [[ "$OSTYPE" == "linux"* ]]; then
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "solaris"* ]]; then
p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
Expand Down
6 changes: 3 additions & 3 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -44865,11 +44865,11 @@ static int test_sniffer_chain_input_overflow(void)
* into an int, causing an undersized allocation followed by an oversized
* copy (heap buffer overflow). After the fix, the function should detect
* the overflow and return an error without allocating or copying. */
chain[0].iov_base = dummy;
chain[0].iov_base = (void*)dummy;
chain[0].iov_len = (size_t)0x80000000UL; /* 2GB */
chain[1].iov_base = dummy;
chain[1].iov_base = (void*)dummy;
chain[1].iov_len = (size_t)0x80000000UL; /* 2GB */
chain[2].iov_base = dummy;
chain[2].iov_base = (void*)dummy;
chain[2].iov_len = (size_t)0x80000000UL; /* 2GB */

XMEMSET(error, 0, sizeof(error));
Expand Down
14 changes: 7 additions & 7 deletions tests/api/test_ssl_rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ int test_wolfSSL_writev(void)

/* A total length that overflows is rejected. The buffers are never read
* so the bogus length is safe. */
iov[0].iov_base = msg;
iov[0].iov_base = (void*)msg;
iov[0].iov_len = (size_t)-1;
iov[1].iov_base = msg;
iov[1].iov_base = (void*)msg;
iov[1].iov_len = 2;
ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 2), WC_NO_ERR_TRACE(BUFFER_E));

Expand All @@ -193,11 +193,11 @@ int test_wolfSSL_writev(void)

/* Segments totalling less than FILE_BUFFER_SIZE use the static buffer. */
small_sz = 96;
iov[0].iov_base = msg;
iov[0].iov_base = (void*)msg;
iov[0].iov_len = 32;
iov[1].iov_base = msg + 32;
iov[1].iov_base = (void*)(msg + 32);
iov[1].iov_len = 32;
iov[2].iov_base = msg + 64;
iov[2].iov_base = (void*)(msg + 64);
iov[2].iov_len = 32;
ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 3), small_sz);
XMEMSET(reply, 0, sizeof(reply));
Expand All @@ -206,9 +206,9 @@ int test_wolfSSL_writev(void)

/* Segments totalling more than FILE_BUFFER_SIZE allocate from the heap. */
large_sz = (int)sizeof(msg);
iov[0].iov_base = msg;
iov[0].iov_base = (void*)msg;
iov[0].iov_len = 64;
iov[1].iov_base = msg + 64;
iov[1].iov_base = (void*)(msg + 64);
iov[1].iov_len = (size_t)large_sz - 64;
ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 2), large_sz);
XMEMSET(reply, 0, sizeof(reply));
Expand Down
Loading