diff options
author | NIIBE Yutaka <[email protected]> | 2019-05-21 06:50:28 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-05-21 07:15:41 +0000 |
commit | 6e39541f4f488fe59eac399bad18c465f373a784 (patch) | |
tree | c4f63a27d374ec9180ab98dd6b32fd3804bc82e1 /agent/command-ssh.c | |
parent | gpg: Do not delete any keys if --dry-run is passed. (diff) | |
download | gnupg-6e39541f4f488fe59eac399bad18c465f373a784.tar.gz gnupg-6e39541f4f488fe59eac399bad18c465f373a784.zip |
agent: For SSH key, don't put NUL-byte at the end.
* agent/command-ssh.c (ssh_key_to_protected_buffer): Update
the length by the second call of gcry_sexp_sprint.
--
GnuPG-bug-id: 4502
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | agent/command-ssh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 3cfd8aa14..d6729b70a 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -3003,8 +3003,8 @@ ssh_key_to_protected_buffer (gcry_sexp_t key, const char *passphrase, goto out; } - gcry_sexp_sprint (key, GCRYSEXP_FMT_CANON, buffer_new, buffer_new_n); - /* FIXME: guarantee? */ + buffer_new_n = gcry_sexp_sprint (key, GCRYSEXP_FMT_CANON, + buffer_new, buffer_new_n); if (*passphrase) err = agent_protect (buffer_new, passphrase, buffer, buffer_n, 0, -1); |