scd: Add --demand option for SERIALNO.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 16 Jan 2017 01:26:16 +0000 (10:26 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 16 Jan 2017 01:26:16 +0000 (10:26 +0900)
commit2e6f1c99d4f66a23a752092397e20a84964edf48
treea8fcfb4e5fd4fd05de790fcbe2aa808c66d9c7e7
parent3db76c9277d918dec9721a6439f4db3b3c06aba3
scd: Add --demand option for SERIALNO.

* scd/app.c (select_application): Add SERIALNO_BIN and SERIALNO_BIN_LEN
arguments.  Return matched APP with a serial number when specified.
* scd/command.c (open_card): Modify for the implicit open only.
(open_card_with_request): New for explicit open and support match with a
serial number.
(cmd_serialno): Support --demand option.
(cmd_learn, cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkauth)
(cmd_pkdecrypt, cmd_getattr, cmd_setattr, cmd_writecert, cmd_writekey)
(cmd_genkey, cmd_random, cmd_passwd, cmd_checkpin, cmd_apdu): Follow
the change of open_card.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/app-common.h
scd/app.c
scd/command.c