diff options
author | Werner Koch <wk@gnupg.org> | 2003-10-08 12:46:58 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2003-10-08 12:46:58 +0200 |
commit | 30342b06efcc779b9222513d8dbfb85436ab624c (patch) | |
tree | 2e0aef9b5c20a30dfa1ceb9ce60098a66f37e500 /scd | |
parent | Fixes to make inclusion of card raleted source files into 1.3 easier. (diff) | |
download | gnupg2-30342b06efcc779b9222513d8dbfb85436ab624c.tar.xz gnupg2-30342b06efcc779b9222513d8dbfb85436ab624c.zip |
* call-agent.c (agent_scd_getattr): Don't clear the passed info
structure, so that it can indeed be updated.
* card-util.c (fpr_is_zero): New.
(generate_card_keys): New.
(card_edit): New command "generate".
* keygen.c (generate_keypair): New arg CARD_SERIALNO, removed call
to check_smartcard.
(check_smartcard,show_smartcard): Removed.
(show_sha1_fpr,fpr_is_zero): Removed.
* app-openpgp.c (do_getattr): Support SERIALNO and AID.
Diffstat (limited to 'scd')
-rw-r--r-- | scd/ChangeLog | 4 | ||||
-rw-r--r-- | scd/app-openpgp.c | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index f090e34c0..86068b245 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,7 @@ +2003-10-08 Werner Koch <wk@gnupg.org> + + * app-openpgp.c (do_getattr): Support SERIALNO and AID. + 2003-10-01 Werner Koch <wk@gnupg.org> * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files. diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index e8fe19ea1..174d2e974 100644 --- a/scd/app-openpgp.c +++ b/scd/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) { |