Rename PKCS#11 v2_20_mode option to plug_and_play

As it is the only feature it controls.
Also, change the default to true.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3637 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
alonbl 2009-01-23 09:14:15 +00:00
parent 98841d1e61
commit 17cf43eeb1
4 changed files with 8 additions and 8 deletions

View File

@ -300,11 +300,11 @@ app default {
# Parameters for the OpenSC PKCS11 module
app opensc-pkcs11 {
pkcs11 {
# Should the module work in PKCS#11 v2.20 (instead of v2.11) mode?
# Should the module support hotplug of readers as per PKCS#11 v2.20?
# This affects slot changes and PC/SC PnP, as v2.11 applications
# are not allowed to change the length of the slot list.
# Default: false
# v2_20_mode = true;
# Default: true
# plug_and_play = false;
# Maximum Number of virtual slots.
# If there are more slots than defined here,

View File

@ -317,7 +317,7 @@ void load_pkcs11_parameters(struct sc_pkcs11_config *conf, sc_context_t *ctx)
int i;
/* Set defaults */
conf->v2_20_mode = 0;
conf->plug_and_play = 1;
conf->max_virtual_slots = 16;
conf->slots_per_card = 4;
conf->hide_empty_tokens = 0;
@ -331,7 +331,7 @@ void load_pkcs11_parameters(struct sc_pkcs11_config *conf, sc_context_t *ctx)
return;
/* contains the defaults, if there is a "pkcs11" config block */
conf->v2_20_mode = scconf_get_bool(conf_block, "v2_20_mode", conf->v2_20_mode);
conf->plug_and_play = scconf_get_bool(conf_block, "plug_and_play", conf->plug_and_play);
conf->max_virtual_slots = scconf_get_int(conf_block, "max_virtual_slots", conf->max_virtual_slots);
/*XXX: rename the option in 0.12+ */
conf->slots_per_card = scconf_get_int(conf_block, "num_slots", conf->slots_per_card);

View File

@ -295,7 +295,7 @@ CK_RV C_GetInfo(CK_INFO_PTR pInfo)
memset(pInfo, 0, sizeof(CK_INFO));
pInfo->cryptokiVersion.major = 2;
pInfo->cryptokiVersion.minor = sc_pkcs11_conf.v2_20_mode ? 20 : 11;
pInfo->cryptokiVersion.minor = 20;
strcpy_bp(pInfo->manufacturerID,
"OpenSC (www.opensc-project.org)",
sizeof(pInfo->manufacturerID));
@ -348,7 +348,7 @@ CK_RV C_GetSlotList(CK_BBOOL tokenPresent, /* only slots with token prese
sc_debug(context, "Getting slot listing\n");
/* Slot list can only change in v2.20 */
if (pSlotList == NULL_PTR && sc_pkcs11_conf.v2_20_mode) {
if (pSlotList == NULL_PTR && sc_pkcs11_conf.plug_and_play) {
sc_ctx_detect_readers(context);
}
card_detect_all();

View File

@ -87,7 +87,7 @@ struct sc_pkcs11_pool {
};
struct sc_pkcs11_config {
unsigned int v2_20_mode;
unsigned int plug_and_play;
unsigned int max_virtual_slots;
unsigned int slots_per_card;
unsigned char hide_empty_tokens;