Skip to content

Commit 87d89d8

Browse files
committed
CI fixes
1 parent 4a29af3 commit 87d89d8

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/internal.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26304,20 +26304,20 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
2630426304

2630526305
if (sent == (word32)sz) break;
2630626306

26307-
buffSz = (word32)sz - sent;
26308-
{
26309-
int maxFrag = wolfSSL_GetMaxFragSize(ssl);
26310-
if (maxFrag > 0 && (int)buffSz > maxFrag)
26311-
buffSz = (word32)maxFrag;
26307+
buffSz = (int)((word32)sz - sent);
26308+
if (buffSz <= 0) {
26309+
WOLFSSL_MSG("error: sent size exceeds input size");
26310+
ssl->error = BAD_FUNC_ARG;
26311+
return WOLFSSL_FATAL_ERROR;
2631226312
}
26313-
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
2631426313
#if defined(WOLFSSL_DTLS)
2631526314
if (ssl->options.dtls) {
2631626315
#if defined(WOLFSSL_DTLS_MTU)
2631726316
int mtu = ssl->dtlsMtuSz;
2631826317
#else
2631926318
int mtu = MAX_MTU;
2632026319
#endif
26320+
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
2632126321
if (outputSz > mtu) {
2632226322
#if defined(WOLFSSL_NO_DTLS_SIZE_CHECK)
2632326323
/* split instead of error out */
@@ -26331,7 +26331,14 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
2633126331
#endif /* WOLFSSL_NO_DTLS_SIZE_CHECK */
2633226332
}
2633326333
}
26334+
else
2633426335
#endif /* WOLFSSL_DTLS */
26336+
{
26337+
int maxFrag = wolfSSL_GetMaxFragSize(ssl);
26338+
if (maxFrag > 0)
26339+
buffSz = min((word32)buffSz, (word32)maxFrag);
26340+
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
26341+
}
2633526342

2633626343
/* check for available size, it does also DTLS MTU checks */
2633726344
if ((ret = CheckAvailableSize(ssl, outputSz)) != 0)

src/ocsp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,7 @@ int wolfSSL_OCSP_id_get0_info(WOLFSSL_ASN1_STRING **name,
20072007
(size_t)cid->status->serialSz);
20082008
ser->length = i + cid->status->serialSz;
20092009
#endif
2010+
20102011
cid->status->serialInt = ser;
20112012
*serial = ser;
20122013
}

wolfssl/openssl/opensslv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#elif defined(OPENSSL_VERSION_NUMBER)
4141
/* unrecognized version, but continue. */
4242
#define WOLFSSL_OPENSSL_VERSION_NUMBER_UNRECOGNIZED
43+
#elif defined(WOLFSSL_QT) || defined(WOLFSSL_PYTHON)
44+
/* For Qt and Python 3.8.5 compatibility */
45+
#define OPENSSL_VERSION_NUMBER 0x10101000L
4346
#elif defined(HAVE_MOSQUITTO)
4447
#define OPENSSL_VERSION_NUMBER 0x10100000L
4548
#elif defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIBEST) || \
@@ -48,9 +51,6 @@
4851
defined(WOLFSSL_OPENSSH)
4952
/* For Apache httpd, Use 1.1.0 compatibility */
5053
#define OPENSSL_VERSION_NUMBER 0x10100003L
51-
#elif defined(WOLFSSL_QT) || defined(WOLFSSL_PYTHON)
52-
/* For Qt and Python 3.8.5 compatibility */
53-
#define OPENSSL_VERSION_NUMBER 0x10101000L
5454
#elif defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_FFMPEG)
5555
#define OPENSSL_VERSION_NUMBER 0x1010000fL
5656
#elif defined(OPENSSL_ALL) || defined(HAVE_LIGHTY) || \

0 commit comments

Comments
 (0)