[git] GnuPG - branch, master, updated. gnupg-2.1.3-5-g25fce93
by Werner Koch
cvs at cvs.gnupg.org
Mon Apr 13 17:21:35 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 25fce93ba19d997e234a674d5cc98df82c5b5496 (commit)
from 5cde5bf37339cdeb0bd0a33d39477382eafebede (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 25fce93ba19d997e234a674d5cc98df82c5b5496
Author: Werner Koch <wk at gnupg.org>
Date: Mon Apr 13 11:44:10 2015 +0200
gpg: Fix NULL-segv due to invalid imported data.
* g10/free-packet.c (my_mpi_copy): New.
(copy_public_key, copy_signature): Use instead of mpi_copy.
--
Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/g10/free-packet.c b/g10/free-packet.c
index 99e7404..49d54f4 100644
--- a/g10/free-packet.c
+++ b/g10/free-packet.c
@@ -31,6 +31,20 @@
#include "options.h"
+/* This is mpi_copy with a fix for opaque MPIs which store a NULL
+ pointer. This will also be fixed in Libggcrypt 1.7.0. */
+static gcry_mpi_t
+my_mpi_copy (gcry_mpi_t a)
+{
+ if (a
+ && gcry_mpi_get_flag (a, GCRYMPI_FLAG_OPAQUE)
+ && !gcry_mpi_get_opaque (a, NULL))
+ return NULL;
+
+ return gcry_mpi_copy (a);
+}
+
+
void
free_symkey_enc( PKT_symkey_enc *enc )
{
@@ -190,11 +204,11 @@ copy_public_key (PKT_public_key *d, PKT_public_key *s)
n = pubkey_get_npkey (s->pubkey_algo);
i = 0;
if (!n)
- d->pkey[i++] = mpi_copy (s->pkey[0]);
+ d->pkey[i++] = my_mpi_copy (s->pkey[0]);
else
{
for (; i < n; i++ )
- d->pkey[i] = mpi_copy( s->pkey[i] );
+ d->pkey[i] = my_mpi_copy (s->pkey[i]);
}
for (; i < PUBKEY_MAX_NSKEY; i++)
d->pkey[i] = NULL;
@@ -237,10 +251,10 @@ copy_signature( PKT_signature *d, PKT_signature *s )
memcpy( d, s, sizeof *d );
n = pubkey_get_nsig( s->pubkey_algo );
if( !n )
- d->data[0] = mpi_copy(s->data[0]);
+ d->data[0] = my_mpi_copy(s->data[0]);
else {
for(i=0; i < n; i++ )
- d->data[i] = mpi_copy( s->data[i] );
+ d->data[i] = my_mpi_copy( s->data[i] );
}
d->pka_info = s->pka_info? cp_pka_info (s->pka_info) : NULL;
d->hashed = cp_subpktarea (s->hashed);
-----------------------------------------------------------------------
Summary of changes:
g10/free-packet.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list