- Early ccid pinpad cleanups, more to follow
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2098 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
b726ff613b
commit
8182177a00
|
@ -775,13 +775,6 @@ AC_ARG_WITH(prngd-socket,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
dnl pin-pad code for ccid by Martin Paljak <martin@paljak.pri.ee>
|
|
||||||
|
|
||||||
dnl --enable-ccid-pinpad option.
|
|
||||||
AC_ARG_ENABLE(ccid-pinpad,
|
|
||||||
[ --enable-ccid-pinpad enable new pin pad code for ccid readers [default=no]],
|
|
||||||
AC_DEFINE(MP_CCID_PINPAD,1,[Enable new pin pad code for ccid readers]))
|
|
||||||
|
|
||||||
dnl enable/disable logging of sensitive apdu data
|
dnl enable/disable logging of sensitive apdu data
|
||||||
AC_ARG_ENABLE(sensitive-logging,
|
AC_ARG_ENABLE(sensitive-logging,
|
||||||
[ --disable-sensitive-logging disable logging of sensitive APDU data [default=no]],
|
[ --disable-sensitive-logging disable logging of sensitive APDU data [default=no]],
|
||||||
|
|
|
@ -197,7 +197,7 @@ static int sc_transceive(struct sc_card *card, struct sc_apdu *apdu)
|
||||||
else
|
else
|
||||||
/* sensitive information: just print the command
|
/* sensitive information: just print the command
|
||||||
* header and no data */
|
* header and no data */
|
||||||
snprintf(buf, sizeof(buf), "%02x %02x %02x %02x [sensitve data]",
|
snprintf(buf, sizeof(buf), "%02x %02x %02x %02x [sensitive data]",
|
||||||
apdu->cla, apdu->ins, apdu->p1, apdu->p2);
|
apdu->cla, apdu->ins, apdu->p1, apdu->p2);
|
||||||
|
|
||||||
sc_debug(card->ctx, "Sending %d bytes (resp. %d bytes%s):\n%s",
|
sc_debug(card->ctx, "Sending %d bytes (resp. %d bytes%s):\n%s",
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
*
|
*
|
||||||
* (C) 2004 Martin Paljak <martin@paljak.pri.ee>
|
* (C) 2004 Martin Paljak <martin@paljak.pri.ee>
|
||||||
*/
|
*/
|
||||||
#ifdef MP_CCID_PINPAD
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "pinpad-ccid.h"
|
#include "pinpad-ccid.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -152,4 +151,3 @@ ccid_pin_cmd(struct sc_reader *reader, sc_slot_info_t * slot,
|
||||||
/* PIN command completed, all is good */
|
/* PIN command completed, all is good */
|
||||||
return SC_SUCCESS;
|
return SC_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* MP_CCID_PINPAD */
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
* Martin Paljak <martin@paljak.pri.ee>
|
* Martin Paljak <martin@paljak.pri.ee>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef MP_CCID_PINPAD
|
|
||||||
#ifndef _PINPAD_CCID_H
|
#ifndef _PINPAD_CCID_H
|
||||||
#define _PINPAD_CCID_H
|
#define _PINPAD_CCID_H
|
||||||
|
|
||||||
|
@ -29,4 +28,3 @@
|
||||||
int ccid_pin_cmd(struct sc_reader *, sc_slot_info_t *, struct sc_pin_cmd_data *);
|
int ccid_pin_cmd(struct sc_reader *, sc_slot_info_t *, struct sc_pin_cmd_data *);
|
||||||
|
|
||||||
#endif /* _PINPAD_CCID_H */
|
#endif /* _PINPAD_CCID_H */
|
||||||
#endif /* MP_CCID_PINPAD */
|
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#ifdef HAVE_PCSC
|
#ifdef HAVE_PCSC
|
||||||
#include "ctbcs.h"
|
#include "ctbcs.h"
|
||||||
#ifdef MP_CCID_PINPAD
|
|
||||||
#include "pinpad-ccid.h"
|
#include "pinpad-ccid.h"
|
||||||
#endif
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -629,6 +627,16 @@ static int pcsc_finish(struct sc_context *ctx, void *prv_data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
pcsc_pin_cmd(struct sc_reader *reader, sc_slot_info_t * slot, struct sc_pin_cmd_data *data)
|
||||||
|
{
|
||||||
|
#ifdef MP_CCID_PINPAD
|
||||||
|
return ccid_pin_cmd(reader, slot, data);
|
||||||
|
#else
|
||||||
|
return ctbcs_pin_cmd(reader, slot, data);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
struct sc_reader_driver * sc_get_pcsc_driver(void)
|
struct sc_reader_driver * sc_get_pcsc_driver(void)
|
||||||
{
|
{
|
||||||
pcsc_ops.init = pcsc_init;
|
pcsc_ops.init = pcsc_init;
|
||||||
|
@ -640,11 +648,7 @@ struct sc_reader_driver * sc_get_pcsc_driver(void)
|
||||||
pcsc_ops.release = pcsc_release;
|
pcsc_ops.release = pcsc_release;
|
||||||
pcsc_ops.connect = pcsc_connect;
|
pcsc_ops.connect = pcsc_connect;
|
||||||
pcsc_ops.disconnect = pcsc_disconnect;
|
pcsc_ops.disconnect = pcsc_disconnect;
|
||||||
#ifdef MP_CCID_PINPAD
|
pcsc_ops.perform_verify = pcsc_pin_cmd;
|
||||||
pcsc_ops.perform_verify = ccid_pin_cmd;
|
|
||||||
#else
|
|
||||||
pcsc_ops.perform_verify = ctbcs_pin_cmd;
|
|
||||||
#endif
|
|
||||||
pcsc_ops.wait_for_event = pcsc_wait_for_event;
|
pcsc_ops.wait_for_event = pcsc_wait_for_event;
|
||||||
|
|
||||||
return &pcsc_drv;
|
return &pcsc_drv;
|
||||||
|
|
Loading…
Reference in New Issue