diff --git a/scd/app-common.h b/scd/app-common.h index f4035f766..03b6c4884 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -335,6 +335,7 @@ card_t app_do_with_keygrip (ctrl_t ctrl, int action, const char *keygrip_str, /*-- app-openpgp.c --*/ gpg_error_t app_select_openpgp (app_t app); +const char *app_openpgp_manufacturer (unsigned int no); /*-- app-nks.c --*/ gpg_error_t app_select_nks (app_t app); diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 5f3e0c1ec..b2467d05f 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -290,8 +290,8 @@ static gpg_error_t change_keyattr_from_string /* Return the OpenPGP card manufacturer name. */ -static const char * -get_manufacturer (unsigned int no) +const char * +app_openpgp_manufacturer (unsigned int no) { /* Note: Make sure that there is no colon or linefeed in the string. */ switch (no) @@ -1273,7 +1273,7 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name) return send_status_printf (ctrl, table[idx].name, "%u %s", app->app_local->manufacturer, - get_manufacturer (app->app_local->manufacturer)); + app_openpgp_manufacturer (app->app_local->manufacturer)); } if (table[idx].special == -9) { diff --git a/scd/command.c b/scd/command.c index 9d8737572..2a302fbb5 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1875,6 +1875,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 @@ -2001,6 +2003,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);