[git] GnuPG - branch, master, updated. gnupg-2.2.7-389-ga12c3a5
by Werner Koch
cvs at cvs.gnupg.org
Mon Feb 25 08:26:14 CET 2019
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 "The GNU Privacy Guard".
The branch, master has been updated
via a12c3a566e2e4b10bc02976a2819070877ee895c (commit)
from e140c6d4f581be1a60a34b67b16430452f3987e8 (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 a12c3a566e2e4b10bc02976a2819070877ee895c
Author: Werner Koch <wk at gnupg.org>
Date: Fri Feb 22 14:09:02 2019 +0100
agent: Fix for suggested Libgcrypt use.
* agent/divert-scd.c (divert_pkdecrypt): Skip a flags parameter.
--
The libgcrypt docs say that a "flags" parameter should always be used
in the input of pkdecrypt. Thus we should allow that parameter also
when parsing an s-expression to figure out the algorithm for use with
scdaemon.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index b978154..02fe529 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -498,6 +498,7 @@ divert_pkdecrypt (ctrl_t ctrl, const char *desc_text,
char *kid;
const unsigned char *s;
size_t n;
+ int depth;
const unsigned char *ciphertext;
size_t ciphertextlen;
char *plaintext;
@@ -506,7 +507,6 @@ divert_pkdecrypt (ctrl_t ctrl, const char *desc_text,
(void)desc_text;
*r_padding = -1;
-
s = cipher;
if (*s != '(')
return gpg_error (GPG_ERR_INV_SEXP);
@@ -522,6 +522,21 @@ divert_pkdecrypt (ctrl_t ctrl, const char *desc_text,
n = snext (&s);
if (!n)
return gpg_error (GPG_ERR_INV_SEXP);
+
+ /* First check whether we have a flags parameter and skip it. */
+ if (smatch (&s, n, "flags"))
+ {
+ depth = 1;
+ if (sskip (&s, &depth) || depth)
+ return gpg_error (GPG_ERR_INV_SEXP);
+ if (*s != '(')
+ return gpg_error (GPG_ERR_INV_SEXP);
+ s++;
+ n = snext (&s);
+ if (!n)
+ return gpg_error (GPG_ERR_INV_SEXP);
+ }
+
if (smatch (&s, n, "rsa"))
{
if (*s != '(')
-----------------------------------------------------------------------
Summary of changes:
agent/divert-scd.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list