summaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-06-17 14:35:21 +0200
committerWerner Koch <wk@gnupg.org>2019-06-17 14:35:21 +0200
commit70f7b262877b1e751d8557dc04a09a420e9d8a8f (patch)
tree76037c7364eeb515ed129767d06c4ef82c38baf7 /scd/app.c
parentscd: Use the correct gpg for the v1.0 OpenPGP card hack. (diff)
downloadgnupg2-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.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/scd/app.c b/scd/app.c
index 4fe60cbbb..9640c8015 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -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)