gpgme-tool: escape special characters in output XML data (<, >, and &).
authorW. Trevor King <wking@tremily.us>
Sat, 6 Oct 2012 15:30:21 +0000 (11:30 -0400)
committerWerner Koch <wk@gnupg.org>
Thu, 11 Oct 2012 14:22:46 +0000 (16:22 +0200)
commit3f1329e1c9b99b1632cc4c4eec2e4399676fd93d
tree2cc05aa8d56d4ec47358c06aa624c19fe0f9b11f
parentc28ebca9f2e21344d68e9fdcec60553f225c2e54
gpgme-tool: escape special characters in output XML data (<, >, and &).

[[PGP Signed Part:Undecided]]
src/gpgme-tool.c (result_xml_escape_replacement, result_xml_escape):
New.
(result_xml_tag_data): Use result_xml_escape() to escape data.
(result_add_error): Use unescaped < and >.
--

This is a general solution for generating valid XML, but the specific
output that inspired the change was from the KEYLIST command:

  <uid>William Trevor King <wking@tremily.us></uid>

Now the uids are properly escaped:

   <uid>William Trevor King &lt;wking@tremily.us&gt;</uid>

Signed-off-by: W. Trevor King <wking@tremily.us>
src/gpgme-tool.c