diff options
author | Werner Koch <wk@gnupg.org> | 2019-06-17 14:35:21 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-06-17 14:35:21 +0200 |
commit | 70f7b262877b1e751d8557dc04a09a420e9d8a8f (patch) | |
tree | 76037c7364eeb515ed129767d06c4ef82c38baf7 /scd/app.c | |
parent | scd: Use the correct gpg for the v1.0 OpenPGP card hack. (diff) | |
download | gnupg2-70f7b262877b1e751d8557dc04a09a420e9d8a8f.tar.xz gnupg2-70f7b262877b1e751d8557dc04a09a420e9d8a8f.zip |
scd: Slight change to app->fnc.do_with_keygrip.
* scd/app-openpgp.c (do_with_keygrip): Return a real error code to
avoid misinterpretation of the result. Also fix the case for a too
small buffer.
--
The only real chnage is the case for a too small buffer. That should
in general never happen but if so we now return an error instead of
success.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'scd/app.c')
-rw-r--r-- | scd/app.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -1292,9 +1292,27 @@ app_send_card_list (ctrl_t ctrl) } /* Execute an action for each app. ACTION can be one of: - KEYGRIP_ACTION_SEND_DATA: send data if KEYGRIP_STR matches - KEYGRIP_ACTION_WRITE_STATUS: write status if KEYGRIP_STR matches - KEYGRIP_ACTION_LOOKUP: Return matching APP + * + * - KEYGRIP_ACTION_SEND_DATA + * + * If KEYGRIP_STR matches a public key of any active application + * send information as LF terminated data lines about the public + * key. The format of these lines is + * <keygrip> T <serialno> <idstr> + * If a match was found a pointer to the matching application is + * returned. With the KEYGRIP_STR given as NULL, lines for all + * keys will be send and the return value is NULL. + * + * - KEYGRIP_ACTION_WRITE_STATUS + * + * Same as KEYGRIP_ACTION_SEND_DATA but uses status lines instead + * of data lines. + * + * - KEYGRIP_ACTION_LOOKUP + * + * Returns a pointer to the application matching KEYGRIP_STR but + * does not emit any status or data lines. If no key with that + * keygrip is available or KEYGRIP_STR is NULL, NULL is returned. */ app_t app_do_with_keygrip (ctrl_t ctrl, int action, const char *keygrip_str) |