diff mbox series

crypto_wolfssl: wc_PBKDF2 in FIPS requires unlocking the private key

Message ID 20250108184106.85958-1-juliusz@wolfssl.com
State Accepted
Headers show
Series crypto_wolfssl: wc_PBKDF2 in FIPS requires unlocking the private key | expand

Commit Message

Juliusz Sosinowicz Jan. 8, 2025, 6:41 p.m. UTC
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
---
 src/crypto/crypto_wolfssl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen Feb. 2, 2025, 6:40 p.m. UTC | #1
Thanks, applied.
diff mbox series

Patch

diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
index 269174321b..2e253e2a91 100644
--- a/src/crypto/crypto_wolfssl.c
+++ b/src/crypto/crypto_wolfssl.c
@@ -514,8 +514,10 @@  int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len,
 {
 	int ret;
 
+    PRIVATE_KEY_UNLOCK();
 	ret = wc_PBKDF2(buf, (const byte *) passphrase, os_strlen(passphrase),
 			ssid, ssid_len, iterations, buflen, WC_SHA);
+    PRIVATE_KEY_LOCK();
 	if (ret != 0) {
 		if (ret == HMAC_MIN_KEYLEN_E) {
 			LOG_WOLF_ERROR_VA("wolfSSL: Password is too short. Make sure your password is at least %d characters long. This is a requirement for FIPS builds.",