diff options
author | Werner Koch <[email protected]> | 2003-10-08 15:21:20 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-10-08 15:21:20 +0000 |
commit | 72c648c0352cff27ac91e4e02f47e510711b7442 (patch) | |
tree | f0025e23ed0cc6558e6f310219d8b98baeb5b09c /g10/app-openpgp.c | |
parent | (tty_print_string, tty_print_utf8_string2) (diff) | |
download | gnupg-72c648c0352cff27ac91e4e02f47e510711b7442.tar.gz gnupg-72c648c0352cff27ac91e4e02f47e510711b7442.zip |
* cardglue.c (pin_cb): Detect whether an admin or regular PIN is
requested.
(genkey_status_cb): New.
(agent_scd_genkey): Implemented.
* keygen.c (generate_keypair): New arg CARD_SERIALNO and prepare
parameters for on card key generation. Changed all callers.
(do_generate_keypair): Add new arg card and merged casrd specific
changes from 1.9.
(proc_parameter_file): New arg card, apss it down to
do_generate_keypair and changed all callers.
(gen_card_key): New.
* g10.c: Include cardclue.h.
(main): s/app_set_default_reader_port/card_set_reader_port/.
* cardglue.c (card_set_reader_port): New to address include file
issues.
Diffstat (limited to 'g10/app-openpgp.c')
-rw-r--r-- | g10/app-openpgp.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/g10/app-openpgp.c b/g10/app-openpgp.c index e8fe19ea1..174d2e974 100644 --- a/g10/app-openpgp.c +++ b/g10/app-openpgp.c @@ -425,6 +425,8 @@ do_getattr (APP app, CTRL ctrl, const char *name) { "CA-FPR", 0x00C6, 3 }, { "CHV-STATUS", 0x00C4, 1 }, { "SIG-COUNTER", 0x0093, 2 }, + { "SERIALNO", 0x004F, -1 }, + { "AID", 0x004F }, { NULL, 0 } }; int idx, i; @@ -437,6 +439,29 @@ do_getattr (APP app, CTRL ctrl, const char *name) if (!table[idx].name) return gpg_error (GPG_ERR_INV_NAME); + if (table[idx].special == -1) + { + /* The serial number is very special. We could have used the + AID DO to retrieve it, but we have it already in the app + context and the stanmp argument is required anyway which we + can't by other means. The AID DO is available anyway but not + hex formatted. */ + char *serial; + time_t stamp; + char tmp[50]; + + if (!app_get_serial_and_stamp (app, &serial, &stamp)) + { + sprintf (tmp, "%lu", (unsigned long)stamp); + send_status_info (ctrl, "SERIALNO", + serial, strlen (serial), + tmp, strlen (tmp), + NULL, 0); + xfree (serial); + } + return 0; + } + relptr = get_one_do (app->slot, table[idx].tag, &value, &valuelen); if (relptr) { |