mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
* Always use 'dynload.h' instead of 'dlfcn.h'.
This commit is contained in:
parent
f099ed75b8
commit
abbb66e037
@ -1,3 +1,9 @@
|
|||||||
|
2003-08-14 Timo Schulz <twoaday@freakmail.de>
|
||||||
|
|
||||||
|
* apdu.c (ct_activate_card): Change the code a little to avoid
|
||||||
|
problems with other readers.
|
||||||
|
* Always use 'dynload.h' instead of 'dlfcn.h'.
|
||||||
|
|
||||||
2003-08-05 Werner Koch <wk@gnupg.org>
|
2003-08-05 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
|
* app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
|
||||||
|
57
scd/apdu.c
57
scd/apdu.c
@ -23,11 +23,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
|
#include "dynload.h"
|
||||||
|
|
||||||
#define MAX_READER 4 /* Number of readers we support concurrently. */
|
#define MAX_READER 4 /* Number of readers we support concurrently. */
|
||||||
#define CARD_CONNECT_TIMEOUT 1 /* Number of seconds to wait for
|
#define CARD_CONNECT_TIMEOUT 1 /* Number of seconds to wait for
|
||||||
@ -232,40 +232,37 @@ ct_activate_card (int reader)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf[0] == 0x05)
|
/* Connected, now activate the card. */
|
||||||
{ /* Connected, now activate the card. */
|
dad[0] = 1; /* Destination address: CT. */
|
||||||
dad[0] = 1; /* Destination address: CT. */
|
sad[0] = 2; /* Source address: Host. */
|
||||||
sad[0] = 2; /* Source address: Host. */
|
|
||||||
|
|
||||||
cmd[0] = 0x20; /* Class byte. */
|
cmd[0] = 0x20; /* Class byte. */
|
||||||
cmd[1] = 0x12; /* Request ICC. */
|
cmd[1] = 0x12; /* Request ICC. */
|
||||||
cmd[2] = 0x01; /* From first interface. */
|
cmd[2] = 0x01; /* From first interface. */
|
||||||
cmd[3] = 0x01; /* Return card's ATR. */
|
cmd[3] = 0x01; /* Return card's ATR. */
|
||||||
cmd[4] = 0x00;
|
cmd[4] = 0x00;
|
||||||
|
|
||||||
buflen = DIM(buf);
|
buflen = DIM(buf);
|
||||||
|
|
||||||
rc = CT_data (reader, dad, sad, 5, cmd, &buflen, buf);
|
rc = CT_data (reader, dad, sad, 5, cmd, &buflen, buf);
|
||||||
if (rc || buflen < 2 || buf[buflen-2] != 0x90)
|
if (rc || buflen < 2 || buf[buflen-2] != 0x90)
|
||||||
{
|
{
|
||||||
log_error ("ct_activate_card(%d): activation failed: %s\n",
|
log_error ("ct_activate_card(%d): activation failed: %s\n",
|
||||||
reader, ct_error_string (rc));
|
reader, ct_error_string (rc));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
/* Store the type and the ATR. */
|
|
||||||
if (buflen - 2 > DIM (reader_table[0].atr))
|
|
||||||
{
|
|
||||||
log_error ("ct_activate_card(%d): ATR too long\n", reader);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
reader_table[reader].status = buf[buflen - 1];
|
|
||||||
memcpy (reader_table[reader].atr, buf, buflen - 2);
|
|
||||||
reader_table[reader].atrlen = buflen - 2;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Store the type and the ATR. */
|
||||||
|
if (buflen - 2 > DIM (reader_table[0].atr))
|
||||||
|
{
|
||||||
|
log_error ("ct_activate_card(%d): ATR too long\n", reader);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
reader_table[reader].status = buf[buflen - 1];
|
||||||
|
memcpy (reader_table[reader].atr, buf, buflen - 2);
|
||||||
|
reader_table[reader].atrlen = buflen - 2;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info ("ct_activate_card(%d): timeout waiting for card\n", reader);
|
log_info ("ct_activate_card(%d): timeout waiting for card\n", reader);
|
||||||
|
@ -23,12 +23,13 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include "app-common.h"
|
#include "app-common.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
#include "iso7816.h"
|
#include "iso7816.h"
|
||||||
|
#include "dynload.h"
|
||||||
|
|
||||||
static char *default_reader_port;
|
static char *default_reader_port;
|
||||||
|
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
#include "atr.h"
|
#include "atr.h"
|
||||||
|
#include "dynload.h"
|
||||||
|
|
||||||
static int const fi_table[16] = { 0, 372, 558, 744, 1116,1488, 1860, -1,
|
static int const fi_table[16] = { 0, 372, 558, 744, 1116,1488, 1860, -1,
|
||||||
-1, 512, 768, 1024, 1536, 2048, -1, -1 };
|
-1, 512, 768, 1024, 1536, 2048, -1, -1 };
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include "iso7816.h"
|
#include "iso7816.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
|
#include "dynload.h"
|
||||||
|
|
||||||
#define CMD_SELECT_FILE 0xA4
|
#define CMD_SELECT_FILE 0xA4
|
||||||
#define CMD_VERIFY 0x20
|
#define CMD_VERIFY 0x20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user