summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Sleevi <ryan.sleevi@gmail.com>2013-06-10 11:58:03 -0700
committerRyan Sleevi <ryan.sleevi@gmail.com>2013-06-10 11:58:03 -0700
commit72dd61be624b7d4c00b2c424d0d2f3786c30c079 (patch)
tree7cf60bbe4a89465d995b0ee4801ebc7be9dad13d
parent29ec2f5e5f7acafda74eaf7c4a37f6ab815e2290 (diff)
downloadnss-hg-72dd61be624b7d4c00b2c424d0d2f3786c30c079.tar.gz
BUG 875601: SECMOD_CloseUserDB should reset the token delay when removing a user token. This ensures that the token will be immediately recognized as removed and not selected for any ephemeral operations. r=wtc,rrelyea
-rw-r--r--lib/pk11wrap/pk11util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pk11wrap/pk11util.c b/lib/pk11wrap/pk11util.c
index 3197c184e..35cef9e42 100644
--- a/lib/pk11wrap/pk11util.c
+++ b/lib/pk11wrap/pk11util.c
@@ -1495,6 +1495,13 @@ SECMOD_CloseUserDB(PK11SlotInfo *slot)
}
rv = secmod_UserDBOp(slot, CKO_NETSCAPE_DELSLOT, sendSpec);
PR_smprintf_free(sendSpec);
+ /* if we are in the delay period for the "isPresent" call, reset
+ * the delay since we know things have probably changed... */
+ if (slot->nssToken && slot->nssToken->slot) {
+ nssSlot_ResetDelay(slot->nssToken->slot);
+ /* force the slot info structures to properly reset */
+ (void)PK11_IsPresent(slot);
+ }
return rv;
}