mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
common: New put_membuf_cb to replace static membuf_data_cb.
* common/membuf.c (put_membuf_cb): New. * agent/call-scd.c (membuf_data_cb): Remove. Change callers to use put_membuf_cb. * common/get-passphrase.c (membuf_data_cb): Ditto. * g10/call-agent.c (membuf_data_cb): Ditto. * sm/call-agent.c (membuf_data_cb): Ditto. -- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
8fd406c317
commit
833ba5faa1
6 changed files with 41 additions and 73 deletions
|
@ -130,17 +130,6 @@ default_inq_cb (void *opaque, const char *line)
|
|||
}
|
||||
|
||||
|
||||
static gpg_error_t
|
||||
membuf_data_cb (void *opaque, const void *buffer, size_t length)
|
||||
{
|
||||
membuf_t *data = opaque;
|
||||
|
||||
if (buffer)
|
||||
put_membuf (data, buffer, length);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Ask for a passphrase via gpg-agent. On success the caller needs to
|
||||
free the string stored at R_PASSPHRASE. On error NULL will be
|
||||
stored at R_PASSPHRASE and an appropriate gpg error code is
|
||||
|
@ -214,7 +203,7 @@ gnupg_get_passphrase (const char *cache_id,
|
|||
else
|
||||
init_membuf (&data, 64);
|
||||
err = assuan_transact (agent_ctx, line,
|
||||
membuf_data_cb, &data,
|
||||
put_membuf_cb, &data,
|
||||
default_inq_cb, NULL, NULL, NULL);
|
||||
|
||||
/* Older Pinentries return the old assuan error code for canceled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue