Avoid building TLSX_SetResponse unless it is being used. Initialize PIC32 UPDPTR register in all cases.

This commit is contained in:
Kareem
2023-02-28 14:37:45 -07:00
parent 79eaf10041
commit 08a3e2cb6e
2 changed files with 11 additions and 1 deletions

View File

@ -1412,7 +1412,13 @@ int TLSX_HandleUnsupportedExtension(WOLFSSL* ssl)
#endif
#if !defined(NO_WOLFSSL_SERVER) || defined(WOLFSSL_TLS13)
#if defined(WOLFSSL_TLS13) || (!defined(NO_WOLFSSL_SERVER) \
&& (defined(WOLFSSL_SRTP) || defined(HAVE_SESSION_TICKET) \
|| defined(HAVE_SECURE_RENEGOTIATION) || defined(HAVE_SERVER_RENEGOTIATION_INFO) \
|| defined(HAVE_SUPPORTED_CURVES) || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST) || defined(HAVE_TRUNCATED_HMAC) \
|| defined(HAVE_MAX_FRAGMENT) || defined(HAVE_TRUSTED_CA) || defined(HAVE_SNI) \
|| defined(HAVE_ALPN)))
/** Mark an extension to be sent back to the client. */
static void TLSX_SetResponse(WOLFSSL* ssl, TLSX_Type type)
{

View File

@ -89,11 +89,13 @@ static int Pic32Crypto(const byte* pIn, int inLen, word32* pOut, int outLen,
bufferDescriptor *bd_p;
byte *in_p;
byte *out_p;
unsigned int *updptrVal_p;
word32* dst;
word32 padRemain;
int timeout = 0xFFFFFF;
word32* in = (word32*)pIn;
word32* out = pOut;
word32 updptrVal = 0;
int isDynamic = 0;
/* check args */
@ -125,6 +127,7 @@ static int Pic32Crypto(const byte* pIn, int inLen, word32* pOut, int outLen,
bd_p = KVA0_TO_KVA1(&bd);
out_p= KVA0_TO_KVA1(out);
in_p = KVA0_TO_KVA1(in);
updptrVal_p = KVA0_TO_KVA1(&updptrVal);
/* Sync cache if in physical memory (not flash) */
if (PIC32MZ_IF_RAM(in_p)) {
@ -193,6 +196,7 @@ static int Pic32Crypto(const byte* pIn, int inLen, word32* pOut, int outLen,
if (in != out)
XMEMSET(out_p, 0, outLen); /* clear output buffer */
bd_p->DSTADDR = (unsigned int)KVA_TO_PA(out);
bd_p->UPDPTR = (unsigned int)KVA_TO_PA(updptrVal_p);
}
else {
/* hashing */