Skip to content

address undefined shift behavior and overflow#9195

Merged
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
rlm2002:zd20508
Sep 18, 2025
Merged

address undefined shift behavior and overflow#9195
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
rlm2002:zd20508

Conversation

@rlm2002
Copy link
Contributor

@rlm2002 rlm2002 commented Sep 12, 2025

Description

address undefined shift behavior and overflow in pwdbased.c. Cast 1 << cost * bSz to avoid 32-bit overflow. Reject parameter combinations where (1 << cost) * bSz would exceed SCRYPT_WORD32_MAX.

Add test case for cost = 22 and blockSize = 8

address zd#20508
Shoutout to Luigino Camastra, Aisle Research for the report. Thank you!

Testing

./configure --enable-scrypt --enable-opensslextra && make check

Checklist

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

@rlm2002 rlm2002 self-assigned this Sep 12, 2025
@rlm2002
Copy link
Contributor Author

rlm2002 commented Sep 15, 2025

Retest this please jenkins: StreamCorruptedException

@rlm2002 rlm2002 marked this pull request as ready for review September 15, 2025 15:30
@rlm2002 rlm2002 force-pushed the zd20508 branch 3 times, most recently from ca1665b to 01b2177 Compare September 15, 2025 23:01
@rlm2002 rlm2002 marked this pull request as draft September 16, 2025 16:01
@rlm2002
Copy link
Contributor Author

rlm2002 commented Sep 16, 2025

Retest this please jenkins: generic config parser was not stable

@rlm2002 rlm2002 marked this pull request as ready for review September 16, 2025 21:12
@JacobBarthelmeh JacobBarthelmeh merged commit 5d9c608 into wolfSSL:master Sep 18, 2025
326 of 330 checks passed
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