diff options
| author | Werner Koch <[email protected]> | 2020-02-13 10:45:41 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2020-02-13 10:45:41 +0000 |
| commit | 638526d37fee0a1febac9d29fab384b913819fc9 (patch) | |
| tree | 6edb9353d6704787e63c799bae7f84b65dff7fb9 /agent/agent.h | |
| parent | gpg: Rename the struct card_key_info_s. (diff) | |
| download | gnupg-638526d37fee0a1febac9d29fab384b913819fc9.tar.gz gnupg-638526d37fee0a1febac9d29fab384b913819fc9.zip | |
agent: Allow signing with card key even without a stub key.
* agent/call-scd.c (agent_card_serialno): Allow NULL for R_SERIAL.
(struct readkey_status_parm_s): New.
(readkey_status_cb): New.
(agent_card_readkey): Add optional arg R_KEYREF and change all
callers.
* agent/findkey.c (key_parms_from_sexp): Allow also a "public-key".
* agent/divert-scd.c (ask_for_card): Allow for SHADOW_INFO being NULL.
* agent/pksign.c (agent_pksign_do): Fallback to sign with an on-card
if there is no stub key yet. Create the stub key. Also fixed a
misnaming between s_pkey and s_skey.
--
This change allows to create OpenPGP keys directly from a card without
first making sure that a stub key exists. It is also the less
surprising behaviour.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/agent.h')
| -rw-r--r-- | agent/agent.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/agent.h b/agent/agent.h index f7e96fcff..18d60fb36 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -607,7 +607,8 @@ int agent_card_pkdecrypt (ctrl_t ctrl, char **r_buf, size_t *r_buflen, int *r_padding); int agent_card_readcert (ctrl_t ctrl, const char *id, char **r_buf, size_t *r_buflen); -int agent_card_readkey (ctrl_t ctrl, const char *id, unsigned char **r_buf); +int agent_card_readkey (ctrl_t ctrl, const char *id, + unsigned char **r_buf, char **r_keyref); gpg_error_t agent_card_writekey (ctrl_t ctrl, int force, const char *serialno, const char *keyref, const char *keydata, size_t keydatalen, |
