wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.34k stars 831 forks source link

[Bug]: XREALLOC implicit definition compile error #6201

Closed PaulMartinsen closed 1 year ago

PaulMartinsen commented 1 year ago

Contact Details

No response

Version

recent master

Description

PR #6033 limits definition of XREALLOC to USE_INTEGER_HEAP_MATH and OPENSSL_EXTRA, however XREALLOC is used in other situations too. For example, if HAVE_SESSION_TICKET is defined (to support session resumption for TLSv1.3) without using integer heap math or OpenSSL extra, then compilation fails on ESP32s3 with an implicit definition of XREALLOC error.

Reproduction steps

#define HAVE_SESSION_TICKET in user_settings.h without defining OPENSSL_EXTRA or USE_INTEGER_HEAP_MATH and build.

Relevant log output

F:/Lumos/Vendor/Wolf/wolfssl/src/ssl.c: In function 'wolfSSL_DupSessionEx':
F:/Lumos/Vendor/Wolf/wolfssl/src/ssl.c:21347:30: error: implicit declaration of function 'XREALLOC'; did you mean 'XMALLOC'? [-Werror=implicit-function-declaration]
21347 |                 tmp = (byte*)XREALLOC(ticBuff, input->ticketLen,
      |                              ^~~~~~~~
      |                              XMALLOC
cc1.exe: some warnings being treated as errors
embhorn commented 1 year ago

Hi @PaulMartinsen

I've requested a review of this issue by our engineers.

Thanks, @embhorn - wolfSSL Support