forked from wolfSSL/wolfssl
Multicast
1. Opt-out the wolfmath code if not using big integers. 2. Opt-in a few functions when using lean PSK and DTLS. 3. Add a couple (void)heap to hush the compiler for usused variables in lean PSK. 4. Add include limits.h to internal.h if CHAR_BIT isn't defined. This is mainly for DTLS with lean PSK.
This commit is contained in:
@@ -329,7 +329,8 @@ static INLINE void c16toa(word16 u16, byte* c)
|
|||||||
|
|
||||||
|
|
||||||
#if !defined(NO_OLD_TLS) || defined(HAVE_CHACHA) || defined(HAVE_AESCCM) \
|
#if !defined(NO_OLD_TLS) || defined(HAVE_CHACHA) || defined(HAVE_AESCCM) \
|
||||||
|| defined(HAVE_AESGCM) || defined(WOLFSSL_SESSION_EXPORT)
|
|| defined(HAVE_AESGCM) || defined(WOLFSSL_SESSION_EXPORT) \
|
||||||
|
|| defined(WOLFSSL_DTLS)
|
||||||
/* convert 32 bit integer to opaque */
|
/* convert 32 bit integer to opaque */
|
||||||
static INLINE void c32toa(word32 u32, byte* c)
|
static INLINE void c32toa(word32 u32, byte* c)
|
||||||
{
|
{
|
||||||
@@ -4012,7 +4013,7 @@ void FreeSSL(WOLFSSL* ssl, void* heap)
|
|||||||
|
|
||||||
|
|
||||||
#if !defined(NO_OLD_TLS) || defined(HAVE_CHACHA) || defined(HAVE_AESCCM) \
|
#if !defined(NO_OLD_TLS) || defined(HAVE_CHACHA) || defined(HAVE_AESCCM) \
|
||||||
|| defined(HAVE_AESGCM)
|
|| defined(HAVE_AESGCM) || defined(WOLFSSL_DTLS)
|
||||||
static INLINE void GetSEQIncrement(WOLFSSL* ssl, int verify, word32 seq[2])
|
static INLINE void GetSEQIncrement(WOLFSSL* ssl, int verify, word32 seq[2])
|
||||||
{
|
{
|
||||||
if (verify) {
|
if (verify) {
|
||||||
@@ -4116,6 +4117,7 @@ DtlsMsg* DtlsMsgNew(word32 sz, void* heap)
|
|||||||
{
|
{
|
||||||
DtlsMsg* msg = NULL;
|
DtlsMsg* msg = NULL;
|
||||||
|
|
||||||
|
(void)heap;
|
||||||
msg = (DtlsMsg*)XMALLOC(sizeof(DtlsMsg), heap, DYNAMIC_TYPE_DTLS_MSG);
|
msg = (DtlsMsg*)XMALLOC(sizeof(DtlsMsg), heap, DYNAMIC_TYPE_DTLS_MSG);
|
||||||
|
|
||||||
if (msg != NULL) {
|
if (msg != NULL) {
|
||||||
@@ -4172,6 +4174,7 @@ static DtlsFrag* CreateFragment(word32* begin, word32 end, const byte* data,
|
|||||||
DtlsFrag* newFrag;
|
DtlsFrag* newFrag;
|
||||||
word32 added = end - *begin + 1;
|
word32 added = end - *begin + 1;
|
||||||
|
|
||||||
|
(void)heap;
|
||||||
newFrag = (DtlsFrag*)XMALLOC(sizeof(DtlsFrag), heap,
|
newFrag = (DtlsFrag*)XMALLOC(sizeof(DtlsFrag), heap,
|
||||||
DYNAMIC_TYPE_DTLS_FRAG);
|
DYNAMIC_TYPE_DTLS_FRAG);
|
||||||
if (newFrag != NULL) {
|
if (newFrag != NULL) {
|
||||||
|
@@ -7654,6 +7654,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
|
|||||||
WOLFSSL_ENTER("DTLSv1_2_client_method_ex");
|
WOLFSSL_ENTER("DTLSv1_2_client_method_ex");
|
||||||
if (method)
|
if (method)
|
||||||
InitSSL_Method(method, MakeDTLSv1_2());
|
InitSSL_Method(method, MakeDTLSv1_2());
|
||||||
|
(void)heap;
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -8005,6 +8006,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
|
|||||||
InitSSL_Method(method, MakeDTLSv1_2());
|
InitSSL_Method(method, MakeDTLSv1_2());
|
||||||
method->side = WOLFSSL_SERVER_END;
|
method->side = WOLFSSL_SERVER_END;
|
||||||
}
|
}
|
||||||
|
(void)heap;
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||||
#include <wolfssl/wolfcrypt/logging.h>
|
#include <wolfssl/wolfcrypt/logging.h>
|
||||||
|
|
||||||
|
#if defined(USE_FAST_MATH) || !defined(NO_BIG_INT)
|
||||||
|
|
||||||
int get_digit_count(mp_int* a)
|
int get_digit_count(mp_int* a)
|
||||||
{
|
{
|
||||||
@@ -102,3 +103,5 @@ int mp_rand(mp_int* a, int digits, WC_RNG* rng)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -150,6 +150,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CHAR_BIT
|
||||||
|
/* Needed for DTLS without big math */
|
||||||
|
#include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
|
Reference in New Issue
Block a user