diff options
author | Werner Koch <[email protected]> | 2019-02-26 15:42:50 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-02-26 16:01:46 +0000 |
commit | c2235d994dbb1d7ddba20f89a7c02f4a27b0610c (patch) | |
tree | 655f49c9a3436d6047f30234c7b85c36bbe18a21 /scd/app-piv.c | |
parent | conf: New option --show-socket. (diff) | |
download | gnupg-c2235d994dbb1d7ddba20f89a7c02f4a27b0610c.tar.gz gnupg-c2235d994dbb1d7ddba20f89a7c02f4a27b0610c.zip |
scd: Simplify the app_readkey parameters.
* scd/app-help.c (app_help_pubkey_from_cert): New.
* scd/command.c (cmd_readkey): Refactor to use that new function and
handle the --advanced flag only here.
* scd/app.c (app_readkey): Remove parm advanced.
* scd/app-common.h (struct app_ctx_s): Remove parm advanced from the
readkey member.
* scd/app-nks.c (do_readkey): Adjust for removed parm.
* scd/app-piv.c (do_readkey): Ditto.
* scd/app-openpgp.c (do_readkey): Ditto.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/app-piv.c')
-rw-r--r-- | scd/app-piv.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/scd/app-piv.c b/scd/app-piv.c index 704a498c6..495e26a63 100644 --- a/scd/app-piv.c +++ b/scd/app-piv.c @@ -1418,14 +1418,14 @@ do_readcert (app_t app, const char *certid, * application has been performed. This is because we return a cached * result from key generation. If no cached result is available, the * error GPG_ERR_UNSUPPORTED_OPERATION is returned so that the higher - * layer can then to get the key by reading the matching certificate. + * layer can then get the key by reading the matching certificate. * On success a canonical encoded s-expression with the public key is * stored at (R_PK,R_PKLEN); the caller must release that buffer. On * error R_PK and R_PKLEN are not changed and an error code is * returned. */ static gpg_error_t -do_readkey (app_t app, int advanced, const char *keyrefstr, +do_readkey (app_t app, const char *keyrefstr, unsigned char **r_pk, size_t *r_pklen) { gpg_error_t err; @@ -1471,19 +1471,6 @@ do_readkey (app_t app, int advanced, const char *keyrefstr, err = make_canon_sexp (s_pkey, &pk, &pklen); if (err) goto leave; - if (advanced) - { - /* FIXME: How ugly - we should move that to command.c */ - char *p = canon_sexp_to_string (pk, pklen); - if (!p) - { - err = gpg_error_from_syserror (); - goto leave; - } - xfree (pk); - pk = p; - pklen = strlen (pk); - } *r_pk = pk; pk = NULL; |