Page MenuHome GnuPG

gpgsm unicode problem ?
Closed, ResolvedPublic

Description

When I import Thawte's Freemail certificate and try to list it, gpgsm says:
"Subject: [Error - invalid DN]" on subject line.

I tried to debug the problem and it seems that it can't correctly parse this
part of the subject: "CN=Marcin Gibu&#322\;a" where ł is a polish national
character. It also causes problems while signing mails in kmail.

Details

Version
2.0.0

Event Timeline

mg added projects: gnupg, Bug Report.
mg added a subscriber: mg.

Can you please send me that certificate. You may do that by private mail to
wk@gnupg.org.

I've sent it.
I forgot to add that I'm using amd64 and gcc-4.1.1 if it makes any difference.

That is an intersting encoding. dumpasn1 shows:

184 06 3: OBJECT IDENTIFIER surname (2 5 4 4)

<0C 0B 47 69 62 75 26 23 33 32 32 3B 61>

189 0C 11: UTF8String 'Gibu&#322;a'

So instead of using the real utf-8 it uses the html encoding of that character.
This is clearly not the right way. I guess that it has been done using a web
form and Thawte forgot to convert it. However they at least detected it and
used an UTF_8 tag. I will now check whey gpgsm does not list it correctly.

Here is the fix:

  • sm/certdump.c (revision 4347)

+++ sm/certdump.c (working copy)
@@ -376,7 +376,7 @@

else if (*s == '\"')
  return NULL; /* invalid encoding */
else if (*s == ',' || *s == '=' || *s == '+'
  • || *s == '<' || *s == '>' || *s == '#' || *s == ';' )

+ || *s == '<' || *s == '>' || *s == ';' )

  break; 
else
  n++;

A similar fix is needed for Kmail and Mutt.

Seems to be working for me.

werner claimed this task.
werner removed a project: Restricted Project.