Thanks Robert for your suggestion. I realized that I have to release all reference to the slot. After resetting the token, the slot comes to normal state after I quit form the dialog window that I have used to release the initialized slot. About the prompting for old password during token initialization, I think that problem is with PSM. If I ignore the old-password field and only provide new password, everything works fine. Thanks once again for your help. -- Subrata
Robert Relyea wrote: > Subrata Mazumdar wrote: >> nsCOMPtr<nsIPK11Token> softToken; >> rv = pkcs11Slot->GetToken(getter_AddRefs(softToken)); >> softToken->Login(PR_FALSE); // prompts for initializing password >> >> . . . >> >> softToken->Reset(); // expected that token/slot password would be >> in the uninitialized state >> SECMOD_CloseUserDB( softTokenSlot); >> When th slot is closed, the token is removed but the slot is >> still there with the old password. >> > You need to make sure you free all your references to your slot > (including the slot itself & and objects associated with the slot). > That is likely what's causing you to create a new slot in your step > below. > > This doesn't explain why softToken->Reset() is not working. The base > code is in PSM, but I believe it just maps to a token reset at that > PKCS #11 level. Tracing the error code from NSC_InitToken() might be > instructive here. >> When I open a new soft-token using SECMOD_OpenUserDB() with a new >> token name, it is installed in >> existing the empty slot with the old slot name and protected with the >> old password. >> How do I take the empty slot to uninitialized state so that >> 'nsIPK11Token.login()' does not prompt for the >> old password while asking for the new password? >> Thanks for your help. >> -- >> Subrata >> >> >> >> >> _______________________________________________ >> dev-tech-crypto mailing list >> dev-tech-crypto@lists.mozilla.org >> https://lists.mozilla.org/listinfo/dev-tech-crypto >> > _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto