aboutsummaryrefslogtreecommitdiffstats
path: root/agent/genkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-07-05 09:54:45 +0000
committerWerner Koch <[email protected]>2017-07-05 09:54:45 +0000
commit3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9 (patch)
treee25e94157833e514bd0e35769646c60889b73185 /agent/genkey.c
parentdoc: Update yat2m to take care of SOURCE_DATE_EPOCH. (diff)
downloadgnupg-3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9.tar.gz
gnupg-3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9.zip
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 <[email protected]>
Diffstat (limited to 'agent/genkey.c')
-rw-r--r--agent/genkey.c4
1 files changed, 2 insertions, 2 deletions
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)