if (rwsession == CK_INVALID_SESSION) return rv;
if (rwsession == CK_INVALID_SESSION) { PORT_SetError(SEC_ERROR_BAD_DATA); return rv; }
PK11_CheckSSOPassword(PK11SlotInfo *slot, char *ssopw){    CK_SESSION_HANDLE rwsession;    CK_RV crv;    SECStatus rv = SECFailure;    int len = PORT_Strlen(ssopw);    /* get a rwsession */    rwsession = PK11_GetRWSession(slot);    if (rwsession == CK_INVALID_SESSION) return rv;    if (slot->protectedAuthPath) {	len = 0;	ssopw = NULL;    }    /* check the password */    crv = PK11_GETTAB(slot)->C_Login(rwsession,CKU_SO,						(unsigned char *)ssopw,len);    slot->lastLoginCheck = 0;    switch (crv) {    /* if we're already logged in, we're good to go */    case CKR_OK:	rv = SECSuccess;	break;    case CKR_PIN_INCORRECT:	PORT_SetError(SEC_ERROR_BAD_PASSWORD);	rv = SECWouldBlock; /* everything else is ok, only the pin is bad */	break;    default:	PORT_SetError(PK11_MapError(crv));	rv = SECFailure; /* some failure we can't fix by retrying */    }    PK11_GETTAB(slot)->C_Logout(rwsession);    slot->lastLoginCheck = 0;    /* release rwsession */    PK11_RestoreROSession(slot,rwsession);    return rv;}