Skip to content

evp: pass a zero salt length when EVP_BytesToKey has no salt - #12106

Open
lealem47 wants to merge 2 commits into
wolfSSL:masterfrom
lealem47:evp_pbkdf1
Open

lealem47 wants to merge 2 commits into
wolfSSL:masterfrom
lealem47:evp_pbkdf1

Conversation

@lealem47

Copy link
Copy Markdown
Contributor

Description

Account for the tightening of args in #12059.

This PR fixes general openssl compat for 0 salt encrypt's. Observed through wolfCLU failures.

Testing

./configure --enable-wolfclu && make & make install in wolfSSL

./configure && make check in wolfclu

Checklist

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

@lealem47 lealem47 self-assigned this Nov 12, 2026
Copilot AI balanced review requested due to automatic review settings November 12, 2026 01:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the change restoring unsalted EVP_BytesToKey compatibility.

No open issues 🎉

What changed in this PR

Restores unsalted EVP_BytesToKey compatibility after #12059 tightened wc_PBKDF1_ex argument validation, addressing the reported wolfCLU failures.

Changes:

  • Passes a zero salt length when the salt pointer is NULL, preserving the eight-byte length for present salts.
  • Adds an AES-128-CBC/SHA-256 regression case that checks the derived key and IV without salt.
File Description
wolfcrypt/​src/​evp.c Makes the KDF salt length match salt presence.
tests/​api/​test_evp_cipher.c Adds expected key and IV assertions for unsalted derivation.

Review effort: Balanced

@lealem47 lealem47 assigned wolfSSL-Bot and unassigned lealem47 Nov 12, 2026
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.

3 participants