-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I had problems with UTF8 strings in advanced_csr displaying wrong
characters in the browser (?) on non "standard" characters, that
resulted in bloated CSRs.

This happened only in the DN entry (O and C attributes), these wrong
strings resulted from the XML parser when parsing browser_req.xml (and
probably other xml utf8 encoded files), that wasn't giving strings in utf8.

The form hidden fields had already the encoding error, wrong values were
being submited by the user. All input that came from the user browser
input appeared to be properly UTF-8 encoded.

My config files are all in UTF-8, so there must had to be a double
encoding problem, encoding conversion problem or something like that.

Checked the database and DBI, but the problem wasn't there...

I found that this could be solved by appending a hard-coded hidden
attribute in openca-1.1.1/lib/openca/cmds/advanced_csr +356

$hidden_list->{"O"}         = "Instituto Superior Técnico";

As this was not they right way to solve it, I digged it a little
further, finding out that the problem was in the XML parser XML::Twig,
that wasn't mantaining the original utf8 encoding from XML configuration
files. I solved it by passing the keep_encoding argument, to the
XML::Twig constructor:

openca-1.1.1/lib/openca/functions/rbac-utils.lib:115:
 my $twig_config = new XML::Twig('keep_encoding' => 1);

There are other occurrences of this constructor, I think these should
also respect the XML parsed file encoding:

openca-1.1.1/lib/openca/perl_modules/perl5/OpenCA/Log/Message.pm:147:
$self->{twig} = new XML::Twig('keep_encoding' => 1);

openca-1.1.1/lib/openca/perl_modules/perl5/OpenCA/XML/Cache.pm:427:
$self->{CACHE}->{$filename} = new XML::Twig('keep_encoding' => 1);

openca-1.1.1/lib/openca/perl_modules/perl5/OpenCA/Tools.pm:440:
$self->{twig} = new XML::Twig('keep_encoding' => 1);

I don't know if this is the best way to solve this problem, but it does
the job.

I think this might solve some other problems in OpenCA with strange
characters (?), as long as XML configuration files have the right
encoding. By the way I'm using Debian 6.0 / squeeze.

Cheers,
Daniel Almeida
DSI/Instituto Superior Técnico
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1B0E8ACgkQ/OHAq1+3BPUy8gCgv3eRM5zZGFWDAeztcVWBeNuy
m3EAnixdffycS3JQO+pn+rtWonARaE2M
=OlIu
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenCA-Devel mailing list
OpenCA-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-devel

Reply via email to