diff options
author | Werner Koch <wk@gnupg.org> | 2019-02-26 16:42:50 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-02-26 17:01:46 +0100 |
commit | c2235d994dbb1d7ddba20f89a7c02f4a27b0610c (patch) | |
tree | 655f49c9a3436d6047f30234c7b85c36bbe18a21 /scd/app-common.h | |
parent | conf: New option --show-socket. (diff) | |
download | gnupg2-c2235d994dbb1d7ddba20f89a7c02f4a27b0610c.tar.xz gnupg2-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 <wk@gnupg.org>
Diffstat (limited to 'scd/app-common.h')
-rw-r--r-- | scd/app-common.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scd/app-common.h b/scd/app-common.h index e9d167ecc..97274a7cb 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -71,7 +71,7 @@ struct app_ctx_s { gpg_error_t (*learn_status) (app_t app, ctrl_t ctrl, unsigned int flags); gpg_error_t (*readcert) (app_t app, const char *certid, unsigned char **cert, size_t *certlen); - gpg_error_t (*readkey) (app_t app, int advanced, const char *certid, + gpg_error_t (*readkey) (app_t app, const char *certid, unsigned char **pk, size_t *pklen); gpg_error_t (*getattr) (app_t app, ctrl_t ctrl, const char *name); gpg_error_t (*setattr) (app_t app, const char *name, @@ -123,6 +123,8 @@ struct app_ctx_s { /*-- app-help.c --*/ unsigned int app_help_count_bits (const unsigned char *a, size_t len); gpg_error_t app_help_get_keygrip_string (ksba_cert_t cert, char *hexkeygrip); +gpg_error_t app_help_pubkey_from_cert (const void *cert, size_t certlen, + unsigned char **r_pk, size_t *r_pklen); size_t app_help_read_length_of_cert (int slot, int fid, size_t *r_certoff); @@ -144,7 +146,7 @@ gpg_error_t app_write_learn_status (app_t app, ctrl_t ctrl, unsigned int flags); gpg_error_t app_readcert (app_t app, ctrl_t ctrl, const char *certid, unsigned char **cert, size_t *certlen); -gpg_error_t app_readkey (app_t app, ctrl_t ctrl, int advanced, +gpg_error_t app_readkey (app_t app, ctrl_t ctrl, const char *keyid, unsigned char **pk, size_t *pklen); gpg_error_t app_getattr (app_t app, ctrl_t ctrl, const char *name); gpg_error_t app_setattr (app_t app, ctrl_t ctrl, const char *name, |