Merge pull request #498 from frankmorgner/pkcs11
fixed segfault for uninitialized IsoApplet
This commit is contained in:
commit
d7496cc3b4
|
@ -202,6 +202,10 @@ app default {
|
||||||
#
|
#
|
||||||
# flags = "rng", "0x80000000";
|
# flags = "rng", "0x80000000";
|
||||||
|
|
||||||
|
# Enable pkcs11 initialization.
|
||||||
|
# Default: no
|
||||||
|
# pkcs11_enable_InitToken = yes;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Context: PKCS#15 emulation layer
|
# Context: PKCS#15 emulation layer
|
||||||
#
|
#
|
||||||
|
|
|
@ -202,6 +202,10 @@ app default {
|
||||||
#
|
#
|
||||||
# flags = "rng", "0x80000000";
|
# flags = "rng", "0x80000000";
|
||||||
|
|
||||||
|
# Enable pkcs11 initialization.
|
||||||
|
# Default: no
|
||||||
|
# pkcs11_enable_InitToken = yes;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Context: PKCS#15 emulation layer
|
# Context: PKCS#15 emulation layer
|
||||||
#
|
#
|
||||||
|
|
|
@ -582,7 +582,8 @@ CK_RV C_InitToken(CK_SLOT_ID slotID,
|
||||||
goto out;
|
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");
|
sc_log(context, "C_InitToken() not supported by framework");
|
||||||
rv = CKR_FUNCTION_NOT_SUPPORTED;
|
rv = CKR_FUNCTION_NOT_SUPPORTED;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -345,7 +345,8 @@ card_detect_all(void)
|
||||||
} else {
|
} else {
|
||||||
if (!reader_get_slot(reader))
|
if (!reader_get_slot(reader))
|
||||||
initialize_reader(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");
|
sc_log(context, "All cards detected");
|
||||||
|
|
Loading…
Reference in New Issue