Skip to content

Fix build error with RECORD_SIZE defined#7383

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
embhorn:zd17763
Apr 2, 2024
Merged

Fix build error with RECORD_SIZE defined#7383
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
embhorn:zd17763

Conversation

@embhorn
Copy link
Copy Markdown
Member

@embhorn embhorn commented Apr 2, 2024

Description

MAX_RECORD_SIZE is defined in an enum, which would have a value of 0 during preprocessing. So if RECORD_SIZE is user defined, then the check RECORD_SIZE > MAX_RECORD_SIZE produces errors:

In file included from wolfcrypt/src/asn.c:200:
./wolfssl/internal.h:2278:44: error: "MAX_RECORD_SIZE" is not defined, evaluates to 0 [-Werror=undef]
 2278 |     #if RECORD_SIZE < 128 || RECORD_SIZE > MAX_RECORD_SIZE
      |                                            ^~~~~~~~~~~~~~~
./wolfssl/internal.h:2279:10: error: #error Invalid record size
 2279 |         #error Invalid record size
      |          ^~~~~
  CC       wolfcrypt/src/src_libwolfssl_la-chacha.lo
  CC       wolfcrypt/src/src_libwolfssl_la-chacha20_poly1305.lo
cc1: all warnings being treated as errors

Fixes zd17763

Testing

./configure CFLAGS="-DRECORD_SIZE=1024" && make

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Apr 2, 2024
@embhorn
Copy link
Copy Markdown
Member Author

embhorn commented Apr 2, 2024

retest this please

@embhorn embhorn requested a review from dgarske April 2, 2024 13:45
@embhorn embhorn assigned dgarske and unassigned embhorn Apr 2, 2024
Comment thread wolfssl/internal.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this go near #ifdef RECORD_SIZE at line 2276? Making this a macro is fine with me. I don't see any downstream issues.

@dgarske dgarske assigned embhorn and wolfSSL-Bot and unassigned dgarske Apr 2, 2024
@embhorn embhorn requested a review from dgarske April 2, 2024 15:03
@embhorn embhorn removed their assignment Apr 2, 2024
@JacobBarthelmeh JacobBarthelmeh merged commit b334750 into wolfSSL:master Apr 2, 2024
@embhorn embhorn deleted the zd17763 branch April 24, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants