diff options
author | Werner Koch <[email protected]> | 2017-07-05 09:54:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-07-05 09:54:45 +0000 |
commit | 3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9 (patch) | |
tree | e25e94157833e514bd0e35769646c60889b73185 /agent/call-pinentry.c | |
parent | doc: Update yat2m to take care of SOURCE_DATE_EPOCH. (diff) | |
download | gnupg-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/call-pinentry.c')
-rw-r--r-- | agent/call-pinentry.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 9d8e7f63e..cb7997faa 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -964,8 +964,8 @@ agent_askpin (ctrl_t ctrl, size_t size; *pininfo->pin = 0; /* Reset the PIN. */ - rc = pinentry_loopback(ctrl, "PASSPHRASE", &passphrase, &size, - pininfo->max_length - 1); + rc = pinentry_loopback (ctrl, "PASSPHRASE", &passphrase, &size, + pininfo->max_length - 1); if (rc) return rc; @@ -1192,10 +1192,10 @@ agent_get_passphrase (ctrl_t ctrl, if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK) { size_t size; - size_t len = ASSUAN_LINELENGTH/2; return pinentry_loopback (ctrl, "PASSPHRASE", - (unsigned char **)retpass, &size, len); + (unsigned char **)retpass, &size, + MAX_PASSPHRASE_LEN); } return gpg_error (GPG_ERR_NO_PIN_ENTRY); } |