From 7ccffbf566c34f68dbad786f31032af97f91f08f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 14 Jan 2016 09:27:30 +0100 Subject: [PATCH] xmlsecurity: import OOXML Change-Id: I051b3b0f69567cf7bcf4837ab6ccda221142b49e --- xmlsecurity/source/helper/ooxmlsecparser.cxx | 19 ++++++++++++++++--- xmlsecurity/source/helper/ooxmlsecparser.hxx | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/xmlsecurity/source/helper/ooxmlsecparser.cxx b/xmlsecurity/source/helper/ooxmlsecparser.cxx index 28eaeaa6f1c0..e47f9dddc6c2 100644 --- a/xmlsecurity/source/helper/ooxmlsecparser.cxx +++ b/xmlsecurity/source/helper/ooxmlsecparser.cxx @@ -13,9 +13,10 @@ using namespace com::sun::star; OOXMLSecParser::OOXMLSecParser(XSecController* pXSecController) - : m_pXSecController(pXSecController), - m_bInDigestValue(false), - m_bInSignatureValue(false) + : m_pXSecController(pXSecController) + ,m_bInDigestValue(false) + ,m_bInSignatureValue(false) + ,m_bInX509Certificate(false) { } @@ -65,6 +66,11 @@ throw (xml::sax::SAXException, uno::RuntimeException, std::exception) m_aSignatureValue.clear(); m_bInSignatureValue = true; } + else if (rName == "X509Certificate") + { + m_aX509Certificate.clear(); + m_bInX509Certificate = true; + } if (m_xNextHandler.is()) m_xNextHandler->startElement(rName, xAttribs); @@ -83,6 +89,11 @@ void SAL_CALL OOXMLSecParser::endElement(const OUString& rName) throw (xml::sax: m_pXSecController->setSignatureValue(m_aSignatureValue); m_bInSignatureValue = false; } + else if (rName == "X509Certificate") + { + m_pXSecController->setX509Certificate(m_aX509Certificate); + m_bInX509Certificate = false; + } if (m_xNextHandler.is()) m_xNextHandler->endElement(rName); @@ -94,6 +105,8 @@ void SAL_CALL OOXMLSecParser::characters(const OUString& rChars) throw (xml::sax m_aDigestValue += rChars; else if (m_bInSignatureValue) m_aSignatureValue += rChars; + else if (m_bInX509Certificate) + m_aX509Certificate += rChars; if (m_xNextHandler.is()) m_xNextHandler->characters(rChars); diff --git a/xmlsecurity/source/helper/ooxmlsecparser.hxx b/xmlsecurity/source/helper/ooxmlsecparser.hxx index 7b39cce13968..54c522b57c1a 100644 --- a/xmlsecurity/source/helper/ooxmlsecparser.hxx +++ b/xmlsecurity/source/helper/ooxmlsecparser.hxx @@ -33,6 +33,8 @@ class OOXMLSecParser: public cppu::WeakImplHelper OUString m_aDigestValue; bool m_bInSignatureValue; OUString m_aSignatureValue; + bool m_bInX509Certificate; + OUString m_aX509Certificate; public: OOXMLSecParser(XSecController* pXSecController);