Merge pull request #498 from frankmorgner/pkcs11

fixed segfault for uninitialized IsoApplet
This commit is contained in:
Frank Morgner 2015-07-31 15:35:08 +02:00
commit d7496cc3b4
4 changed files with 12 additions and 2 deletions

View File

@ -202,6 +202,10 @@ app default {
#
# flags = "rng", "0x80000000";
# Enable pkcs11 initialization.
# Default: no
# pkcs11_enable_InitToken = yes;
#
# Context: PKCS#15 emulation layer
#

View File

@ -202,6 +202,10 @@ app default {
#
# flags = "rng", "0x80000000";
# Enable pkcs11 initialization.
# Default: no
# pkcs11_enable_InitToken = yes;
#
# Context: PKCS#15 emulation layer
#

View File

@ -582,7 +582,8 @@ CK_RV C_InitToken(CK_SLOT_ID slotID,
goto out;
}
if (slot->p11card->framework->init_token == NULL) {
if (!slot->p11card || !slot->p11card->framework
|| !slot->p11card->framework->init_token) {
sc_log(context, "C_InitToken() not supported by framework");
rv = CKR_FUNCTION_NOT_SUPPORTED;
goto out;

View File

@ -345,7 +345,8 @@ card_detect_all(void)
} else {
if (!reader_get_slot(reader))
initialize_reader(reader);
card_detect(sc_ctx_get_reader(context, i));
else
card_detect(sc_ctx_get_reader(context, i));
}
}
sc_log(context, "All cards detected");