opensc-explorer/opensc-tool: Allow extended APDUs

This commit is contained in:
Frank Morgner 2017-11-24 14:13:55 +01:00
parent d0d9b974a7
commit 6f37229303
2 changed files with 6 additions and 6 deletions

View File

@ -1530,14 +1530,14 @@ static int do_erase(int argc, char **argv)
static int do_random(int argc, char **argv)
{
unsigned char buffer[256];
unsigned char buffer[SC_MAX_EXT_APDU_BUFFER_SIZE];
int r, count;
if (argc != 1)
return usage(do_random);
count = atoi(argv[0]);
if (count < 0 || count > 256) {
if (count < 0 || (size_t) count > sizeof buffer) {
printf("Number must be in range 0..256\n");
return -1;
}
@ -1625,8 +1625,8 @@ static int do_put_data(int argc, char **argv)
static int do_apdu(int argc, char **argv)
{
sc_apdu_t apdu;
u8 buf[SC_MAX_APDU_BUFFER_SIZE * 2];
u8 rbuf[SC_MAX_APDU_BUFFER_SIZE * 2];
u8 buf[SC_MAX_EXT_APDU_BUFFER_SIZE * 2];
u8 rbuf[SC_MAX_EXT_APDU_BUFFER_SIZE];
size_t len, i;
int r;

View File

@ -498,8 +498,8 @@ static int list_files(void)
static int send_apdu(void)
{
sc_apdu_t apdu;
u8 buf[SC_MAX_APDU_BUFFER_SIZE],
rbuf[SC_MAX_APDU_BUFFER_SIZE];
u8 buf[SC_MAX_EXT_APDU_BUFFER_SIZE],
rbuf[SC_MAX_EXT_APDU_BUFFER_SIZE];
size_t len0, r;
int c;