diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-05 09:57:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-05 10:27:45 +0100 |
commit | a968893e6afd3b79c6c048962373859cea75a77b (patch) | |
tree | de0212ae04561475013c6523a6847d463d1a08b7 /xmlsecurity/source | |
parent | 88cbfe58c4a36c20bdb2445f43043f0a5a006ee3 (diff) |
xmlsecurity: parse dc:description in XSecParser
With this, the description is written in the XML file,
DigitalSignaturesDialog doesn't set it yet, though.
Change-Id: I54a73d6fbdf8ed936714a21ba1df5998849fd1fa
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.hxx | 1 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.cxx | 16 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.hxx | 3 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecverify.cxx | 9 |
4 files changed, 29 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index 22b54e984bc3..dcb4eaa706a5 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -371,6 +371,7 @@ private: void setDigestValue( OUString& ouDigestValue ); void setDate( OUString& ouDate ); + void setDescription(const OUString& rDescription); void setId( OUString& ouId ); void setPropertyId( OUString& ouPropertyId ); diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index e429535b1ddd..b7d37343c4dc 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -35,6 +35,7 @@ XSecParser::XSecParser(XSecController* pXSecController, , m_bInDigestValue(false) , m_bInSignatureValue(false) , m_bInDate(false) + , m_bInDescription(false) , m_pXSecController(pXSecController) , m_xNextHandler(xNextHandler) , m_bReferenceUnresolved(false) @@ -65,6 +66,7 @@ void SAL_CALL XSecParser::startDocument( ) m_bInSignatureValue = false; m_bInDigestValue = false; m_bInDate = false; + m_bInDescription = false; if (m_xNextHandler.is()) { @@ -176,6 +178,11 @@ void SAL_CALL XSecParser::startElement( m_ouDate.clear(); m_bInDate = true; } + else if (aName == NSTAG_DC ":" TAG_DESCRIPTION) + { + m_ouDescription.clear(); + m_bInDescription = true; + } if (m_xNextHandler.is()) { @@ -248,6 +255,11 @@ void SAL_CALL XSecParser::endElement( const OUString& aName ) m_pXSecController->setDate( m_ouDate ); m_bInDate = false; } + else if (aName == NSTAG_DC ":" TAG_DESCRIPTION) + { + m_pXSecController->setDescription( m_ouDescription ); + m_bInDescription = false; + } if (m_xNextHandler.is()) { @@ -296,6 +308,10 @@ void SAL_CALL XSecParser::characters( const OUString& aChars ) { m_ouDate += aChars; } + else if (m_bInDescription) + { + m_ouDescription += aChars; + } if (m_xNextHandler.is()) { diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx index 0cf47b18424b..f87ca23685b9 100644 --- a/xmlsecurity/source/helper/xsecparser.hxx +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -64,6 +64,8 @@ private: OUString m_ouDigestValue; OUString m_ouSignatureValue; OUString m_ouDate; + /// Characters of a <dc:description> element, as just read from XML. + OUString m_ouDescription; /* * whether inside a particular element @@ -74,6 +76,7 @@ private: bool m_bInDigestValue; bool m_bInSignatureValue; bool m_bInDate; + bool m_bInDescription; /* * the XSecController collaborating with XSecParser diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx index 2ebd27d74d26..d41214e4be93 100644 --- a/xmlsecurity/source/helper/xsecverify.cxx +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -262,6 +262,15 @@ void XSecController::setDate( OUString& ouDate ) isi.signatureInfor.ouDateTime = ouDate; } +void XSecController::setDescription(const OUString& rDescription) +{ + if (m_vInternalSignatureInformations.empty()) + return; + + InternalSignatureInformation& rInformation = m_vInternalSignatureInformations.back(); + rInformation.signatureInfor.ouDescription = rDescription; +} + void XSecController::setId( OUString& ouId ) { if (m_vInternalSignatureInformations.empty()) |