Re: [Sks-devel] Re: zero-length MPIs (was: Re: mpi error with check-trustdb in 1.4.2 - resolved)

Jason Harris <[email protected]> Thu, 11 Aug 2005 20:22:43 -0400
Newsgroups gmane.comp.encryption.pgp.keyserver-folk,gmane.comp.gnu.gnupg.devel,gmane.comp.gnu.gnupg.users,gmane.comp.encryption.pgp.sks
Message-ID <[email protected]>
--===============0988572518==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="dEhLd0jN5MocHkcT"
Content-Disposition: inline


--dEhLd0jN5MocHkcT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 11, 2005 at 09:54:59PM +0200, Peter Palfrader wrote:
> On Thu, 11 Aug 2005, Jason Harris wrote:

> > Fetching them from keyserver.kjsl.com is now possible with gnupg-1.4.2.
> > To patch pks, add this to the middle of decode_mpi() (in pgputil.c):
> >=20
> >   /* skip packets with 0-length MPIs for GPG's benefit (gnupg-1.4.2) */
> >   if (mpi->nbits =3D=3D 0) {
> >     return (0);
> >   }
>=20
> can we do that in SKS too?  please!

Try the patch below.  0x1A9537E7 is another offending key, and all eight
work now:

  %gpg --recv 0xA0B3E88B 0xFC05DA69 0x0FCF6738 0xCC78C893 0x98FDE37C 0x74C9=
DE33 0x57023F00 0x1A9537E7
  ...
  gpg: Total number processed: 8
  gpg:              unchanged: 8

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: parsePGP.ml,v
retrieving revision 1.1
diff -u -r1.1 parsePGP.ml
--- parsePGP.ml	2005/08/12 00:03:16	1.1
+++ parsePGP.ml	2005/08/12 00:03:54
@@ -23,6 +23,7 @@
 open Printf
=20
 exception Overlong_mpi
+exception Zerolen_mpi
 exception Partial_body_length of int
=20
 (********************************************************)
@@ -109,6 +110,7 @@
   try
     let byte2 =3D cin#read_byte in
     let length =3D (byte1 lsl 8) + byte2 in
+    if length <=3D 0 then raise Zerolen_mpi;
     let data =3D cin#read_string=20
 		 ((length + 7)/8)
     in

--=20
Jason Harris           |  NIC:  JH329, PGP:  This _is_ PGP-signed, isn't it?
[email protected] _|_ web:  http://keyserver.kjsl.com/~jharris/
          Got photons?   (TM), (C) 2004

--dEhLd0jN5MocHkcT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iJ0EARECAF0FAkL769NWGGh0dHA6Ly9rZXlzZXJ2ZXIua2pzbC5jb206MTEzNzEv
cGtzL2xvb2t1cD9vcD1nZXQmc2VhcmNoPTB4RDM5REEwRTMmd2VoYXZleW91bm93
PXRydWUACgkQSypIl9OdoOPZ3wCfSl0Wty/7zH2BTLWRRQCfWySkNxYAn1gvDJ0s
PlsMCRFYBEMyxQsJdav0
=x25T
-----END PGP SIGNATURE-----

--dEhLd0jN5MocHkcT--

--===============0988572518==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pgp-keyserver-folk mailing list
[email protected]
http://lists.kjsl.com/mailman/listinfo/pgp-keyserver-folk

--===============0988572518==--