diff --git a/security/nss/lib/softoken/pk11db.c b/security/nss/lib/softoken/pk11db.c index 3918033297f5..edf0d310320c 100644 --- a/security/nss/lib/softoken/pk11db.c +++ b/security/nss/lib/softoken/pk11db.c @@ -167,8 +167,8 @@ secmod_parseParameters(char *param, sftk_parameters *parsed, PRBool isFIPS) SECMOD_HANDLE_STRING_ARG(index,slotdes,"cryptoSlotDescription=",;) SECMOD_HANDLE_STRING_ARG(index,pslotdes,"dbSlotDescription=",;) SECMOD_HANDLE_STRING_ARG(index,fslotdes,"FIPSSlotDescription=",;) - SECMOD_HANDLE_STRING_ARG(index,minPW,"FIPSTokenDescription=",;) - SECMOD_HANDLE_STRING_ARG(index,tmp,"minPWLen=",;) + SECMOD_HANDLE_STRING_ARG(index,fpslotdes,"FIPSTokenDescription=",;) + SECMOD_HANDLE_STRING_ARG(index,minPW,"minPWLen=",;) SECMOD_HANDLE_STRING_ARG(index,tmp,"flags=", if(tmp) { secmod_parseFlags(param,parsed); PORT_Free(tmp); }) diff --git a/security/nss/lib/softoken/pkcs11.c b/security/nss/lib/softoken/pkcs11.c index 21c7465788c4..b034801eba4a 100644 --- a/security/nss/lib/softoken/pkcs11.c +++ b/security/nss/lib/softoken/pkcs11.c @@ -2558,11 +2558,10 @@ SFTK_SlotInit(char *configdir,sftk_token_parameters *params, int moduleIndex) /* if the data base is initialized with a null password,remember that */ slot->needLogin = (PRBool)!sftk_hasNullPassword(slot->keyDB,&slot->password); - if (params->minPW <= SFTK_MAX_PIN) { + if ((params->minPW >= 0) && (params->minPW <= SFTK_MAX_PIN)) { slot->minimumPinLen = params->minPW; } - if ((slot->minimumPinLen == 0) && (params->pwRequired) && - (slot->minimumPinLen <= SFTK_MAX_PIN)) { + if ((slot->minimumPinLen == 0) && (params->pwRequired)) { slot->minimumPinLen = 1; } } @@ -3049,10 +3048,7 @@ CK_RV NSC_GetTokenInfo(CK_SLOT_ID slotID,CK_TOKEN_INFO_PTR pInfo) CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED; } pInfo->ulMaxPinLen = SFTK_MAX_PIN; - pInfo->ulMinPinLen = 0; - if (slot->minimumPinLen > 0) { - pInfo->ulMinPinLen = (CK_ULONG)slot->minimumPinLen; - } + pInfo->ulMinPinLen = (CK_ULONG)slot->minimumPinLen; pInfo->ulTotalPublicMemory = 1; pInfo->ulFreePublicMemory = 1; pInfo->ulTotalPrivateMemory = 1;