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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to