@@ -11255,6 +11255,11 @@ static int GetDtls13RecordHeader(WOLFSSL* ssl, word32* inOutIdx,
1125511255 if (ret != 0)
1125611256 return ret;
1125711257
11258+ if (ssl->dtls13CurRlLength > sizeof(ssl->dtls13CurRL)) {
11259+ WOLFSSL_MSG("Record header too long");
11260+ return SEQUENCE_ERROR;
11261+ }
11262+
1125811263 if (readSize < ssl->dtls13CurRlLength + DTLS13_RN_MASK_SIZE) {
1125911264 /* when using DTLS over a medium that does not guarantee that a full
1126011265 * message is received in a single read, we may end up without the full
@@ -24789,6 +24794,14 @@ int SendData(WOLFSSL* ssl, const void* data, int sz)
2478924794 if (IsEncryptionOn(ssl, 1) || ssl->options.tls1_3)
2479024795 outputSz += cipherExtraData(ssl);
2479124796
24797+ #if defined(WOLFSSL_DTLS) && defined(WOLFSSL_DTLS_CID)
24798+ if (ssl->options.dtls) {
24799+ unsigned int cidSz = 0;
24800+ if (wolfSSL_dtls_cid_get_tx_size(ssl, &cidSz) == WOLFSSL_SUCCESS)
24801+ outputSz += cidSz;
24802+ }
24803+ #endif
24804+
2479224805 /* check for available size */
2479324806 if ((ret = CheckAvailableSize(ssl, outputSz)) != 0)
2479424807 return ssl->error = ret;
@@ -25935,7 +25948,7 @@ void SetErrorString(int error, char* str)
2593525948 */
2593625949
2593725950 #ifndef NO_ERROR_STRINGS
25938- #if defined(OPENSSL_ALL ) || defined(WOLFSSL_QT) || \
25951+ #if defined(OPENSSL_EXTRA ) || defined(WOLFSSL_QT) || \
2593925952 defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_NGINX)
2594025953 #define SUITE_INFO(x,y,z,w,v,u) {(x),(y),(z),(w),(v),(u),WOLFSSL_CIPHER_SUITE_FLAG_NONE}
2594125954 #define SUITE_ALIAS(x,z,w,v,u) {(x),"",(z),(w),(v),(u),WOLFSSL_CIPHER_SUITE_FLAG_NAMEALIAS},
@@ -25944,7 +25957,7 @@ void SetErrorString(int error, char* str)
2594425957 #define SUITE_ALIAS(x,z,w,v,u) {(x),"",(z),(w),WOLFSSL_CIPHER_SUITE_FLAG_NAMEALIAS},
2594525958 #endif
2594625959 #else
25947- #if defined(OPENSSL_ALL ) || defined(WOLFSSL_QT) || \
25960+ #if defined(OPENSSL_EXTRA ) || defined(WOLFSSL_QT) || \
2594825961 defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_NGINX)
2594925962 #define SUITE_INFO(x,y,z,w,v,u) {(x),(z),(w),(v),(u),WOLFSSL_CIPHER_SUITE_FLAG_NONE}
2595025963 #define SUITE_ALIAS(x,z,w,v,u) {(x),(z),(w),(v),(u),WOLFSSL_CIPHER_SUITE_FLAG_NAMEALIAS},
@@ -26806,13 +26819,16 @@ const char* wolfSSL_get_cipher_name_iana(WOLFSSL* ssl)
2680626819}
2680726820
2680826821int GetCipherSuiteFromName(const char* name, byte* cipherSuite0,
26809- byte* cipherSuite , int* flags)
26822+ byte* cipherSuite, byte* major, byte* minor , int* flags)
2681026823{
2681126824 int ret = WC_NO_ERR_TRACE(BAD_FUNC_ARG);
2681226825 int i;
2681326826 unsigned long len;
2681426827 const char* nameDelim;
2681526828
26829+ (void)major;
26830+ (void)minor;
26831+
2681626832 /* Support trailing : */
2681726833 nameDelim = XSTRSTR(name, ":");
2681826834 if (nameDelim)
@@ -26830,9 +26846,19 @@ int GetCipherSuiteFromName(const char* name, byte* cipherSuite0,
2683026846#endif
2683126847
2683226848 if (found) {
26833- *cipherSuite0 = cipher_names[i].cipherSuite0;
26834- *cipherSuite = cipher_names[i].cipherSuite;
26835- *flags = cipher_names[i].flags;
26849+ if (cipherSuite0 != NULL)
26850+ *cipherSuite0 = cipher_names[i].cipherSuite0;
26851+ if (cipherSuite != NULL)
26852+ *cipherSuite = cipher_names[i].cipherSuite;
26853+ #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT) || \
26854+ defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_NGINX)
26855+ if (major != NULL)
26856+ *major = cipher_names[i].major;
26857+ if (minor != NULL)
26858+ *minor = cipher_names[i].minor;
26859+ #endif
26860+ if (flags != NULL)
26861+ *flags = cipher_names[i].flags;
2683626862 ret = 0;
2683726863 break;
2683826864 }
0 commit comments