summaryrefslogtreecommitdiffstats
path: root/agent/cvt-openpgp.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2015-08-24 16:14:09 +0200
committerNeal H. Walfield <neal@g10code.com>2015-08-24 16:14:38 +0200
commit348a6ebb63523305ce9f47d0f3e8a9086c338fed (patch)
tree62cbe9ac5cbe9105299f2d31d01fc2778104a13b /agent/cvt-openpgp.c
parentsm: Support secret key export via the Assuan interface. (diff)
downloadgnupg2-348a6ebb63523305ce9f47d0f3e8a9086c338fed.tar.xz
gnupg2-348a6ebb63523305ce9f47d0f3e8a9086c338fed.zip
agent: Raise the maximum password length. Don't hard code it.
* agent/agent.h (MAX_PASSPHRASE_LEN): Define. * agent/command-ssh.c (ssh_identity_register): Use it instead of a hard-coded literal. * agent/cvt-openpgp.c (convert_from_openpgp_main): Likewise. * agent/findkey.c (unprotect): Likewise. * agent/genkey.c (agent_ask_new_passphrase): Likewise. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>. GnuPG-bug-id: 2038
Diffstat (limited to 'agent/cvt-openpgp.c')
-rw-r--r--agent/cvt-openpgp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c
index 8bf587342..6d2221015 100644
--- a/agent/cvt-openpgp.c
+++ b/agent/cvt-openpgp.c
@@ -918,10 +918,10 @@ convert_from_openpgp_main (ctrl_t ctrl, gcry_sexp_t s_pgp,
struct pin_entry_info_s *pi;
struct try_do_unprotect_arg_s pi_arg;
- pi = xtrycalloc_secure (1, sizeof (*pi) + 100);
+ pi = xtrycalloc_secure (1, sizeof (*pi) + MAX_PASSPHRASE_LEN + 1);
if (!pi)
return gpg_error_from_syserror ();
- pi->max_length = 100;
+ pi->max_length = MAX_PASSPHRASE_LEN + 1;
pi->min_digits = 0; /* We want a real passphrase. */
pi->max_digits = 16;
pi->max_tries = 3;