Skip to content

Commit

Permalink
handle older tokens that do not handle GetAttributes correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
relyea%netscape.com committed Mar 15, 2002
1 parent 0dfc756 commit 376c546
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions security/nss/lib/dev/ckhelper.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 376c546

Please sign in to comment.