Skip to content

Commit bd11e2d

Browse files
committed
Guard PBKDF2 empty pin on NSS
1 parent 7088a12 commit bd11e2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/internal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5757,10 +5757,12 @@ static int HashPIN(char* pin, int pinLen, byte* seed, int seedLen, byte* hash,
57575757
int hashLen, WP11_Slot* slot)
57585758
{
57595759
#ifdef WOLFPKCS11_PBKDF2
5760-
#if defined(HAVE_FIPS)
5760+
#if defined(HAVE_FIPS) && defined(WOLFPKCS11_NSS)
57615761
if (pinLen == 0) {
57625762
/* For FIPS, use empty pin of HMAC_FIPS_MIN_KEY bytes when pinLen is 0.
57635763
* Otherwise we hit HMAC_MIN_KEYLEN_E.
5764+
* Certain NSS tools will try to login a blank token with an empty pin
5765+
* and this needs to succeed, or the tool will fail.
57645766
*/
57655767
byte emptyPin[HMAC_FIPS_MIN_KEY];
57665768
XMEMSET(emptyPin, 0, sizeof(emptyPin));

0 commit comments

Comments
 (0)