1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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>
This commit is contained in:
Werner Koch 2019-06-17 14:35:21 +02:00
parent 479c2775d5
commit 70f7b26287
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 36 additions and 13 deletions

View file

@ -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)