This commit is contained in:
Juliusz Sosinowicz
2026-03-02 17:56:42 +01:00
parent 4a29af3062
commit 87d89d8492
3 changed files with 17 additions and 9 deletions
+13 -6
View File
@@ -26304,13 +26304,12 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
if (sent == (word32)sz) break;
buffSz = (word32)sz - sent;
{
int maxFrag = wolfSSL_GetMaxFragSize(ssl);
if (maxFrag > 0 && (int)buffSz > maxFrag)
buffSz = (word32)maxFrag;
buffSz = (int)((word32)sz - sent);
if (buffSz <= 0) {
WOLFSSL_MSG("error: sent size exceeds input size");
ssl->error = BAD_FUNC_ARG;
return WOLFSSL_FATAL_ERROR;
}
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
#if defined(WOLFSSL_DTLS)
if (ssl->options.dtls) {
#if defined(WOLFSSL_DTLS_MTU)
@@ -26318,6 +26317,7 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
#else
int mtu = MAX_MTU;
#endif
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
if (outputSz > mtu) {
#if defined(WOLFSSL_NO_DTLS_SIZE_CHECK)
/* split instead of error out */
@@ -26331,7 +26331,14 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
#endif /* WOLFSSL_NO_DTLS_SIZE_CHECK */
}
}
else
#endif /* WOLFSSL_DTLS */
{
int maxFrag = wolfSSL_GetMaxFragSize(ssl);
if (maxFrag > 0)
buffSz = min((word32)buffSz, (word32)maxFrag);
outputSz = wolfssl_local_GetRecordSize(ssl, (word32)buffSz, 1);
}
/* check for available size, it does also DTLS MTU checks */
if ((ret = CheckAvailableSize(ssl, outputSz)) != 0)
+1
View File
@@ -2007,6 +2007,7 @@ int wolfSSL_OCSP_id_get0_info(WOLFSSL_ASN1_STRING **name,
(size_t)cid->status->serialSz);
ser->length = i + cid->status->serialSz;
#endif
cid->status->serialInt = ser;
*serial = ser;
}
+3 -3
View File
@@ -40,6 +40,9 @@
#elif defined(OPENSSL_VERSION_NUMBER)
/* unrecognized version, but continue. */
#define WOLFSSL_OPENSSL_VERSION_NUMBER_UNRECOGNIZED
#elif defined(WOLFSSL_QT) || defined(WOLFSSL_PYTHON)
/* For Qt and Python 3.8.5 compatibility */
#define OPENSSL_VERSION_NUMBER 0x10101000L
#elif defined(HAVE_MOSQUITTO)
#define OPENSSL_VERSION_NUMBER 0x10100000L
#elif defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIBEST) || \
@@ -48,9 +51,6 @@
defined(WOLFSSL_OPENSSH)
/* For Apache httpd, Use 1.1.0 compatibility */
#define OPENSSL_VERSION_NUMBER 0x10100003L
#elif defined(WOLFSSL_QT) || defined(WOLFSSL_PYTHON)
/* For Qt and Python 3.8.5 compatibility */
#define OPENSSL_VERSION_NUMBER 0x10101000L
#elif defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_FFMPEG)
#define OPENSSL_VERSION_NUMBER 0x1010000fL
#elif defined(OPENSSL_ALL) || defined(HAVE_LIGHTY) || \