summaryrefslogtreecommitdiffstats
path: root/scd/iso7816.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2017-03-06 05:39:46 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2017-03-06 05:39:46 +0100
commit0703de01c8fbc417a99ecf8e950fc306b8c8ac9c (patch)
tree01f253d6b5c5ddea32c9ac744602bad4b27116f0 /scd/iso7816.c
parentpo: Update Japanese translation. (diff)
downloadgnupg2-0703de01c8fbc417a99ecf8e950fc306b8c8ac9c.tar.xz
gnupg2-0703de01c8fbc417a99ecf8e950fc306b8c8ac9c.zip
scd: Fix API of select_file/_path.
* scd/iso7816.c (iso7816_select_file, iso7816_select_path): Remove unused arguments. * scd/app-dinsig.c (do_readcert): Follow the change. * scd/app-help.c (app_help_read_length_of_cert): Likewise. * scd/app-nks.c (keygripstr_from_pk_file, do_readcert, do_readkey) (switch_application): Likewise. * scd/app-p15.c (select_and_read_binary, select_ef_by_path) (micardo_mse, app_select_p15): Likewise. * scd/app.c (app_new_register): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/iso7816.c')
-rw-r--r--scd/iso7816.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c
index 6cfa6b6c9..8f796981f 100644
--- a/scd/iso7816.c
+++ b/scd/iso7816.c
@@ -138,8 +138,7 @@ iso7816_select_application (int slot, const char *aid, size_t aidlen,
gpg_error_t
-iso7816_select_file (int slot, int tag, int is_dir,
- unsigned char **result, size_t *resultlen)
+iso7816_select_file (int slot, int tag, int is_dir)
{
int sw, p0, p1;
unsigned char tagbuf[2];
@@ -147,41 +146,22 @@ iso7816_select_file (int slot, int tag, int is_dir,
tagbuf[0] = (tag >> 8) & 0xff;
tagbuf[1] = tag & 0xff;
- if (result || resultlen)
- {
- *result = NULL;
- *resultlen = 0;
- return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- }
- else
- {
- p0 = (tag == 0x3F00)? 0: is_dir? 1:2;
- p1 = 0x0c; /* No FC return. */
- sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE,
- p0, p1, 2, (char*)tagbuf );
- return map_sw (sw);
- }
-
- return 0;
+ p0 = (tag == 0x3F00)? 0: is_dir? 1:2;
+ p1 = 0x0c; /* No FC return. */
+ sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE,
+ p0, p1, 2, (char*)tagbuf );
+ return map_sw (sw);
}
/* Do a select file command with a direct path. */
gpg_error_t
-iso7816_select_path (int slot, const unsigned short *path, size_t pathlen,
- unsigned char **result, size_t *resultlen)
+iso7816_select_path (int slot, const unsigned short *path, size_t pathlen)
{
int sw, p0, p1;
unsigned char buffer[100];
int buflen;
- if (result || resultlen)
- {
- *result = NULL;
- *resultlen = 0;
- return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- }
-
if (pathlen/2 >= sizeof buffer)
return gpg_error (GPG_ERR_TOO_LARGE);