Fix to resolve issue with PIC32MZ crypto hardware (AES/DES3 only) where an unaligned input/output buffer was not handled correctly. This results in a BUFFER_E. This was seen with DTLS v1.0 and TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA cipher suite. Fix is to allocate a dynamic buffer from heap if the input/output are not aligned. Tested and verified with a PIC32MZ2048EFM144 and the wolfssl_udp_client example for Harmony using DTLS v1.0 and the setudppacketoptions 192.168.0.107 11111 hello -> sendudppacket commands. Cleanups in older ctoacrypt/settings.h for PIC32MZ.

This commit is contained in:
David Garske
2018-08-22 13:39:03 -07:00
parent 776fd51720
commit 53af520911
2 changed files with 42 additions and 10 deletions

View File

@@ -150,16 +150,20 @@
#define TFM_TIMING_RESISTANT
#endif
#ifdef CYASSL_MICROCHIP_PIC32MZ
#define CYASSL_PIC32MZ_CE
#define CYASSL_PIC32MZ_CRYPT
#define HAVE_AES_ENGINE
#define CYASSL_PIC32MZ_RNG
/* #define CYASSL_PIC32MZ_HASH */
#if defined(CYASSL_MICROCHIP_PIC32MZ) || defined(WOLFSSL_MICROCHIP_PIC32MZ)
#ifndef NO_PIC32MZ_CRYPT
#define WOLFSSL_PIC32MZ_CRYPT
#endif
#ifndef NO_PIC32MZ_RNG
#define WOLFSSL_PIC32MZ_RNG
#endif
#ifndef NO_PIC32MZ_HASH
#define WOLFSSL_PIC32MZ_HASH
#endif
#define CYASSL_AES_COUNTER
#define HAVE_AESGCM
#define NO_BIG_INT
#endif
#ifdef MICROCHIP_TCPIP_V5