[git] GnuPG - branch, master, updated. gnupg-2.1.8-3-g7d5999f
by NIIBE Yutaka
cvs at cvs.gnupg.org
Wed Sep 16 03:41:03 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 7d5999f0964c9412c0e18eb1adefdb729be68cd4 (commit)
from faee25e670cfeb0d0166d7c59cc6a0b3842ee34d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7d5999f0964c9412c0e18eb1adefdb729be68cd4
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Wed Sep 16 10:37:38 2015 +0900
agent: Fix registering SSH Key of Ed25519.
* agent/command-ssh.c (stream_read_string): Add the prefix of 0x40.
--
GnuPG-bug-id: 2096
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 8868620..8be1255 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -580,8 +580,9 @@ stream_read_string (estream_t stream, unsigned int secure,
/* Read a binary string from STREAM and store it as an opaque MPI at
- R_MPI. Depending on SECURE use secure memory. If the string is
- too large for key material return an error. */
+ R_MPI, adding 0x40 (this is the prefix for EdDSA key in OpenPGP).
+ Depending on SECURE use secure memory. If the string is too large
+ for key material return an error. */
static gpg_error_t
stream_read_blob (estream_t stream, unsigned int secure, gcry_mpi_t *r_mpi)
{
@@ -607,9 +608,9 @@ stream_read_blob (estream_t stream, unsigned int secure, gcry_mpi_t *r_mpi)
/* Allocate space. */
if (secure)
- buffer = xtrymalloc_secure (length? length:1);
+ buffer = xtrymalloc_secure (length+1);
else
- buffer = xtrymalloc (length?length:1);
+ buffer = xtrymalloc (length+1);
if (!buffer)
{
err = gpg_error_from_syserror ();
@@ -617,11 +618,12 @@ stream_read_blob (estream_t stream, unsigned int secure, gcry_mpi_t *r_mpi)
}
/* Read data. */
- err = stream_read_data (stream, buffer, length);
+ err = stream_read_data (stream, buffer + 1, length);
if (err)
goto leave;
- *r_mpi = gcry_mpi_set_opaque (NULL, buffer, 8*length);
+ buffer[0] = 0x40;
+ *r_mpi = gcry_mpi_set_opaque (NULL, buffer, 8*(length+1));
buffer = NULL;
leave:
-----------------------------------------------------------------------
Summary of changes:
agent/command-ssh.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list