diff --git a/src/internal.c b/src/internal.c index 568365c16c..423fd1ef7b 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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) diff --git a/src/ocsp.c b/src/ocsp.c index bf37e3c012..ce42b4d65a 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -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; } diff --git a/wolfssl/openssl/opensslv.h b/wolfssl/openssl/opensslv.h index bb3f7a828f..df75d9e0d4 100644 --- a/wolfssl/openssl/opensslv.h +++ b/wolfssl/openssl/opensslv.h @@ -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) || \