summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 09:24:13 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 09:44:50 +0100
commit87f52aeec107544cea1db48809a8da6d00e3e5d2 (patch)
treef103a915ab07e14aae295bca89b44b9cd733cc76 /xmlsecurity
parent972d27f5652646d28dea9c5bdb3f987e8a8aebe8 (diff)
xmlsecurity: import OOXML <DigestValue>
Change-Id: I2ca893aba65a9b9ffd5ffaddbcb6accc13fca755
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/ooxmlsecparser.cxx20
-rw-r--r--xmlsecurity/source/helper/ooxmlsecparser.hxx3
2 files changed, 16 insertions, 7 deletions
diff --git a/xmlsecurity/source/helper/ooxmlsecparser.cxx b/xmlsecurity/source/helper/ooxmlsecparser.cxx
index 6f71a39ed53b..4966fd60e5d3 100644
--- a/xmlsecurity/source/helper/ooxmlsecparser.cxx
+++ b/xmlsecurity/source/helper/ooxmlsecparser.cxx
@@ -13,7 +13,8 @@
using namespace com::sun::star;
OOXMLSecParser::OOXMLSecParser(XSecController* pXSecController)
- : m_pXSecController(pXSecController)
+ : m_pXSecController(pXSecController),
+ m_bInDigestValue(false)
{
}
@@ -49,6 +50,11 @@ throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
m_pXSecController->addReference(aURI.copy(1));
// TODO else
}
+ else if (rName == "DigestValue")
+ {
+ m_aDigestValue.clear();
+ m_bInDigestValue = true;
+ }
}
void SAL_CALL OOXMLSecParser::endElement(const OUString& rName) throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
@@ -56,15 +62,15 @@ void SAL_CALL OOXMLSecParser::endElement(const OUString& rName) throw (xml::sax:
if (rName == "SignedInfo")
m_pXSecController->setReferenceCount();
else if (rName == "Reference")
- {
- // TODO import digest value
- OUString aDigestValue;
- m_pXSecController->setDigestValue(aDigestValue);
- }
+ m_pXSecController->setDigestValue(m_aDigestValue);
+ else if (rName == "DigestValue")
+ m_bInDigestValue = false;
}
-void SAL_CALL OOXMLSecParser::characters(const OUString& /*rChars*/) throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
+void SAL_CALL OOXMLSecParser::characters(const OUString& rChars) throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
{
+ if (m_bInDigestValue)
+ m_aDigestValue += rChars;
}
void SAL_CALL OOXMLSecParser::ignorableWhitespace(const OUString& /*rWhitespace*/) throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
diff --git a/xmlsecurity/source/helper/ooxmlsecparser.hxx b/xmlsecurity/source/helper/ooxmlsecparser.hxx
index 84ce2fc5adb9..40fb7b3de09a 100644
--- a/xmlsecurity/source/helper/ooxmlsecparser.hxx
+++ b/xmlsecurity/source/helper/ooxmlsecparser.hxx
@@ -28,6 +28,9 @@ class OOXMLSecParser: public cppu::WeakImplHelper
{
XSecController* m_pXSecController;
+ bool m_bInDigestValue;
+ OUString m_aDigestValue;
+
public:
OOXMLSecParser(XSecController* pXSecController);
virtual ~OOXMLSecParser();