if ((slot->minimumPinLen == 0) && (params->pwRequired) && (slot->minimumPinLen <= SFTK_MAX_PIN)) {
if ((slot->minimumPinLen == 0) && (params->pwRequired)) {
SFTK_SlotInit(char *configdir,sftk_token_parameters *params, int moduleIndex){    unsigned int i;    CK_SLOT_ID slotID = params->slotID;    SFTKSlot *slot = PORT_ZNew(SFTKSlot);    PRBool needLogin = !params->noKeyDB;    CK_RV crv;    if (slot == NULL) {	return CKR_HOST_MEMORY;    }    slot->optimizeSpace = params->optimizeSpace;    if (slot->optimizeSpace) {	slot->tokObjHashSize = SPACE_TOKEN_OBJECT_HASH_SIZE;	slot->sessHashSize = SPACE_SESSION_HASH_SIZE;	slot->numSessionLocks = 1;    } else {	slot->tokObjHashSize = TIME_TOKEN_OBJECT_HASH_SIZE;	slot->sessHashSize = TIME_SESSION_HASH_SIZE;	slot->numSessionLocks = slot->sessHashSize/BUCKETS_PER_SESSION_LOCK;    }    slot->sessionLockMask = slot->numSessionLocks-1;    slot->slotLock = PZ_NewLock(nssILockSession);    if (slot->slotLock == NULL)	goto mem_loser;    slot->sessionLock = PORT_ZNewArray(PZLock *, slot->numSessionLocks);    if (slot->sessionLock == NULL)	goto mem_loser;    for (i=0; i < slot->numSessionLocks; i++) {        slot->sessionLock[i] = PZ_NewLock(nssILockSession);        if (slot->sessionLock[i] == NULL) 	    goto mem_loser;    }    slot->objectLock = PZ_NewLock(nssILockObject);    if (slot->objectLock == NULL)     	goto mem_loser;    slot->head = PORT_ZNewArray(SFTKSession *, slot->sessHashSize);    if (slot->head == NULL) 	goto mem_loser;    slot->tokObjects = PORT_ZNewArray(SFTKObject *, slot->tokObjHashSize);    if (slot->tokObjects == NULL) 	goto mem_loser;    slot->tokenHashTable = PL_NewHashTable(64,sftk_HashNumber,PL_CompareValues,					SECITEM_HashCompare, NULL, 0);    if (slot->tokenHashTable == NULL) 	goto mem_loser;    slot->password = NULL;    slot->hasTokens = PR_FALSE;    slot->sessionIDCount = 0;    slot->sessionIDConflict = 0;    slot->sessionCount = 0;    slot->rwSessionCount = 0;    slot->tokenIDCount = 1;    slot->needLogin = PR_FALSE;    slot->isLoggedIn = PR_FALSE;    slot->ssoLoggedIn = PR_FALSE;    slot->DB_loaded = PR_FALSE;    slot->slotID = slotID;    slot->certDB = NULL;    slot->keyDB = NULL;    slot->minimumPinLen = 0;    slot->readOnly = params->readOnly;    sftk_setStringName(params->tokdes ? params->tokdes : 	sftk_getDefTokName(slotID), slot->tokDescription, 						sizeof(slot->tokDescription));    sftk_setStringName(params->slotdes ? params->slotdes : 	sftk_getDefSlotName(slotID), slot->slotDescription, 						sizeof(slot->slotDescription));    if ((!params->noCertDB) || (!params->noKeyDB)) {	crv = sftk_DBInit(params->configdir ? params->configdir : configdir,		params->certPrefix, params->keyPrefix, params->readOnly,		params->noCertDB, params->noKeyDB, params->forceOpen, 						&slot->certDB, &slot->keyDB);	if (crv != CKR_OK) {	    goto loser;	}	if (nsslowcert_needDBVerify(slot->certDB)) {	    sftk_DBVerify(slot);	}    }    if (needLogin) {	/* 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) {	    slot->minimumPinLen = params->minPW;	}	if ((slot->minimumPinLen == 0) && (params->pwRequired) && 		(slot->minimumPinLen <= SFTK_MAX_PIN)) {	    slot->minimumPinLen = 1;	}    }    crv = sftk_RegisterSlot(slot, moduleIndex);    if (crv != CKR_OK) {	goto loser;    }    return CKR_OK;mem_loser:    crv = CKR_HOST_MEMORY;loser:    sftk_DestroySlotData(slot);    return crv;}