diff options
author | Neal H. Walfield <[email protected]> | 2015-08-24 14:14:09 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2015-08-24 14:14:38 +0000 |
commit | 348a6ebb63523305ce9f47d0f3e8a9086c338fed (patch) | |
tree | 62cbe9ac5cbe9105299f2d31d01fc2778104a13b /agent/genkey.c | |
parent | sm: Support secret key export via the Assuan interface. (diff) | |
download | gnupg-348a6ebb63523305ce9f47d0f3e8a9086c338fed.tar.gz gnupg-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 <[email protected]>.
GnuPG-bug-id: 2038
Diffstat (limited to 'agent/genkey.c')
-rw-r--r-- | agent/genkey.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/agent/genkey.c b/agent/genkey.c index af53c60ad..13858cae3 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -374,13 +374,13 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, return err; } - pi = gcry_calloc_secure (2, sizeof (*pi) + 100); - pi2 = pi + (sizeof *pi + 100); - pi->max_length = 100; + pi = gcry_calloc_secure (2, sizeof (*pi) + MAX_PASSPHRASE_LEN + 1); + pi2 = pi + (sizeof *pi + MAX_PASSPHRASE_LEN + 1); + pi->max_length = MAX_PASSPHRASE_LEN + 1; pi->max_tries = 3; pi->with_qualitybar = 1; pi->with_repeat = 1; - pi2->max_length = 100; + pi2->max_length = MAX_PASSPHRASE_LEN + 1; pi2->max_tries = 3; pi2->check_cb = reenter_compare_cb; pi2->check_cb_arg = pi->pin; |