diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2018-10-11 08:41:49 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2018-10-11 08:41:49 +0200 |
commit | 7a5a4c4cac8709f7c413e94cd0b40f4123baa1e5 (patch) | |
tree | e5ee6d0c03e2495bd2c955905e8c83749095efc7 /scd/command.c | |
parent | agent: Support --ack option for POPUPPINPADPROMPT. (diff) | |
download | gnupg2-7a5a4c4cac8709f7c413e94cd0b40f4123baa1e5.tar.xz gnupg2-7a5a4c4cac8709f7c413e94cd0b40f4123baa1e5.zip |
scd: Support "acknowledge button" feature.
* scd/apdu.c (set_prompt_cb): New member function.
(set_prompt_cb_ccid_reader): New function.
(open_ccid_reader): Initialize with set_prompt_cb_ccid_reader.
(apdu_set_prompt_cb): New.
* scd/app.c (lock_app, unlock_app): Add call to apdu_set_prompt_cb.
* ccid-driver.c (ccid_set_prompt_cb): New.
(bulk_in): Call ->prompt_cb when timer extension.
* scd/command.c (popup_prompt): New.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/command.c')
-rw-r--r-- | scd/command.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scd/command.c b/scd/command.c index 66d9fb971..0a9654693 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1898,6 +1898,34 @@ send_status_direct (ctrl_t ctrl, const char *keyword, const char *args) } +void +popup_prompt (void *opaque, int on) +{ + ctrl_t ctrl = opaque; + + if (ctrl) + { + assuan_context_t ctx = ctrl->server_local->assuan_ctx; + + if (ctx) + { + const char *cmd; + gpg_error_t err; + unsigned char *value; + size_t valuelen; + + if (on) + cmd = "POPUPPINPADPROMPT --ack"; + else + cmd = "DISMISSPINPADPROMPT"; + err = assuan_inquire (ctx, cmd, &value, &valuelen, 100); + if (!err) + xfree (value); + } + } +} + + /* Helper to send the clients a status change notification. */ void send_client_notifications (app_t app, int removal) |