mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Handle pinentry-mode=loopback.
When this mode is set an inquire will be sent to the client to retrieve the passphrase. This adds a new inquire keyword "NEW_PASSPHRASE" that the GENKEY and PASSWD commands use when generating a new key.
This commit is contained in:
parent
bea3b7c93f
commit
fb1cdd7b0e
5 changed files with 83 additions and 2 deletions
|
@ -2731,3 +2731,18 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
|
|||
xfree (ctrl->server_local);
|
||||
ctrl->server_local = NULL;
|
||||
}
|
||||
|
||||
|
||||
gpg_error_t
|
||||
pinentry_loopback(ctrl_t ctrl, const char *keyword,
|
||||
unsigned char **buffer, size_t *size,
|
||||
size_t max_length)
|
||||
{
|
||||
gpg_error_t rc;
|
||||
assuan_context_t ctx = ctrl->server_local->assuan_ctx;
|
||||
|
||||
assuan_begin_confidential (ctx);
|
||||
rc = assuan_inquire (ctx, keyword, buffer, size, max_length);
|
||||
assuan_end_confidential (ctx);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue