diff options
author | Werner Koch <[email protected]> | 2021-04-21 19:03:57 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-04-21 19:04:09 +0000 |
commit | 2fce99d73a6afc1a1a29041722a934bb81c7d739 (patch) | |
tree | 4a5cfa162fde56773727b6cdb2d0bd5c6a5b2d28 /tools/card-call-scd.c | |
parent | agent: Silence error messages for READKEY --card (diff) | |
download | gnupg-2fce99d73a6afc1a1a29041722a934bb81c7d739.tar.gz gnupg-2fce99d73a6afc1a1a29041722a934bb81c7d739.zip |
card: New option --shadow for command list.
* tools/card-call-scd.c (scd_readkey): Add arg create_shadow.
* tools/gpg-card.c (list_one_kinfo): Add arg create_shadow and pass it
down to scd-readkey. Change all callers to convey this arg.
(cmd_list): Add option --shadow.
Diffstat (limited to 'tools/card-call-scd.c')
-rw-r--r-- | tools/card-call-scd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/card-call-scd.c b/tools/card-call-scd.c index 086503b1c..27d8ad961 100644 --- a/tools/card-call-scd.c +++ b/tools/card-call-scd.c @@ -1511,9 +1511,10 @@ scd_readcert (const char *certidstr, void **r_buf, size_t *r_buflen) /* Send a READKEY command to the SCdaemon. On success a new - * s-expression is stored at R_RESULT. */ + * s-expression is stored at R_RESULT. If CREATE_SHADOW is set stub + * keys will be created if they do not exist. */ gpg_error_t -scd_readkey (const char *keyrefstr, gcry_sexp_t *r_result) +scd_readkey (const char *keyrefstr, int create_shadow, gcry_sexp_t *r_result) { gpg_error_t err; char line[ASSUAN_LINELENGTH]; @@ -1527,7 +1528,10 @@ scd_readkey (const char *keyrefstr, gcry_sexp_t *r_result) return err; init_membuf (&data, 1024); - snprintf (line, DIM(line), "SCD READKEY %s", keyrefstr); + if (create_shadow) + snprintf (line, DIM(line), "READKEY --card -- %s", keyrefstr); + else + snprintf (line, DIM(line), "SCD READKEY %s", keyrefstr); err = assuan_transact (agent_ctx, line, put_membuf_cb, &data, NULL, NULL, |