[git] GPGME - branch, master, updated. gpgme-1.5.5-11-gccbaccb
by Ben Kibbey
cvs at cvs.gnupg.org
Sun Aug 16 22:14:58 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, master has been updated
via ccbaccbf2e0ba582d181b9ee4d8543d7c1248b2c (commit)
from 70b3e5964ea0592bd09d1877d720b2c63f501970 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ccbaccbf2e0ba582d181b9ee4d8543d7c1248b2c
Author: Ben Kibbey <bjk at luxsci.net>
Date: Sun Aug 16 12:29:41 2015 -0400
Parse INQUIRE_MAXLEN in the passphrase callback.
* src/passphrase.c (_gpgme_passphrase_status_handler): Parse
GPGME_STATUS_INQUIRE_MAXLEN.
* src/passphrase.c (_gpgme_passphrase_command_handler): Send the
INQUIRE_MAXLEN status message.
--
Fixes passing this status message along when decrypting symmetric data
from gpg.
diff --git a/src/passphrase.c b/src/passphrase.c
index 00e9d99..63ab31e 100644
--- a/src/passphrase.c
+++ b/src/passphrase.c
@@ -41,6 +41,7 @@ typedef struct
char *uid_hint;
char *passphrase_info;
int bad_passphrase;
+ char *maxlen;
} *op_data_t;
@@ -53,6 +54,7 @@ release_op_data (void *hook)
free (opd->passphrase_info);
if (opd->uid_hint)
free (opd->uid_hint);
+ free (opd->maxlen);
}
@@ -73,6 +75,11 @@ _gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code,
switch (code)
{
+ case GPGME_STATUS_INQUIRE_MAXLEN:
+ free (opd->maxlen);
+ if (!(opd->maxlen = strdup (args)))
+ return gpg_error_from_syserror ();
+ break;
case GPGME_STATUS_USERID_HINT:
if (opd->uid_hint)
free (opd->uid_hint);
@@ -141,9 +148,14 @@ _gpgme_passphrase_command_handler (void *priv, gpgme_status_code_t code,
if (processed)
*processed = 1;
- err = ctx->passphrase_cb (ctx->passphrase_cb_value,
- opd->uid_hint, opd->passphrase_info,
- opd->bad_passphrase, fd);
+ if (ctx->status_cb && opd->maxlen)
+ err = ctx->status_cb (ctx->status_cb_value, "INQUIRE_MAXLEN",
+ opd->maxlen);
+
+ if (!err)
+ err = ctx->passphrase_cb (ctx->passphrase_cb_value,
+ opd->uid_hint, opd->passphrase_info,
+ opd->bad_passphrase, fd);
/* Reset bad passphrase flag, in case it is correct now. */
opd->bad_passphrase = 0;
-----------------------------------------------------------------------
Summary of changes:
src/passphrase.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list