- Applied a patch by Matthias Bruestle <m@mbsks.franken.de>:

- Changed the case of GET RESPONSE in card-default.c to 2 short
- Added ATRs to Flex, GPK and TCOS drivers
- Changed value of maximum Lc in card.c to be 255


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@600 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
jey 2002-05-09 10:22:42 +00:00
parent f5c2f1a5c8
commit 03d58e7956
5 changed files with 25 additions and 7 deletions

View File

@ -52,11 +52,13 @@ static int autodetect_class(struct sc_card *card)
if (card->ctx->debug >= 2)
debug(card->ctx, "trying with 0x%02X\n", classes[i]);
apdu.cla = classes[i];
apdu.cse = SC_APDU_CASE_1;
apdu.cse = SC_APDU_CASE_2_SHORT;
apdu.ins = 0xC0;
apdu.p1 = apdu.p2 = 0;
apdu.datalen = 0;
apdu.lc = apdu.le = 0;
apdu.lc = 0;
apdu.le = 256;
apdu.resplen = sizeof(rbuf);
r = sc_transmit_apdu(card, &apdu);
SC_TEST_RET(card->ctx, r, "APDU transmit failed");
if (apdu.sw1 == 0x6E)

View File

@ -24,9 +24,21 @@
#include <string.h>
static const char *flex_atrs[] = {
"3B:95:94:40:FF:63:01:01:02:01", /* Cryptoflex 16k */
"3B:85:40:20:68:01:01:05:01", /* Cryptoflex 8k */
"3B:95:94:40:FF:63:01:01:02:01", /* Cryptoflex 16k */
"3B:85:40:20:68:01:01:05:01", /* Cryptoflex 8k */
"3B:19:14:55:90:01:02:02:00:05:04:B0",
"3B:02:14:50", /* Multiflex 3K */
"3B:19:14:55:90:01:02:01:00:05:04:B0", /* Multiflex 4K */
"3B:32:15:00:06:80", /* Multiflex 8K */
"3B:32:15:00:06:95", /* Multiflex 8K + full DES option */
"3B:19:14:59:01:01:0F:01:00:05:08:B0", /* Multiflex 8K */
"3B:19:14:55:90:01:01:01:00:05:08:B0", /* Multiflex 8K */
"3B:E2:00:00:40:20:49:06", /* Cryptoflex */
"3B:E2:00:00:40:20:49:05", /* Cryptoflex + full DES option */
"3B:E2:00:00:40:20:49:07", /* Cryptoflex + Key Generation */
"3B:85:40:20:68:01:01:03:05", /* Cryptoflex + Key Generation */
"3B:16:94:81:10:06:01:81:3F", /* Cyberflex Access Crypto */
"3B:16:94:81:10:06:01:81:2F", /* Cyberflex Access Aug. Crypto */
NULL
};

View File

@ -103,6 +103,8 @@ static struct atrinfo {
{ "\x3B\x27\x00\x80\x65\xA2\x05\x01\x01\x37", 10, GPK4000_sp },
{ "\x3B\x27\x00\x80\x65\xA2\x0C\x01\x01\x37", 10, GPK4000_su256 },
{ "\x3B\xA7\x00\x40\x14\x80\x65\xA2\x14\x01\x01\x37", 12, GPK4000_sdo },
{ "\x3B\xA7\x00\x40\x18\x80\x65\xA2\x08\x01\x01\x52", 12, GPK8000_8K },
{ "\x3B\xA7\x00\x40\x18\x80\x65\xA2\x09\x01\x01\x52", 12, GPK8000_16K },
{ "", 0, -1 }
};

View File

@ -23,7 +23,9 @@
#include <string.h>
static const char *tcos_atrs[] = {
"3B:BA:96:00:81:31:86:5D:00:64:05:60:02:03:31:80:90:00:66",
"3B:BA:13:00:81:31:86:5D:00:64:05:0A:02:01:31:80:90:00:8B", /* SLE44 */
"3B:BA:14:00:81:31:86:5D:00:64:05:14:02:02:31:80:90:00:91", /* SLE66S */
"3B:BA:96:00:81:31:86:5D:00:64:05:60:02:03:31:80:90:00:66", /* SLE66P */
NULL
};

View File

@ -37,8 +37,8 @@ static int sc_check_apdu(struct sc_context *ctx, const struct sc_apdu *apdu)
error(ctx, "Value of Le too big (maximum 256 bytes)\n");
SC_FUNC_RETURN(ctx, 4, SC_ERROR_INVALID_ARGUMENTS);
}
if (apdu->lc > 256) {
error(ctx, "Value of Lc too big (maximum 256 bytes)\n");
if (apdu->lc > 255) {
error(ctx, "Value of Lc too big (maximum 255 bytes)\n");
SC_FUNC_RETURN(ctx, 4, SC_ERROR_INVALID_ARGUMENTS);
}
switch (apdu->cse) {