From 3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 5 Jul 2017 11:54:45 +0200 Subject: agent: Use MAX_PASSPHRASE_LEN (255) also for the loopback. * agent/call-pinentry.c (agent_get_passphrase): Reduce maximum passphrase length as conveyed to the loopback to MAX_PASSPHRASE_LEN. * agent/genkey.c (agent_ask_new_passphrase): Extend the maximum passphrase as conveyed to the loopback to MAX_PASSPHRASE_LEN. -- Note that in genkey() max_length is set to MAX_PASSPHRASE_LEN + 1 because in agent_askpin() decrements that value before conveying it to the loopback. GnuPG-bug-id: 3254 Signed-off-by: Werner Koch --- agent/genkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'agent/genkey.c') diff --git a/agent/genkey.c b/agent/genkey.c index 31742a13c..a3e37ee3a 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -357,10 +357,10 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK) { size_t size; - size_t len = 100; unsigned char *buffer; - err = pinentry_loopback(ctrl, "NEW_PASSPHRASE", &buffer, &size, len); + err = pinentry_loopback (ctrl, "NEW_PASSPHRASE", &buffer, &size, + MAX_PASSPHRASE_LEN); if (!err) { if (size) -- cgit v1.2.3