aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-09-09 11:18:08 +0000
committerWerner Koch <[email protected]>2005-09-09 11:18:08 +0000
commit6f90f05cb2181bc4ab64959c0f3590f48c9c39c6 (patch)
tree595c7f2ad2326035701634d3ac968f615b4eb031 /scd/app-openpgp.c
parentThe BELPIC card does now work. (diff)
downloadgnupg-6f90f05cb2181bc4ab64959c0f3590f48c9c39c6.tar.gz
gnupg-6f90f05cb2181bc4ab64959c0f3590f48c9c39c6.zip
Bug fixes and ssh support for the BELPIC.
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index bd56fb99d..5625c729b 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -696,6 +696,8 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
{ "PRIVATE-DO-2", 0x0102 },
{ "PRIVATE-DO-3", 0x0103 },
{ "PRIVATE-DO-4", 0x0104 },
+ { "$AUTHKEYID", 0x0000, -3 },
+ { "$DISPSERIALNO",0x0000, -4 },
{ NULL, 0 }
};
int idx, i, rc;
@@ -742,6 +744,29 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0);
return 0;
}
+ if (table[idx].special == -3)
+ {
+ char const tmp[] = "OPENPGP.3";
+ send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0);
+ return 0;
+ }
+ if (table[idx].special == -4)
+ {
+ char *serial;
+ time_t stamp;
+
+ if (!app_get_serial_and_stamp (app, &serial, &stamp))
+ {
+ if (strlen (serial) > 16+12)
+ {
+ send_status_info (ctrl, table[idx].name, serial+16, 12, NULL, 0);
+ xfree (serial);
+ return 0;
+ }
+ xfree (serial);
+ }
+ return gpg_error (GPG_ERR_INV_NAME);
+ }
relptr = get_one_do (app, table[idx].tag, &value, &valuelen, &rc);
if (relptr)
@@ -2203,7 +2228,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
fingerprint delimited by a slash. Optionally the id OPENPGP.3 may
be given.
- Note that this fucntion may return the error code
+ Note that this function may return the error code
GPG_ERR_WRONG_CARD to indicate that the card currently present does
not match the one required for the requested action (e.g. the
serial number does not match). */