mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
agent,tests,w32: Fix relaying pinentry user data, fix fake-pinentry.
* agent/call-pinentry.c (start_pinentry): Also send the user data using an Assuan 'OPTION' command. * tests/openpgp/fake-pinentry.c (get_passphrase): Fix updating passphrase file. (spacep): Include newline characters. (rstrip): New function. (main): Handle Windows line endings. Handle the userdata option, and restart with the new options. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
f88f11a256
commit
852b8f0b89
2 changed files with 71 additions and 7 deletions
|
@ -354,6 +354,19 @@ start_pinentry (ctrl_t ctrl)
|
|||
if (DBG_IPC)
|
||||
log_debug ("connection to PIN entry established\n");
|
||||
|
||||
value = session_env_getenv (ctrl->session_env, "PINENTRY_USER_DATA");
|
||||
if (value != NULL)
|
||||
{
|
||||
char *optstr;
|
||||
if (asprintf (&optstr, "OPTION pinentry-user-data=%s", value) < 0 )
|
||||
return unlock_pinentry (out_of_core ());
|
||||
rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL);
|
||||
xfree (optstr);
|
||||
if (rc && gpg_err_code (rc) != GPG_ERR_UNKNOWN_OPTION)
|
||||
return unlock_pinentry (rc);
|
||||
}
|
||||
|
||||
rc = assuan_transact (entry_ctx,
|
||||
opt.no_grab? "OPTION no-grab":"OPTION grab",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue