Convert newlines to unix style, remove compiler warnings.

git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3826 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2009-11-13 11:10:44 +00:00
parent 3ea5bb7987
commit 684e9b20ba
1 changed files with 73 additions and 73 deletions

View File

@ -25,19 +25,19 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#define LOAD_KEY_MODULUS 0x80 #define LOAD_KEY_MODULUS 0x80
#define LOAD_KEY_PUBLIC_EXPONENT 0x81 #define LOAD_KEY_PUBLIC_EXPONENT 0x81
#define LOAD_KEY_PRIME_P 0x83 #define LOAD_KEY_PRIME_P 0x83
#define LOAD_KEY_PRIME_Q 0x84 #define LOAD_KEY_PRIME_Q 0x84
#define LOAD_KEY_DP1 0x85 #define LOAD_KEY_DP1 0x85
#define LOAD_KEY_DQ1 0x86 #define LOAD_KEY_DQ1 0x86
#define LOAD_KEY_INVQ 0x87 #define LOAD_KEY_INVQ 0x87
static struct sc_card_operations myeid_ops; static struct sc_card_operations myeid_ops;
static struct sc_card_driver myeid_drv = { static struct sc_card_driver myeid_drv = {
"MyEID cards with PKCS#15 applet", "MyEID cards with PKCS#15 applet",
"myeid", "myeid",
&myeid_ops &myeid_ops
}; };
static const char *myeid_atrs[] = { static const char *myeid_atrs[] = {
@ -89,7 +89,7 @@ static int myeid_init(struct sc_card *card)
/* State that we have an RNG */ /* State that we have an RNG */
card->caps |= SC_CARD_CAP_RNG; card->caps |= SC_CARD_CAP_RNG;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
return 0; return 0;
} }
@ -104,9 +104,9 @@ static int acl_to_byte(const struct sc_acl_entry *e)
case SC_AC_TERM: case SC_AC_TERM:
case SC_AC_AUT: case SC_AC_AUT:
if (e->key_ref == SC_AC_KEY_REF_NONE) if (e->key_ref == SC_AC_KEY_REF_NONE)
return 0x00; return 0x00;
if (e->key_ref < 1 || e->key_ref > 14) if (e->key_ref < 1 || e->key_ref > 14)
return 0x00; return 0x00;
return e->key_ref; return e->key_ref;
case SC_AC_NEVER: case SC_AC_NEVER:
return 0x0F; return 0x0F;
@ -179,26 +179,26 @@ static int myeid_select_file(struct sc_card *card, const struct sc_path *in_path
struct sc_file **file) struct sc_file **file)
{ {
int r; int r;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
r = iso_ops->select_file(card, in_path, file); r = iso_ops->select_file(card, in_path, file);
if (r == 0 && file != NULL) { if (r == 0 && file != NULL) {
parse_sec_attr(*file, (*file)->sec_attr, (*file)->sec_attr_len); parse_sec_attr(*file, (*file)->sec_attr, (*file)->sec_attr_len);
} }
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
static int myeid_read_binary(struct sc_card *card, unsigned int idx, static int myeid_read_binary(struct sc_card *card, unsigned int idx,
u8 * buf, size_t count, unsigned long flags) u8 * buf, size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, iso_ops->read_binary(card, idx, buf, count, flags)); SC_FUNC_RETURN(card->ctx, 1, iso_ops->read_binary(card, idx, buf, count, flags));
} }
static int myeid_list_files(struct sc_card *card, u8 *buf, size_t buflen) static int myeid_list_files(struct sc_card *card, u8 *buf, size_t buflen)
{ {
struct sc_apdu apdu; struct sc_apdu apdu;
int r,i; int r;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
@ -222,10 +222,10 @@ static int myeid_process_fci(struct sc_card *card, struct sc_file *file,
const u8 *tag = NULL; const u8 *tag = NULL;
int r ; int r ;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
r = iso_ops->process_fci(card, file, buf, buflen); r = iso_ops->process_fci(card, file, buf, buflen);
if (r < 0) if (r < 0)
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
if(file->type == SC_FILE_EF_UNKNOWN) if(file->type == SC_FILE_EF_UNKNOWN)
{ {
@ -241,17 +241,17 @@ static int myeid_process_fci(struct sc_card *card, struct sc_file *file,
file->sec_attr[0],file->sec_attr[1],file->sec_attr[2]); file->sec_attr[0],file->sec_attr[1],file->sec_attr[2]);
} }
SC_FUNC_RETURN(card->ctx, 1, 0); SC_FUNC_RETURN(card->ctx, 1, 0);
} }
static int encode_file_structure(sc_card_t *card, const sc_file_t *file, static int encode_file_structure(sc_card_t *card, const sc_file_t *file,
u8 *out, size_t *outlen) u8 *out, size_t *outlen)
{ {
const sc_acl_entry_t *read, *update, *delete; const sc_acl_entry_t *read, *update, *delete;
u8 buf[40]; u8 buf[40];
int i; int i;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
/* PrivateKey /* PrivateKey
* 0E0000019 6217 81020400 820111 83024B01 8603000000 85028000 8A0100 RESULT 6984 * 0E0000019 6217 81020400 820111 83024B01 8603000000 85028000 8A0100 RESULT 6984
* 6217 81020400 820111 83024B01 8603000000 85021000 8A0100 */ * 6217 81020400 820111 83024B01 8603000000 85021000 8A0100 */
@ -290,38 +290,38 @@ static int encode_file_structure(sc_card_t *card, const sc_file_t *file,
buf[17] = file->sec_attr[2]; buf[17] = file->sec_attr[2];
sc_debug(card->ctx, "id (%X), sec_attr %X %X %X\n", file->id, sc_debug(card->ctx, "id (%X), sec_attr %X %X %X\n", file->id,
file->sec_attr[0],file->sec_attr[1],file->sec_attr[2]); file->sec_attr[0],file->sec_attr[1],file->sec_attr[2]);
} }
else else
{ {
delete = sc_file_get_acl_entry(file, SC_AC_OP_DELETE); delete = sc_file_get_acl_entry(file, SC_AC_OP_DELETE);
switch (file->type) { switch (file->type) {
case SC_FILE_TYPE_WORKING_EF: case SC_FILE_TYPE_WORKING_EF:
read = sc_file_get_acl_entry(file, SC_AC_OP_READ); read = sc_file_get_acl_entry(file, SC_AC_OP_READ);
update = sc_file_get_acl_entry(file, SC_AC_OP_UPDATE); update = sc_file_get_acl_entry(file, SC_AC_OP_UPDATE);
buf[15] = (acl_to_byte(read) << 4) | acl_to_byte(update); buf[15] = (acl_to_byte(read) << 4) | acl_to_byte(update);
buf[16] = (acl_to_byte(delete)<< 4) | 0x0F; buf[16] = (acl_to_byte(delete)<< 4) | 0x0F;
break; break;
case SC_FILE_TYPE_INTERNAL_EF: case SC_FILE_TYPE_INTERNAL_EF:
read = sc_file_get_acl_entry(file, SC_AC_OP_CRYPTO); read = sc_file_get_acl_entry(file, SC_AC_OP_CRYPTO);
update = sc_file_get_acl_entry(file, SC_AC_OP_UPDATE); update = sc_file_get_acl_entry(file, SC_AC_OP_UPDATE);
buf[15] = (acl_to_byte(read) << 4) | acl_to_byte(update); buf[15] = (acl_to_byte(read) << 4) | acl_to_byte(update);
buf[16] = (acl_to_byte(delete)<< 4) | 0x0F; buf[16] = (acl_to_byte(delete)<< 4) | 0x0F;
break; break;
case SC_FILE_TYPE_DF: case SC_FILE_TYPE_DF:
update = sc_file_get_acl_entry(file, SC_AC_OP_CREATE); update = sc_file_get_acl_entry(file, SC_AC_OP_CREATE);
buf[15] = (acl_to_byte(update) << 4) | acl_to_byte(update); buf[15] = (acl_to_byte(update) << 4) | acl_to_byte(update);
buf[16] = (acl_to_byte(delete) << 4) | 0x0F; buf[16] = (acl_to_byte(delete) << 4) | 0x0F;
break; break;
default: default:
break; break;
} }
} }
@ -352,10 +352,10 @@ static int encode_file_structure(sc_card_t *card, const sc_file_t *file,
{ {
buf[25] = 0x84; buf[25] = 0x84;
buf[26] = (u8)file->namelen; buf[26] = (u8)file->namelen;
for(i=0;i < (int)file->namelen;i++) for(i=0;i < (int)file->namelen;i++)
buf[i + 26] = file->name[i]; buf[i + 26] = file->name[i];
buf[1] = 0x19 + file->namelen + 2; buf[1] = 0x19 + file->namelen + 2;
} }
break; break;
@ -367,7 +367,7 @@ static int encode_file_structure(sc_card_t *card, const sc_file_t *file,
*outlen = buf[1]+2; *outlen = buf[1]+2;
memcpy(out, buf, *outlen); memcpy(out, buf, *outlen);
SC_FUNC_RETURN(card->ctx, 1, 0); SC_FUNC_RETURN(card->ctx, 1, 0);
} }
static int myeid_create_file(struct sc_card *card, struct sc_file *file) static int myeid_create_file(struct sc_card *card, struct sc_file *file)
@ -378,7 +378,7 @@ static int myeid_create_file(struct sc_card *card, struct sc_file *file)
int r; int r;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
r = encode_file_structure(card, file, sbuf, &buflen); r = encode_file_structure(card, file, sbuf, &buflen);
if (r) if (r)
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
@ -392,9 +392,9 @@ static int myeid_create_file(struct sc_card *card, struct sc_file *file)
SC_TEST_RET(card->ctx, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, r, "APDU transmit failed");
if (apdu.sw1 == 0x6A && apdu.sw2 == 0x89) if (apdu.sw1 == 0x6A && apdu.sw2 == 0x89)
SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_FILE_ALREADY_EXISTS); SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_FILE_ALREADY_EXISTS);
r = sc_check_sw(card, apdu.sw1, apdu.sw2); r = sc_check_sw(card, apdu.sw1, apdu.sw2);
SC_TEST_RET(card->ctx, r, "Card returned error"); SC_FUNC_RETURN(card->ctx, r, "Card returned error");
} }
/* no record oriented file services */ /* no record oriented file services */
@ -402,37 +402,37 @@ static int myeid_read_record_unsupp(struct sc_card *card, unsigned int rec_nr,
u8 *buf, size_t count, unsigned long flags) u8 *buf, size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED); SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED);
} }
static int myeid_wrupd_record_unsupp(struct sc_card *card, unsigned int rec_nr, static int myeid_wrupd_record_unsupp(struct sc_card *card, unsigned int rec_nr,
const u8 *buf, size_t count, unsigned long flags) const u8 *buf, size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED); SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED);
} }
static int myeid_append_record_unsupp(struct sc_card *card, const u8 *buf, static int myeid_append_record_unsupp(struct sc_card *card, const u8 *buf,
size_t count, unsigned long flags) size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED); SC_FUNC_RETURN(card->ctx, 1, SC_ERROR_NOT_SUPPORTED);
} }
static int myeid_write_binary(struct sc_card *card, unsigned int idx, static int myeid_write_binary(struct sc_card *card, unsigned int idx,
const u8 *buf, size_t count, unsigned long flags) const u8 *buf, size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, iso_ops->write_binary(card, idx, buf, count, flags)); SC_FUNC_RETURN(card->ctx, 1, iso_ops->write_binary(card, idx, buf, count, flags));
} }
static int myeid_update_binary(struct sc_card *card, unsigned int idx, static int myeid_update_binary(struct sc_card *card, unsigned int idx,
const u8 *buf, size_t count, unsigned long flags) const u8 *buf, size_t count, unsigned long flags)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, iso_ops->update_binary(card, idx, buf, count, flags)); SC_FUNC_RETURN(card->ctx, 1, iso_ops->update_binary(card, idx, buf, count, flags));
} }
static int myeid_delete_file(struct sc_card *card, const struct sc_path *path) static int myeid_delete_file(struct sc_card *card, const struct sc_path *path)
@ -455,7 +455,7 @@ static int myeid_delete_file(struct sc_card *card, const struct sc_path *path)
r = sc_transmit_apdu(card, &apdu); r = sc_transmit_apdu(card, &apdu);
SC_TEST_RET(card->ctx, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, r, "APDU transmit failed");
SC_FUNC_RETURN(card->ctx, 1, sc_check_sw(card, apdu.sw1, apdu.sw2)); SC_FUNC_RETURN(card->ctx, 1, sc_check_sw(card, apdu.sw1, apdu.sw2));
} }
static int myeid_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, static int myeid_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
@ -481,7 +481,7 @@ static int myeid_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
} }
SC_FUNC_RETURN(card->ctx, 1, iso_ops->pin_cmd(card, data, tries_left)); SC_FUNC_RETURN(card->ctx, 1, iso_ops->pin_cmd(card, data, tries_left));
} }
static int myeid_set_security_env2(sc_card_t *card, const sc_security_env_t *env, static int myeid_set_security_env2(sc_card_t *card, const sc_security_env_t *env,
int se_num) int se_num)
@ -492,7 +492,7 @@ static int myeid_set_security_env2(sc_card_t *card, const sc_security_env_t *env
int r, locked = 0; int r, locked = 0;
assert(card != NULL && env != NULL); assert(card != NULL && env != NULL);
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
if (env->flags & SC_SEC_ENV_KEY_REF_ASYMMETRIC) if (env->flags & SC_SEC_ENV_KEY_REF_ASYMMETRIC)
{ {
@ -575,14 +575,14 @@ static int myeid_set_security_env2(sc_card_t *card, const sc_security_env_t *env
err: err:
if (locked) if (locked)
sc_unlock(card); sc_unlock(card);
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
static int myeid_set_security_env(struct sc_card *card, static int myeid_set_security_env(struct sc_card *card,
const struct sc_security_env *env, int se_num) const struct sc_security_env *env, int se_num)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
if (env->flags & SC_SEC_ENV_ALG_PRESENT) if (env->flags & SC_SEC_ENV_ALG_PRESENT)
{ {
sc_security_env_t tmp; sc_security_env_t tmp;
@ -617,7 +617,7 @@ static int myeid_compute_signature(struct sc_card *card, const u8 * data,
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
assert(card != NULL && data != NULL && out != NULL); assert(card != NULL && data != NULL && out != NULL);
if (datalen > 256) if (datalen > 256)
SC_FUNC_RETURN(card->ctx, 4, SC_ERROR_INVALID_ARGUMENTS); SC_FUNC_RETURN(card->ctx, 4, SC_ERROR_INVALID_ARGUMENTS);
@ -667,7 +667,7 @@ static int myeid_decipher(struct sc_card *card, const u8 * crgram,
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
assert(card != NULL && crgram != NULL && out != NULL); assert(card != NULL && crgram != NULL && out != NULL);
SC_FUNC_CALLED(card->ctx, 2); SC_FUNC_CALLED(card->ctx, 2);
if (crgram_len > 256) if (crgram_len > 256)
@ -810,7 +810,7 @@ static int myeid_loadkey(sc_card_t *card, int mode, u8* value, int value_len)
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
int r, len; int r, len;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
len = 0; len = 0;
if(value_len == 0 || value == NULL) if(value_len == 0 || value == NULL)
return 0; return 0;
@ -881,9 +881,9 @@ static int myeid_generate_store_key(struct sc_card *card,
{ {
struct sc_apdu apdu; struct sc_apdu apdu;
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
int r=0,len; int r=0,len;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
/* Setup key-generation paramters */ /* Setup key-generation paramters */
if (data->op_type == OP_TYPE_GENERATE) if (data->op_type == OP_TYPE_GENERATE)
{ {
@ -926,10 +926,10 @@ static int myeid_generate_store_key(struct sc_card *card,
data->mod, data->mod_len)) >= 0 && data->mod, data->mod_len)) >= 0 &&
(r=myeid_loadkey(card, LOAD_KEY_PUBLIC_EXPONENT, (r=myeid_loadkey(card, LOAD_KEY_PUBLIC_EXPONENT,
data->pubexp, data->pubexp_len)) >= 0) data->pubexp, data->pubexp_len)) >= 0)
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
static int myeid_activate_card(struct sc_card *card) static int myeid_activate_card(struct sc_card *card)
@ -938,7 +938,7 @@ static int myeid_activate_card(struct sc_card *card)
u8 sbuf[] ="\xA0\x00\x00\x00\x63\x50\x4B\x43\x53\x2D\x31\x35"; u8 sbuf[] ="\xA0\x00\x00\x00\x63\x50\x4B\x43\x53\x2D\x31\x35";
sc_apdu_t apdu; sc_apdu_t apdu;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0x44, 0x04, 0x00); sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0x44, 0x04, 0x00);
apdu.cla = 0x00; apdu.cla = 0x00;
apdu.data = sbuf; apdu.data = sbuf;
@ -960,7 +960,7 @@ static int myeid_get_serialnr(sc_card_t *card, sc_serial_number_t *serial)
sc_apdu_t apdu; sc_apdu_t apdu;
u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xca, 0x01, 0xA0); sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xca, 0x01, 0xA0);
apdu.resp = rbuf; apdu.resp = rbuf;
apdu.resplen = sizeof(rbuf); apdu.resplen = sizeof(rbuf);
@ -985,27 +985,27 @@ static int myeid_get_serialnr(sc_card_t *card, sc_serial_number_t *serial)
/* copy and return serial number */ /* copy and return serial number */
memcpy(serial, &card->serialnr, sizeof(*serial)); memcpy(serial, &card->serialnr, sizeof(*serial));
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
static int myeid_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr) static int myeid_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr)
{ {
int r = SC_ERROR_NOT_SUPPORTED; int r = SC_ERROR_NOT_SUPPORTED;
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
switch(cmd) { switch(cmd) {
case SC_CARDCTL_MYEID_PUTDATA: case SC_CARDCTL_MYEID_PUTDATA:
r = myeid_putdata(card, r = myeid_putdata(card,
(struct sc_cardctl_myeid_data_obj*) ptr); (struct sc_cardctl_myeid_data_obj*) ptr);
break; break;
case SC_CARDCTL_MYEID_GETDATA: case SC_CARDCTL_MYEID_GETDATA:
r = myeid_getdata(card, r = myeid_getdata(card,
(struct sc_cardctl_myeid_data_obj*) ptr); (struct sc_cardctl_myeid_data_obj*) ptr);
break; break;
case SC_CARDCTL_MYEID_GENERATE_KEY: case SC_CARDCTL_MYEID_GENERATE_KEY:
r = myeid_generate_store_key(card, r = myeid_generate_store_key(card,
(struct sc_cardctl_myeid_gen_store_key_info *) ptr); (struct sc_cardctl_myeid_gen_store_key_info *) ptr);
break; break;
case SC_CARDCTL_MYEID_ACTIVATE_CARD: case SC_CARDCTL_MYEID_ACTIVATE_CARD:
r = myeid_activate_card(card); r = myeid_activate_card(card);
break; break;
@ -1014,9 +1014,9 @@ static int myeid_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr)
break; break;
case SC_CARDCTL_LIFECYCLE_SET: case SC_CARDCTL_LIFECYCLE_SET:
case SC_CARDCTL_LIFECYCLE_GET: case SC_CARDCTL_LIFECYCLE_GET:
break; break;
} }
SC_FUNC_RETURN(card->ctx, 1, r); SC_FUNC_RETURN(card->ctx, 1, r);
} }
/* "The PINs are "global" in a PKCS#15 sense, meaning that they remain valid /* "The PINs are "global" in a PKCS#15 sense, meaning that they remain valid
@ -1026,8 +1026,8 @@ static int myeid_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr)
*/ */
static int myeid_logout(struct sc_card *card) static int myeid_logout(struct sc_card *card)
{ {
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
SC_FUNC_RETURN(card->ctx, 1, 0); SC_FUNC_RETURN(card->ctx, 1, 0);
} }
static struct sc_card_driver * sc_get_driver(void) static struct sc_card_driver * sc_get_driver(void)
@ -1057,7 +1057,7 @@ static struct sc_card_driver * sc_get_driver(void)
myeid_ops.logout = myeid_logout; myeid_ops.logout = myeid_logout;
myeid_ops.process_fci = myeid_process_fci; myeid_ops.process_fci = myeid_process_fci;
myeid_ops.card_ctl = myeid_card_ctl; myeid_ops.card_ctl = myeid_card_ctl;
myeid_ops.pin_cmd = myeid_pin_cmd; myeid_ops.pin_cmd = myeid_pin_cmd;
return &myeid_drv; return &myeid_drv;
} }