From 17cf43eeb1a4cdd70509c98b546d499a4d46d26c Mon Sep 17 00:00:00 2001 From: alonbl Date: Fri, 23 Jan 2009 09:14:15 +0000 Subject: [PATCH] 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 --- etc/opensc.conf.in | 6 +++--- src/pkcs11/misc.c | 4 ++-- src/pkcs11/pkcs11-global.c | 4 ++-- src/pkcs11/sc-pkcs11.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/opensc.conf.in b/etc/opensc.conf.in index 645be28a..6c324ba0 100644 --- a/etc/opensc.conf.in +++ b/etc/opensc.conf.in @@ -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, diff --git a/src/pkcs11/misc.c b/src/pkcs11/misc.c index c5da7e3c..0a0c1512 100644 --- a/src/pkcs11/misc.c +++ b/src/pkcs11/misc.c @@ -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); diff --git a/src/pkcs11/pkcs11-global.c b/src/pkcs11/pkcs11-global.c index 55c4c875..87e465b4 100644 --- a/src/pkcs11/pkcs11-global.c +++ b/src/pkcs11/pkcs11-global.c @@ -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(); diff --git a/src/pkcs11/sc-pkcs11.h b/src/pkcs11/sc-pkcs11.h index 6751484a..1ab197e9 100644 --- a/src/pkcs11/sc-pkcs11.h +++ b/src/pkcs11/sc-pkcs11.h @@ -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;