1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

card: New command "apdu"

* tools/card-call-scd.c (scd_apdu): Add optional arg 'options'.
* tools/gpg-card.c (cmd_apdu): New.
(enum cmdids): Add cmdAPDU.
(dispatch_command): Add command "apdu".
(interactive_loop): Ditto.
--

This command is hidden because it can be used to brick a card.  The
command is basically the same as sending "scd apdu" in
gpg-connect-agent but here we do full decoding and printing in hex.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-05-28 13:00:27 +02:00
parent 94d31660c6
commit ed0759f39b
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 108 additions and 9 deletions

View file

@ -88,7 +88,7 @@ send_apdu (const char *hexapdu, const char *desc, unsigned int ignore,
gpg_error_t err;
unsigned int sw;
err = scd_apdu (hexapdu, &sw, r_data, r_datalen);
err = scd_apdu (hexapdu, NULL, &sw, r_data, r_datalen);
if (err)
log_error ("sending card command %s failed: %s\n", desc,
gpg_strerror (err));