fixed bugs due to new version of opensc

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@517 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-09-02 13:48:17 +00:00
parent a0cc017ae6
commit 59b8a9b0da
3 changed files with 16 additions and 3 deletions

View File

@@ -111,11 +111,17 @@ detect_card_presence(void)
if (sc_result == 0
&& card) {
sc_disconnect_card(card);
/* FIXME recent OpenSC versions throw an error when disconnecting an
* obsolete card handle
sc_disconnect_card(card); */
card = NULL;
sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "Card removed");
}
if (sc_result & SC_READER_CARD_CHANGED) {
sc_disconnect_card(card);
/* FIXME recent OpenSC versions throw an error when disconnecting an
* obsolete card handle
sc_disconnect_card(card); */
card = NULL;
sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "Card exchanged");
}
if (sc_result & SC_READER_CARD_PRESENT
@@ -852,6 +858,9 @@ perform_PC_to_RDR_Secure_EstablishPACEChannel(sc_card_t *card,
goto err;
}
bin_log(ctx, SC_LOG_DEBUG_VERBOSE, "EstablishPACEChannel InBuffer",
abData, abDatalen);
if (abDatalen < parsed+1) {
sc_debug(ctx, SC_LOG_DEBUG_VERBOSE, "Buffer too small, could not get PinID");
sc_result = SC_ERROR_INVALID_ARGUMENTS;