mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-08-17 08:21:32 +02:00
The mp API variant of wc_PKCS12_PBKDF_ex builds a working buffer holding D || S || P, but totalLen was computed as dLen + sLen and so left out the password block entirely. The fill loop writes pLen bytes starting at S + sLen, which is past the end of the buffer, and DoPKCS12Hash was called with the short length so the password was never absorbed into the digest. A build with this variant enabled therefore derived the same key for every password over a given salt, and overflowed the heap allocation or the static buffer by pLen bytes depending on the salt length. Sum dLen with iLen instead, matching the non-mp variant. That corrects the allocation size, the hash input length, the I update bound and the ForceZero coverage in one place. Fixes F-7306.