diff options
Diffstat (limited to 'sm/call-agent.c')
-rw-r--r-- | sm/call-agent.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c index 5facd6990..6952e22f7 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -273,7 +273,7 @@ inq_ciphertext_cb (void *opaque, const char *keyword) the hex string KEYGRIP. */ int gpgsm_agent_pkdecrypt (const char *keygrip, - const char *ciphertext, size_t ciphertextlen, + KsbaConstSexp ciphertext, char **r_buf, size_t *r_buflen ) { int rc; @@ -282,11 +282,16 @@ gpgsm_agent_pkdecrypt (const char *keygrip, struct cipher_parm_s cipher_parm; size_t n, len; char *buf, *endp; + size_t ciphertextlen; if (!keygrip || strlen(keygrip) != 40 || !ciphertext || !r_buf || !r_buflen) return GNUPG_Invalid_Value; *r_buf = NULL; + ciphertextlen = gcry_sexp_canon_len (ciphertext, 0, NULL, NULL); + if (!ciphertextlen) + return GNUPG_Invalid_Value; + rc = start_agent (); if (rc) return rc; |