diff options
author | Werner Koch <[email protected]> | 2024-08-05 14:19:32 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-08-05 14:19:32 +0000 |
commit | a8cef7ebc2b8c3aa1477b61fecfaa8e5d63446d7 (patch) | |
tree | 9075b0342a709f8b08471f007eee7b5410fff03e /scd/command.c | |
parent | scd: New getinfo subcommand "dump_state". (diff) | |
download | gnupg-a8cef7ebc2b8c3aa1477b61fecfaa8e5d63446d7.tar.gz gnupg-a8cef7ebc2b8c3aa1477b61fecfaa8e5d63446d7.zip |
scd: New getinfo subcommand "manufacturer"
* scd/command.c (cmd_getinfo): Add subcommand "manufacturer".
* scd/app-openpgp.c (get_manufacturer): Rename to ...
(app_openpgp_manufacturer): this and make global.
--
Example:
$ gpg-connect-agent 'scd getinfo manufacturer 42' /bye
D Magrathea
OK
Diffstat (limited to 'scd/command.c')
-rw-r--r-- | scd/command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scd/command.c b/scd/command.c index b607523dd..b386b9c5f 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1878,6 +1878,8 @@ static const char hlp_getinfo[] = " cmd_has_option CMD OPT\n" " - Returns OK if command CMD has option OPT.\n" " dump_state - Dump internal infos to the log stream.\n" + " manufacturer NUMBER\n" + " - Return a description of the OpenPGP manufacturer id.\n" " apdu_strerror NUMBER\n" " - Return a string for a status word.\n"; static gpg_error_t @@ -2004,6 +2006,12 @@ cmd_getinfo (assuan_context_t ctx, char *line) { rc = app_send_active_apps (NULL, ctrl); } + else if ((s=has_leading_keyword (line, "manufacturer"))) + { + unsigned long ul = strtoul (s, NULL, 0); + s = app_openpgp_manufacturer (ul); + rc = assuan_send_data (ctx, s, strlen (s)); + } else if ((s=has_leading_keyword (line, "apdu_strerror"))) { unsigned long ul = strtoul (s, NULL, 0); |