GpgME UID decoding bug?

Marc Mutz mutz@kde.org
Sun Jun 2 14:45:02 2002


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I've been trying to track down why "CN=3D=C44gypten Test Benutzer=20
3,OU=3DTest-Zentrum,O=3DIntevation GmbH,C=3DDE" appears in KMail instead of=
 =20
"CN=3D=C4gypten...", even after doing the obvious fix (in KMail) to convert=
=20
form UTF-8 instead of from latin1 ;-)

That's fixed by the attached patch to gpgme/key.c.

However, this chunk of code (gpgme/key.c:630) seems buggy:
Q>       else if (s[1] =3D=3D 'x' && my_isdigit (s[2]) && my_isdigit (s[3]))
where
Q> #define my_isdigit(a) ((a) >=3D'0' && (a) <=3D '9')

This even fails for the probably most often used case: \x3a (encoding=20
the colon for --with-colon listing).

Because the patch would not be an one-liner and I don't want to sign FSF=20
stuff first, please fix this yourself ;-))

Oh, and it might be a good idea to refactor the de-escaping code into a=20
function of it's own, just for aesthetical reasons ;-)

Index: gpgme/key.c
=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: /cvs/gnupg/gpgme/gpgme/key.c,v
retrieving revision 1.26
diff -u -3 -p -r1.26 key.c
=2D --- gpgme/key.c 30 May 2002 09:06:45 -0000      1.26
+++ gpgme/key.c 2 Jun 2002 12:38:43 -0000
@@ -637,7 +637,7 @@ _gpgme_key_append_name (GpgmeKey key, co
             }
          else
            *(byte*)d++ =3D val;
=2D -         s +=3D 3;
+         s +=3D 4;
         }
       else
        {


Marc

=2D --=20
Marc Mutz <mutz@kde.org>
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE8+hAR3oWD+L2/6DgRAojRAKDty+sgk2kkbnRIxD19b1bRVmlFTQCffeoD
oFES686+OVHchUjz0zE1bvM=3D
=3D14X1
=2D----END PGP SIGNATURE-----