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:
parent
98841d1e61
commit
17cf43eeb1
@ -300,11 +300,11 @@ app default {
|
|||||||
# Parameters for the OpenSC PKCS11 module
|
# Parameters for the OpenSC PKCS11 module
|
||||||
app opensc-pkcs11 {
|
app opensc-pkcs11 {
|
||||||
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
|
# This affects slot changes and PC/SC PnP, as v2.11 applications
|
||||||
# are not allowed to change the length of the slot list.
|
# are not allowed to change the length of the slot list.
|
||||||
# Default: false
|
# Default: true
|
||||||
# v2_20_mode = true;
|
# plug_and_play = false;
|
||||||
|
|
||||||
# Maximum Number of virtual slots.
|
# Maximum Number of virtual slots.
|
||||||
# If there are more slots than defined here,
|
# If there are more slots than defined here,
|
||||||
|
@ -317,7 +317,7 @@ void load_pkcs11_parameters(struct sc_pkcs11_config *conf, sc_context_t *ctx)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Set defaults */
|
/* Set defaults */
|
||||||
conf->v2_20_mode = 0;
|
conf->plug_and_play = 1;
|
||||||
conf->max_virtual_slots = 16;
|
conf->max_virtual_slots = 16;
|
||||||
conf->slots_per_card = 4;
|
conf->slots_per_card = 4;
|
||||||
conf->hide_empty_tokens = 0;
|
conf->hide_empty_tokens = 0;
|
||||||
@ -331,7 +331,7 @@ void load_pkcs11_parameters(struct sc_pkcs11_config *conf, sc_context_t *ctx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* contains the defaults, if there is a "pkcs11" config block */
|
/* 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);
|
conf->max_virtual_slots = scconf_get_int(conf_block, "max_virtual_slots", conf->max_virtual_slots);
|
||||||
/*XXX: rename the option in 0.12+ */
|
/*XXX: rename the option in 0.12+ */
|
||||||
conf->slots_per_card = scconf_get_int(conf_block, "num_slots", conf->slots_per_card);
|
conf->slots_per_card = scconf_get_int(conf_block, "num_slots", conf->slots_per_card);
|
||||||
|
@ -295,7 +295,7 @@ CK_RV C_GetInfo(CK_INFO_PTR pInfo)
|
|||||||
|
|
||||||
memset(pInfo, 0, sizeof(CK_INFO));
|
memset(pInfo, 0, sizeof(CK_INFO));
|
||||||
pInfo->cryptokiVersion.major = 2;
|
pInfo->cryptokiVersion.major = 2;
|
||||||
pInfo->cryptokiVersion.minor = sc_pkcs11_conf.v2_20_mode ? 20 : 11;
|
pInfo->cryptokiVersion.minor = 20;
|
||||||
strcpy_bp(pInfo->manufacturerID,
|
strcpy_bp(pInfo->manufacturerID,
|
||||||
"OpenSC (www.opensc-project.org)",
|
"OpenSC (www.opensc-project.org)",
|
||||||
sizeof(pInfo->manufacturerID));
|
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");
|
sc_debug(context, "Getting slot listing\n");
|
||||||
/* Slot list can only change in v2.20 */
|
/* 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);
|
sc_ctx_detect_readers(context);
|
||||||
}
|
}
|
||||||
card_detect_all();
|
card_detect_all();
|
||||||
|
@ -87,7 +87,7 @@ struct sc_pkcs11_pool {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct sc_pkcs11_config {
|
struct sc_pkcs11_config {
|
||||||
unsigned int v2_20_mode;
|
unsigned int plug_and_play;
|
||||||
unsigned int max_virtual_slots;
|
unsigned int max_virtual_slots;
|
||||||
unsigned int slots_per_card;
|
unsigned int slots_per_card;
|
||||||
unsigned char hide_empty_tokens;
|
unsigned char hide_empty_tokens;
|
||||||
|
Loading…
Reference in New Issue
Block a user