apply Stef's patch which puts all public objects in first slot if only one pin is present (and hide_empty_tokens is true)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2448 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
c26dde1a82
commit
f59a51397c
|
@ -295,7 +295,7 @@ app opensc-pkcs11 {
|
|||
#
|
||||
# Set this option to true to hide these empty
|
||||
# slots.
|
||||
hide_empty_tokens = false;
|
||||
hide_empty_tokens = yes;
|
||||
|
||||
# By default, the OpenSC PKCS#11 module will
|
||||
# try to lock this card once you have authenticated
|
||||
|
|
|
@ -674,18 +674,21 @@ static CK_RV pkcs15_create_tokens(struct sc_pkcs11_card *p11card)
|
|||
continue;
|
||||
|
||||
if (is_privkey(obj)) {
|
||||
sc_debug(context, "Adding private key %d to PIN %d\n", j, i);
|
||||
pkcs15_add_object(slot, obj, NULL);
|
||||
}
|
||||
else if (is_data(obj)) {
|
||||
sc_debug(context, "Adding private key %d to PIN %d\n", j, i);
|
||||
pkcs15_add_object(slot, obj, NULL);
|
||||
} else if (is_data(obj)) {
|
||||
sc_debug(context, "Adding data object %d to PIN %d\n", j, i);
|
||||
pkcs15_add_object(slot, obj, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add all public objects to a virtual slot without pin protection */
|
||||
slot = NULL;
|
||||
/* Add all public objects to a virtual slot without pin protection.
|
||||
* If there's only 1 pin and the hide_empty_tokens option is set,
|
||||
* add the public objects to the slot that corresponds to that pin.
|
||||
*/
|
||||
if (!(auth_count == 1 && sc_pkcs11_conf.hide_empty_tokens))
|
||||
slot = NULL;
|
||||
|
||||
/* Add all the remaining objects */
|
||||
for (j = 0; j < fw_data->num_objects; j++) {
|
||||
|
|
Loading…
Reference in New Issue