summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2002-03-15 19:51:27 +0000
committerrelyea%netscape.com <devnull@localhost>2002-03-15 19:51:27 +0000
commit689ef48fa1ee44877b0e6da466f15ea047c91f20 (patch)
tree2bb7ec63c764946f595393a8b93faf763eb14bb3
parent0d081ad2813f30fd03a0df7bdbe88754cdd1eef6 (diff)
downloadnss-hg-689ef48fa1ee44877b0e6da466f15ea047c91f20.tar.gz
handle older tokens that do not handle GetAttributes correctly.
-rw-r--r--security/nss/lib/dev/ckhelper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/security/nss/lib/dev/ckhelper.c b/security/nss/lib/dev/ckhelper.c
index 2088a40db..85283ff1f 100644
--- a/security/nss/lib/dev/ckhelper.c
+++ b/security/nss/lib/dev/ckhelper.c
@@ -170,6 +170,19 @@ nssCKObject_GetAttributes
goto loser;
}
}
+
+ if (count > 1 && ((ckrv == CKR_ATTRIBUTE_TYPE_INVALID) ||
+ (ckrv == CKR_ATTRIBUTE_SENSITIVE))) {
+ /* old tokens would keep the length of '0' and not deal with any
+ * of the attributes we passed. For those tokens read them one at
+ * a time */
+ for (i=0; i < count; i++) {
+ if (obj_template[i].ulValueLen == 0) {
+ (void) nssCKObject_GetAttributes(object,&obj_template[i], 1,
+ arenaOpt, session, slot);
+ }
+ }
+ }
return PR_SUCCESS;
loser:
if (alloced) {