agent: Use MAX_PASSPHRASE_LEN (255) also for the loopback.
authorWerner Koch <wk@gnupg.org>
Wed, 5 Jul 2017 09:54:45 +0000 (11:54 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 5 Jul 2017 09:54:45 +0000 (11:54 +0200)
commit3681ee7dc1e9d8c94fdb046d7be0bbcfeba1cfe9
treee25e94157833e514bd0e35769646c60889b73185
parent139de02b93773615bdd95e04a7f0c1ad73b4f6fb
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 <wk@gnupg.org>
agent/call-pinentry.c
agent/genkey.c