version 1.8, 2001/07/30 16:06:07 |
version 1.9, 2001/07/31 08:41:10 |
|
|
return SCARD_ERROR_FAIL; |
return SCARD_ERROR_FAIL; |
} |
} |
if (! sectok_cardpresent(sc_fd)) { |
if (! sectok_cardpresent(sc_fd)) { |
error("smartcard in reader %d not present, skipping", |
debug("smartcard in reader %d not present, skipping", |
sc_reader_num); |
sc_reader_num); |
return SCARD_ERROR_NOCARD; |
return SCARD_ERROR_NOCARD; |
} |
} |
|
|
sc_get_key(int num) |
sc_get_key(int num) |
{ |
{ |
Key *k; |
Key *k; |
|
int status; |
|
|
sc_reader_num = num; |
sc_reader_num = num; |
k = key_new(KEY_RSA); |
k = key_new(KEY_RSA); |
if (k == NULL) { |
if (k == NULL) { |
return NULL; |
return NULL; |
} |
} |
if (sc_read_pubkey(k) < 0) { |
status = sc_read_pubkey(k); |
|
if (status == SCARD_ERROR_NOCARD) { |
|
key_free(k); |
|
return NULL; |
|
} |
|
if (status < 0 ) { |
error("sc_read_pubkey failed"); |
error("sc_read_pubkey failed"); |
key_free(k); |
key_free(k); |
return NULL; |
return NULL; |