From 8d7d2c74ee6c57210b4d89291ef0dd12933d528a Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Tue, 17 Dec 2019 09:53:08 +1000 Subject: [PATCH] PKCS#12 PBKDF - maximum tmp buffer size Use WC_MAX_BLOCK_SIZE - only an issue if PBKDF is using SHA-3 algorithms. --- wolfcrypt/src/pwdbased.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index c0a592ca6..200cdc43b 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -484,7 +484,7 @@ int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd, int passLen, else { if (outSz > (int)v) { /* take off MSB */ - byte tmp[129]; + byte tmp[WC_MAX_BLOCK_SIZE + 1]; ret = mp_to_unsigned_bin(&res, tmp); XMEMCPY(I + i, tmp + 1, v); }