diff options
author | NIIBE Yutaka <[email protected]> | 2022-05-20 04:43:08 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-05-20 04:43:08 +0000 |
commit | 6a37240cf279b27cddcc88de93098c55f3f26701 (patch) | |
tree | 88914046b1b56d7695528b883f81e1eef9829ff8 /agent/agent.h | |
parent | agent: Pop up dialog window for confirmation, when specified so. (diff) | |
download | gnupg-6a37240cf279b27cddcc88de93098c55f3f26701.tar.gz gnupg-6a37240cf279b27cddcc88de93098c55f3f26701.zip |
agent: Move confirmation handling into findkey.c.
* agent/agent.h (divert_tpm2_pksign, divert_tpm2_pkdecrypt): Fix API.
(divert_pksign, divert_pkdecrypt): Likewise.
* agent/divert-scd.c (ask_for_card): Remove.
(divert_pksign, divert_pkdecrypt): Don't call ask_for_card.
* agent/divert-tpm2.c (divert_tpm2_pksign, divert_tpm2_pkdecrypt):
Remove DESC_TEXT argument.
* agent/findkey.c (prompt_for_card): New (was: ask_for_card).
(agent_key_from_file): Call prompt_for_card when it's a key
on card.
* agent/pkdecrypt.c (agent_pkdecrypt): Follow the change of API.
* agent/pksign.c (agent_pksign_do): Likewise.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'agent/agent.h')
-rw-r--r-- | agent/agent.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/agent/agent.h b/agent/agent.h index 4ee8e40c5..f1c9b83b6 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -593,11 +593,11 @@ void agent_reload_trustlist (void); /*-- divert-tpm2.c --*/ #ifdef HAVE_LIBTSS -int divert_tpm2_pksign (ctrl_t ctrl, const char *desc_text, +int divert_tpm2_pksign (ctrl_t ctrl, const unsigned char *digest, size_t digestlen, int algo, const unsigned char *shadow_info, unsigned char **r_sig, size_t *r_siglen); -int divert_tpm2_pkdecrypt (ctrl_t ctrl, const char *desc_text, +int divert_tpm2_pkdecrypt (ctrl_t ctrl, const unsigned char *cipher, const unsigned char *shadow_info, char **r_buf, size_t *r_len, int *r_padding); @@ -605,25 +605,25 @@ int divert_tpm2_writekey (ctrl_t ctrl, const unsigned char *grip, gcry_sexp_t s_skey); #else /*!HAVE_LIBTSS*/ static inline int -divert_tpm2_pksign (ctrl_t ctrl, const char *desc_text, +divert_tpm2_pksign (ctrl_t ctrl, const unsigned char *digest, size_t digestlen, int algo, const unsigned char *shadow_info, unsigned char **r_sig, size_t *r_siglen) { - (void)ctrl; (void)desc_text; (void)digest; (void)digestlen; + (void)ctrl; (void)digest; (void)digestlen; (void)algo; (void)shadow_info; (void)r_sig; (void)r_siglen; return gpg_error (GPG_ERR_NOT_SUPPORTED); } static inline int -divert_tpm2_pkdecrypt (ctrl_t ctrl, const char *desc_text, +divert_tpm2_pkdecrypt (ctrl_t ctrl, const unsigned char *cipher, const unsigned char *shadow_info, char **r_buf, size_t *r_len, int *r_padding) { - (void)ctrl; (void)desc_text; (void)cipher; (void)shadow_info; + (void)ctrl; (void)cipher; (void)shadow_info; (void)r_buf; (void)r_len; (void)r_padding; return gpg_error (GPG_ERR_NOT_SUPPORTED); } @@ -639,15 +639,14 @@ divert_tpm2_writekey (ctrl_t ctrl, const unsigned char *grip, /*-- divert-scd.c --*/ -int divert_pksign (ctrl_t ctrl, const char *desc_text, +int divert_pksign (ctrl_t ctrl, const unsigned char *grip, const unsigned char *digest, size_t digestlen, int algo, - const unsigned char *shadow_info, unsigned char **r_sig, + unsigned char **r_sig, size_t *r_siglen); -int divert_pkdecrypt (ctrl_t ctrl, const char *desc_text, +int divert_pkdecrypt (ctrl_t ctrl, const unsigned char *grip, const unsigned char *cipher, - const unsigned char *shadow_info, char **r_buf, size_t *r_len, int *r_padding); int divert_generic_cmd (ctrl_t ctrl, const char *cmdline, void *assuan_context); |